UML-XML for Discrete Event Simulation with Automatic Code

0 downloads 0 Views 225KB Size Report
design of simulation depending on UML notations and used special packages like javasim for generating special statistics and many other special programs for ...
UML-XML for Discrete Event Simulation with Automatic Code Generation Ability

Nawal A. Ibrahim Al-Mustansiria University

Nada M. Al-Hakkak College of Economic Science University

35

36

UML-XML for Discrete Event Simulation

Nawal A.Ibrahim &Nada M.Al-Hakkak

Abstract The cost of building a new system is usually quite high and time consuming, with probability of misunderstanding that might occur between the proposed system and the actual delivered one. Most stockholders; i.e. end users prefers to review the system in its early development stages before the reaching to the delivery deadline, in order to see whether the proposed solution (architecture) does actually satisfy their requirements. One way to achieve this is through simulation. Simulation programs can be built to minimize the execution time of the system; also the data that we get from the simulation’s execution enable us for early measure of the real system’s performance and make more analyzing processes. Unfortunately, there are some drawbacks though that may occur during those steps; e.g. it is often difficult to transform the design into a simulation program without a sound knowledge of some simulation techniques; a new simulation program needs to be built each time for different systems. Hence, it would be useful to have a tool that can automatically generate a simulation program from a design notation. In this paper, we present a mechanism for any organization to design their systems once and then transient them over time when the next best thing comes a long, that’s mean the design will be started in general form and then continuous to be developed in a more specific one, finally the code will be generated.

‫ﻣﺠﻠﺔ ﻛﻠﻴﺔ ﺑﻐﺪﺍﺩ ﻟﻠﻌﻠﻮﻡ ﺍﻻﻗﺘﺼﺎﺩﻳﺔ ﺍﻟﺠﺎﻣﻌﺔ ﺍﻟﻌﺪﺩ‬

‫ﺍﻟﺨﺎﻣﺲ ﻭﺍﻟﻌﺸﺮﻭﻥ ‪2010‬‬

‫اﻟﺨﻼﺼﺔ‬ ‫ﺗﻌﺗﺑﺭ ﻛﻠﻔﺔ ﺑﻧﺎء ﺍﻱ ﻧﻅﺎﻡ ﺟﺩﻳﺩ ﻋﺎﻟﻳﺔ ﻭﺗﺳﺗﻐﺭﻕ ﻭﻗﺕ ﻁﻭﻳﻝ ﻣﻊ ﺍﺣﺗﻣﺎﻟﻳﺔ ﻋﺩﻡ ﺍﻟﻔﻬﻡ ﺍﻟﺻﺣﻳﺢ‬ ‫ﻟﻣﺗﻁﻠﺑﺎﺕ ﺍﻟﻧﻅﺎﻡ ﺍﻟﻣﺭﺍﺩ ﺍﻧﺷﺎءﻩ ﻣﻣﺎﻳﺅﺩﻱ ﺍﻟﻰ ﺣﺻﻭﻝ ﺍﺧﺗﻼﻑ ﻣﺎﺑﻳﻥ ﺍﻟﻧﻅﺎﻡ ﺍﻟﻣﻁﻠﻭﺏ ﺍﻧﺷﺎءﻩ‬ ‫ﻭﺍﻟﻧﺗﻳﺟﺔ ﺍﻟﻔﻌﻠﻳﺔ‪ .‬ﻣﻌﻅﻡ ﺍﻟﻣﺳﺗﺧﺩﻣﻳﻥ ﺍﻟﻧﻬﺎﺋﻳﻳﻥ ﻟﻼﻧﻅﻣﺔ ﻳﻔﺿﻠﻭﻥ ﻣﻌﺭﻓﺔ ﺍﻟﻧﺗﺎﺋﺞ ﺍﻻﻭﻟﻳﺔ ﻟﻠﻧﻅﺎﻡ ﻭﻫﻭ‬ ‫ﻓﻲ ﻣﺭﺍﺣﻠﻪ ﺍﻻﻭﻟﻳﺔ ﻟﻠﺗﺻﻣﻳﻡ ﻟﻠﺗﺄﻛﺩ ﻣﻥ ﺗﺣﻘﻳﻘﻪ ﻟﻠﻣﺗﻁﻠﺑﺎﺕ ﺍﻟﺗﻲ ﺍﻧﺷﺄ ﺑﺳﺑﺑﻬﺎ ‪ ،‬ﺑﺩﻻ ﻣﻥ ﺍﺳﺗﻼﻣﻪ ﻓﻲ‬ ‫ﺍﻟﻣﺭﺣﻠﺔ ﺍﻟﻧﻬﺎﺋﻳﺔ ﻭﻟﺗﺣﻘﻳﻕ ﻫﺫﺍ ﺍﻟﻬﺩﻑ ﺗﻌﺗﺑﺭ ﺍﻟﻣﺣﺎﻛﺎﺓ ﺍﻟﺣﻝ ﺍﻻﻣﺛﻝ‪ .‬ﺗﺳﺎﻋﺩ ﺑﺭﺍﻣﺞ ﺍﻟﻣﺣﺎﻛﺎﺓ ﻓﻲ‬ ‫ﺗﺧﻔﻳﺽ ﻭﻗﺕ ﺗﻧﻔﻳﺫ ﺍﻟﺑﺭﻧﺎﻣﺞ ﺍﻻﺻﻠﻲ ﻣﻣﺎﻳﺳﺎﻋﺩ ﺍﻟﻰ ﺍﻟﺗﺣﺩﻳﺩ ﺍﻟﻣﺑﻛﺭ ﻟﻛﻔﺎءﺓ ﺍﻟﻧﻅﺎﻡ ﻭﺍﺟﺭﺍء ﺗﺣﻠﻳﻼﺕ‬ ‫ﺍﺿﺎﻓﻳﺔ‪.‬‬ ‫ﺑﺭﺍﻣﺞ ﺍﻟﻣﺣﺎﻛﺎﺓ ‪ ،‬ﻛﺑﻘﻳﺔ ﺍﻟﺑﺭﺍﻣﺟﻳﺎﺕ ‪ ،‬ﻟﺩﻳﻬﺎ ﺑﻌﺽ ﺍﻟﻣﺣﺩﺩﺍﺕ ﻣﺛﻼ ﺍﻟﺣﺎﺟﺔ ﺍﻟﻰ ﺧﻠﻔﻳﺔ ﻣﻌﺭﻓﻳﺔ ﻟﻠﺗﻌﺎﻣﻝ‬ ‫ﻣﻌﻬﺎ ‪ ،‬ﻭﻛﺫﻟﻙ ﺍﻟﺣﺎﺟﺔ ﻟﺑﻧﺎء ﻧﻅﺎﻡ ﻣﺣﺎﻛﺎﺓ ﻟﻛﻝ ﻣﺷﻛﻠﺔ ﺟﺩﻳﺩﺓ‪ .‬ﻭﻛﻧﺗﻳﺟﺔ ﻟﺫﻟﻙ ﻓﺎﻧﻪ ﻳﻔﺿﻝ ﺍﺳﺗﺧﺩﺍﻡ ﺍﺩﺍﺓ‬ ‫ﺭﺳﻭﻣﻳﺔ ﻣﺛﻝ )‪ Unified Modeling Language (UML‬ﺗﻘﻭﻡ ﺑﺄﻧﺷﺎء ﺑﺭﻧﺎﻣﺞ ﺍﻟﻣﺣﺎﻛﺎﺓ‬ ‫ﺑﺎﻻﻋﺗﻣﺎﺩ ﻋﻠﻰ ﺭﺳﻡ ﻟﻭﻅﺎﺋﻑ ﺍﻟﻧﻅﺎﻡ ﺍﻟﻣﺭﺍﺩ ﺗﺻﻣﻳﻣﻪ‪.‬‬ ‫ﻓﻲ ﻫﺫﺍ ﺍﻟﺑﺣﺙ ﻗﻣﻧﺎ ﺑﺗﻘﺩﻳﻡ ﻣﻳﻛﺎﻧﻳﻛﻳﺔ ﻳﻣﻛﻥ ﻻﻱ ﻣﻧﻅﻣﺔ ﺍﻥ ﺗﺳﺗﺧﺩﻣﻬﺎ ﻟﻐﺭﺽ ﺍﻧﺷﺎء ﺍﻧﻅﻣﺗﻬﺎ ﺍﺑﺗﺩﺍءﺍ‬ ‫ﻣﻥ ﺗﺻﻣﻳﻣﻬﺎ ﺑﺷﻛﻝ ﻋﺎﻡ ﻭﺛﻡ ﺍﻻﻧﺗﻘﺎﻝ ﺍﻟﻰ ﻣﺭﺍﺣﻝ ﺍﻛﺛﺭ ﺗﺧﺻﺻﺎ ﺑﻭﻅﺎﺋﻑ ﺍﻟﻧﻅﺎﻡ ﻭﺍﻧﺗﻬﺎءﺍ ﺑﺎﻧﺷﺎء‬ ‫ﺍﻟﺑﺭﻧﺎﻣﺞ ﻭﺑﺷﻛﻝ ﺍﻭﺗﻭﻣﺎﺗﻳﻛﻲ ‪ ،‬ﻣﻊ ﺗﻘﺩﻳﻡ ﻣﺛﺎﻝ ﺗﻭﺿﻳﺣﻲ ﻷﺳﻠﻭﺏ ﻋﻣﻝ ﺍﻟﻣﺣﺎﻛﻲ ﺍﻟﺫﻱ ﻳﻌﺗﻣﺩ ﺍﺳﻠﻭﺏ‬ ‫‪ Discrete Event Simulation‬ﻓﻲ ﻋﻣﻠﻪ‪.‬‬

UML-XML for Discrete Event Simulation

Nawal A.Ibrahim &Nada M.Al-Hakkak

Introduction 1 Introduction In complex dependable systems it is desirable to be able to predict or estimate the performance before the system is built. This is typically achieved by the use of system simulation. However, building a simulation program is not a trivial task. The complexity of the proposed system often makes it difficult to begin and quite often a new simulation needs to be built from scratch. The system developer also needs to know about some simulation techniques which are not always the case. These difficulties can be overcome by first identifying the common components of a simulation and their characteristics. Then, some interactions between these components can be defined to provide a way to mimic the behavior of the proposed system. Based on the components and their interactions, it is possible to construct a language/syntax which can then be parsed to create simulation programs. The syntax we have used follows the UML notation (in a textual form) which enables automatic generation of the simulation program from UML; i.e. specification. The rest of the paper is structured as follows: section 2 illustrates the design notations of UML and the constraints on that design by OCL expressions, section 3 illustrates the saving process by XML documents and retrieving data by SAX parser. Section 4 will describe the simulation environment. Section 5 will give a description of our approach for simulation development process. Section 6 discus previous works on this topic. Section 7 gives a conclusion and finally section 8 for references.

2 System Design Tools 2.1 UML

U

Unified Modeling Language (UML), is a language for specifying, visualizing, constructing and documenting the intercutting parts of software systems. It uses graphical notations to illustrate a system’s specification; according to the main objective of this paper which is minimize the need for written code; we shall describe the class diagram as one of the UML tools in developing systems: Class diagrams

2010 ‫ﺍﻟﺨﺎﻣﺲ ﻭﺍﻟﻌﺸﺮﻭﻥ‬

‫ﻣﺠﻠﺔ ﻛﻠﻴﺔ ﺑﻐﺪﺍﺩ ﻟﻠﻌﻠﻮﻡ ﺍﻻﻗﺘﺼﺎﺩﻳﺔ ﺍﻟﺠﺎﻣﻌﺔ ﺍﻟﻌﺪﺩ‬

A class diagram represents the static structure of a system which includes the static elements (objects classes) of the system and the static relationships between them. A class represents a set of objects with similar structures (attributes) and behaviors (operations). Two or more classes can have a relationship between them and the relationship can be: An association An association indicates the role a class plays in the relationship. On top of that, there are some additional notations available for the association, such as the multiplicities (which indicates how many instances a class can have in the association), aggregation (to show that one class is a collection of several instances of the other class), composition (one class is a part of the other class) and dependency (to indicate that one class depends on the other). A generalization This captures the notion of inheritance; it shows the relationship between a more general element (the super type) and a more specific element (the subtype). The subtype inherits the properties of its super type and it may have some additional (more specific) information [4]. U

U

2.2 OCL Object Constraint Language (OCL), is a textual specification language, designed especially for the use in the context of diagrammatic specification languages such as UML. OCL always used to add well-formed rules on the UML model. OCL is tightly connected to UML diagrams, it is used to define pre- and post-conditions, invariants, transition guards. OCL also uses the elements defined in the UML diagrams, such as classes, methods (side effect free) and attributes. However, the language is based on types; and each OCL expression evaluates those types either throw predefinition by the language or defined by the model on which the expression is built. Composing an expression comes out through the concept of navigation [2].

UML-XML for Discrete Event Simulation

Nawal A.Ibrahim &Nada M.Al-Hakkak

3 Saving Data and Retrieving Tools 3.1 XML The eXtensible Markup Language (XML) is an emerging and rapidly involving technology that is shaping the second −generation Web, following the revolution started by the combination of hypertext and a global Internet. The most exciting possibility opened up by XML is the semantic Web envisioned by the creators of XML. Such a Web will be powered by systems that talk to each other in XML so that there will be no confusion about the syntax of the data being exchanged. In addition, XML have some supporting tools; e.g. XML meta-data standard; Resource Description Framework (RDF). XML-enabled data can carry with itself not only structural information but also semantic information; which will greatly facilitate the automatic processing of information. For example, XML will allow agents accessing the Web to pull data from the Web by semantics. The agents can then automatically extract the portion it has interest in, synthesize the information with other information it has gathered, possibly store the final results in a database, and/or forward them to other agents. Although XML is created as a standard format for exchange of structured data over the Web, it is likely to play an increasingly important role in other types of future information systems. Among its many merits, it has huge potential in opening up the possibility of syntactic and semantic interoperability between disparate systems. With regard to syntactic interoperability, the structure and type information about an XML document can be precisely captured in an XML schema file, which can be passed along with the XML document from one application to another application. Since XML Schema is also a standard, there will no ambiguity or misunderstanding about the syntax of the XML document. At the semantic level, the XML expected to work closely with an existing mapping to provide domain specific semantics to an XML document. In addition, as a self-descriptive, text-based, and universal data format, XML is an excellent choice for representing data, or even objects, that need to be transported over the network between disparate systems. Despite the many dreams, visions, and uses that XML seems to promise, XML in itself is just a format for encoding structured data [7].

2010 ‫ﺍﻟﺨﺎﻣﺲ ﻭﺍﻟﻌﺸﺮﻭﻥ‬

‫ﻣﺠﻠﺔ ﻛﻠﻴﺔ ﺑﻐﺪﺍﺩ ﻟﻠﻌﻠﻮﻡ ﺍﻻﻗﺘﺼﺎﺩﻳﺔ ﺍﻟﺠﺎﻣﻌﺔ ﺍﻟﻌﺪﺩ‬

3.2 SAX Currently, there are several ways to access an XML document. The Simple APIs for XML (SAX) and the Document Object Model (DOM) APIs are most often used. SAX provides an event −based programming model. A SAX parser uses callbacks to report whatever it reads from an XML document back to a program. Since it takes only one scan for a SAX parser to process an XML document, SAX parsers are very efficient and good for large XML documents or stream −based XML documents. However, because of its callback mechanism, SAX parser may not be flexible enough for those programs that need to manipulate an XML document in sophisticated ways. On the other hand, DOM provides−based a tree programming model. A DOM parser loads an entire XML document into memory and then converts it into a tree structure. The DOM APIs allow programs to traverse and modify the XML tree. DOM parsers are more flexible but less efficient than SAX [3].

4 Simulation-Types 4.1 Next-event scheduling Changes in the system statistics take place only when the following two events occur: 1- A job arrives 2- A job departs after it service is completed. The main idea of next-event scheduling is to advance along the time scale until an event is encountered. The following is the summary of the action associated with arrival and departure events. Arrival Events Actions 1- Check the status of the server (idle or busy) (a) if idle, do the following (i) start the job in service and generate it's departure time by adding it's service time to the current simulation time. (ii) indicate that the server is busy and update the idle time statistics of the facility. (b) If busy, place the arriving job in the queue and update the queue length statistics. 2- Generate the arrival time of the next job by adding an inter-arrival time to the current time of the simulation.

UML-XML for Discrete Event Simulation

Nawal A.Ibrahim &Nada M.Al-Hakkak

Departure Event Actions - Check the queue (empty or not empty) (a) If empty, reverse the facility status to idle (b) If not empty, do the following: (i) Choose a waiting job from the queue and update the queue length and the job waiting time statistics. (ii) Start the job in service and generate its departure time by adding it's service time to the current simulation time. To perform these actions, it is necessary to specify two time elements: 1- The interarrival time for successive job (λ). 2- The service time for each job (µ). In simulation these data elements are either fixed (known with certainly) or sampled from probability distribution that describe the simulation (Montecarlo). If the inter-arrival time, service time sampled from probability distribution the following formula used to sample from some famous distribution: 1- Sampling the exponential Distribution: t=−

1

λ

ln R → for inter-arrival time

(1)

or t=−

1

µ

ln R → for service time

(2)

Where λ = number of job arrive per unit of time. µ= number of job served per unit of time. 2- Sampling the Normal Distribution: Using these two formula we can generate two standard normal with mean 0, and variance 1: X 1 = − 2 InR1 cos (2πR2 ) (3) X 2 = − 2 ln R2 sin (2πR1 )

(4) The two samples can be converted to any N(µ,σ) by using the formula : Y= µ+ σ x (5) Where µ, σ should be known from real life and other study. The user should input these parameters when starting simulation. At the end we can complete the needed statistics which are average waiting time per customer, average server idle time, average queue length [6].

2010 ‫ﺍﻟﺨﺎﻣﺲ ﻭﺍﻟﻌﺸﺮﻭﻥ‬

‫ﻣﺠﻠﺔ ﻛﻠﻴﺔ ﺑﻐﺪﺍﺩ ﻟﻠﻌﻠﻮﻡ ﺍﻻﻗﺘﺼﺎﺩﻳﺔ ﺍﻟﺠﺎﻣﻌﺔ ﺍﻟﻌﺪﺩ‬

Sampling from Exponential Distribution Suppose that in service facility the service time t is exponential with service rate µ per unit time [8] Then the pDF of t is: 𝑓𝑓(𝑡𝑡) = 𝜇𝜇𝑒𝑒 −𝜇𝜇𝜇𝜇 , 𝑡𝑡 > 0 𝑡𝑡 Thus we have: 𝑓𝑓(𝑡𝑡) = ∫0 𝜇𝜇𝑒𝑒 −𝜇𝜇𝜇𝜇 𝑑𝑑𝑑𝑑 = 1 − 𝑒𝑒 −𝜇𝜇𝜇𝜇 If R is a [0,1] random number; Then putting F(t) = R we get: 1 1 R = 1 – e -µt and 𝑡𝑡 = − ln(1 − 𝑅𝑅) = − ln 𝑅𝑅 by replacing (1 – R) U

𝜇𝜇

𝜇𝜇

with R. Because R is [0,1] random number and so [1-R] . So, to generate service time t with service rate µ per unit of time from exponential distribution or to generate time t between customer arrivals from exponential distribution with λ customer arrive per unit of time use the following formulas: 1 𝑡𝑡 = − ln 𝑅𝑅 𝑓𝑓𝑓𝑓𝑓𝑓 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡 𝜇𝜇 Or 1 𝑡𝑡 = − ln 𝑅𝑅 𝑓𝑓𝑓𝑓𝑓𝑓 𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖 − 𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎 𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡 𝜆𝜆 Example: Given λ = 4 customer per hour and R= 0.9 a sample of period until the arrival of the next customer is computed as: 1 𝑡𝑡 = − ln(1 − 0.9) = 0.577 ℎ𝑜𝑜𝑜𝑜𝑜𝑜 = 34.5𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚 4 U

Sampling from Normal Distribution: Box and Muller(1958) prove that x is standard N(0,1).Thus , y = µ + σ x will produce a sample from N(µ , σ ) [9]. To illustrate the implementation of the Box – Muller procedure to the distribution N(10,2), generate two random numbers R1 ,R2 from uniform ( 0,1) U

Example: R1 = 0.0589 R2 = 0.6733 This yield the following N(0,1) samples 𝑋𝑋1 = �−2 ln 𝑅𝑅1 cos(2𝜋𝜋𝑅𝑅2 ) = √−2 ln 0.0589 cos(2𝜋𝜋0.6733) = −1.103 U

UML-XML for Discrete Event Simulation

Nawal A.Ibrahim &Nada M.Al-Hakkak

𝑋𝑋2 = �−2 ln 𝑅𝑅1 sin(2𝜋𝜋𝑅𝑅2 ) = √−2 ln 0.0589 sin(2𝜋𝜋0.6733) = −2.108 Thus the corresponding N(10,2) samples are y1 = 10 + 2(- 1.103) = 7.794 y1 = 10 + 2(- 2.108) = 5.7823 Example: The interarrival time of customers at Hairkare Barber shop is exponential with mean 10 minutes. The service time is fixed as 15 minute per customer . Compute the following: • The average utilization of the barber • The average number of waiting customers. • The average time a customer waits in queue. The logic of the simulation model: Let p represent random samples of intervial time . P = -10 ln ( R ) , 0 ≤ R ≤ 1 Where R is a random number Let q = 15 service time Let T =simulation clock time Let first customer arrives at T=0 and facility starts empty . U

Arrival Event at T=0 (customer1) Customer2 will arrive at T = 0 + p1 p1 = -10 ln (0.0589) = 28.3 minutes T = 0 the facility is idle ,customer1 will leave at T = 0 + 15 = 15 The future chronological events list are 1. Departure at T = 15 2. Arrival at T = 28.3 The most imminent events is departure at T=15 . Departure Event at T=15 Queue is empty Facility idle Record the facility has been busy between T=0 and T= 15. Update list of future events is 1. Arrival at T= 28.3 The next event is arrival at T=28.3

2010 ‫ﺍﻟﺨﺎﻣﺲ ﻭﺍﻟﻌﺸﺮﻭﻥ‬

‫ﻣﺠﻠﺔ ﻛﻠﻴﺔ ﺑﻐﺪﺍﺩ ﻟﻠﻌﻠﻮﻡ ﺍﻻﻗﺘﺼﺎﺩﻳﺔ ﺍﻟﺠﺎﻣﻌﺔ ﺍﻟﻌﺪﺩ‬

Arrival Event at T=28.3 (customer 2) Customer3 will arrive at T=28.3 + p2 =35.64 Where p2 = -10 ln (0.4799) = 7.34 The facility is idle Customer 2 start service The departure event for customer2 occurs at T=28.3 + 9 = 28.3 + 15 = 43.3 The list of future events is updated as 1. Arrival at T= 35.64 2. Departure at T=43.3 The next chronological event is an arrival at T=35.64. Arrival Event at T=35.64 (customer3) Customer 4 will arrive at T= 35.64 + (-10 ln (.6139)) =40.52 The facility is currently busy (until T=43.3) Customer3 placed in queue The update list of future events is 1. Arrival at T=40.52 2. Departure at 43.3 Continue in updating future events list for run time of 50 minutes table 1 summaries all events list where Ea ,Ed are arrival event and departure event. Table (1): Summaries the computation process for all events Time Event customer waiting 0 Ea 1 15 Ed 1 28.3 Ea 2 35.64 Ea 3 40.52 Ea 4 43.3 Ed 2 43.3-35.64=7.66 customer3 45.74 Ea 5 58.3 Ed 3 50- 40.52 = 9.48 customer4 ** 50- 45.74 = 4.26 customer5 Sum = 21.40 ** assuming that simulation will run for 50 minutes only.

UML-XML for Discrete Event Simulation

Nawal A.Ibrahim &Nada M.Al-Hakkak

Figure (1) Summaries the change in the length of the queue and facility utilization [6]

Figure (1): Summery graph for queuing-update [6]

The average values are computed as follows: 1. Average value of a time –based variable=area under curve/simulated period 2. Average queue length = 21.4/50 = 0.428 customer 3. Average facility utilization = 36.7/50 = .734 barber 4. Average waiting time in the queue = sum of waiting time / 3 = 7.13 minutes 5. Average waiting time for ll customer = 21.4 / 5 =4.28 minutes

5 The Proposed Method The proposed approach in this paper contains 5-steps that end’s in generating the proposed simulation: Step-1 Create a general platform model, this model will have general features and its independent on any special structure. The proposed architecture will depend on UML diagrams that contain class diagrams and their relations. However, this will be accomplished by using Graphical User Interface (GUI), for example rational rose. With the help of Object Constraints Language (OCL) for making conditions and constraints on the relations; finally the feedback step is important from the stockholders. Step-2 In this step the generated platform will be more specific by adding more features to it, so the model will go from the general form to a specific one. However, it is important to know that the general form will stay separately from the specific one; and there would be more than one specific

2010 ‫ﺍﻟﺨﺎﻣﺲ ﻭﺍﻟﻌﺸﺮﻭﻥ‬

‫ﻣﺠﻠﺔ ﻛﻠﻴﺔ ﺑﻐﺪﺍﺩ ﻟﻠﻌﻠﻮﻡ ﺍﻻﻗﺘﺼﺎﺩﻳﺔ ﺍﻟﺠﺎﻣﻌﺔ ﺍﻟﻌﺪﺩ‬

form for each general model. Anyway, at the end of this step the developer can have a full description of the system needs and requirements. Step-3 A code generation will take place depending on the forms generated from step-1 and 2. The type of system is a discrete-event simulation, and there will be a user-interface for entering the parameters when starting the simulation. So, the operation will begin by the configuration files; at the end the user will get the desired simulation for using. Step-4 The output data will be stored in XML files. Step-5 Information retrieval will be by using SAX, which is having a special package for making parsing from XML files.

6 Related Works There was two main types of previous studies, the first one focused on the design of simulation depending on UML notations and used special packages like javasim for generating special statistics and many other special programs for connecting the work, but there was no validation on the design diagram, so it could have some ambiguity [1], the second study focused on designing in three levels depending on the MDA, ModuleDriven Architecture, as a full lifecycle integration for systems [5].

7 Conclusions In this paper, we proposed a new approach for automatic code generation simulation from UML notations with the constraint of OCL, without OCL the model would be severely underspecified. The design will be created in multilevel or hierarchal way, starting from the general form to a more specific one. Hence, the developer will have the advantage of feedback from the user or organization. In software engineering terms the proposed approach is perfect to deal with agile software systems. In later levels a code generation will take place with statistics after describing the simulation environment and the code language. Resulting data will be saved in XML documents; which have a general syntax for saving data over the web, finally retrieving the data would be through using SAX parser.

UML-XML for Discrete Event Simulation

Nawal A.Ibrahim &Nada M.Al-Hakkak

8 References 1. Arief, L.B., & Speris, N.A. (2000). A UML Tool for an Automatic Generation of Simulation Programs. ACM. 2. Bostaschajon, Jewgenij, Pister, Markus, & Rumpe, Bernhard. (2004). Testing agile requirements models. Journal of Zhejiang University SCIENCE. ISSN 1009-3095 3. Chase . Nicholas. 2004. Understanding SAX. developerWorks. ibm.com. Accessed in Jan 2007. 4. Massion, Tiago, Gheyi, Rohit & Borba, Paulo. (2004). A UML Class Diagram Analyzer. Information Center. Federal University of Pernambuco. 5. Parr, Ahawn. (2003). A Visual Tool To Simplify The Building Of Distributed Simulations Using HLA. Information & Security. An International Journal. Vol.12 No.2. 151-163. 6. Taha, Hamdi A. (1987). Operations Research. New York. Macmillan 3d edition. 7. Walsh, Norman. (1998). A technical Introduction to XML. World Wide Web Journal. Accessed in Jan2007. 8. Taha, Hamdi A (1989) Operations Research. New York. Macmillan 4 th edition. 9. Taha Hamdi A. (1997) Operations Research. New York. Macmillan – 6 th edition. U

U

U

U

U

U

U

U

U

U

U

U

U

U

U

U

U

U