Performance Evaluation of Discrete Event Systems with GPenSIM
Abstract
:1. Introduction
2. Introducing the Petri Net Simulator GPenSIM
2.1. The Design and Development of GPenSIM
- (1)
- To allow the easy integration of Petri net models with any other tools that are available on the MATLAB platform. Being an industry standard platform, MATLAB has numerous toolboxes such as Fuzzy logic, Neural Network, Machine learning, Control systems, Advanced Statistics, etc. For example, a modeler can easily integrate a discrete event model with the Control systems toolbox, making a hybrid system. The simulation results from this hybrid system can be easily analyzed using the Advanced Statistical toolbox that is readily available on the MATLAB platform. Being a MATLAB toolbox, GPenSIM gives numerous possibilities for extending the discrete event models, which is not easy (if not impossible) in other software (e.g., Arena). This flexibility offered by GPenSIM is the reason why the Australian research team chose GPenSIM over the other tools, as they quote in their paper [9].
- (2)
- Easy to learn and use: GPenSIM is easy to learn and use. This is because the programming language of GPenSIM is MATLAB, which is a very simple Basic language clone. This ease of learning and use is the main reason why some of the users of GPenSIM have chosen it as a tool for the modeling and simulation of various discrete event systems, such as Gameplay analysis, flexible manufacturing systems, motor control, and service modeling (see the references [7,9,10,11,12,13]).
- (3)
- Easy to extend: Being a file-based system, a modeler can easily extend the functions available in GPenSIM. For example, Professor Tilbury’s group at the Michigan University, USA, created their own version (named “Attributed Hybrid Dynamical Nets”) by extending GPenSIM functions to transform it into a tool for modeling complex interconnected manufacturing systems [10].
- Petri net Definition File (PDF): A PDF declares the static Petri net graph: the set of places, the set of transitions, and the set of connections (arcs) are declared in this file.
- Main Simulation File (MSF): The MSF declares the initial dynamics (e.g., initial tokens in the places, firing times of the transitions, firing costs of the transitions, etc.) and runs the simulations. When the simulation terminates, the code for plotting and printing the simulation results are also coded in this file.
- The common preprocessor file (COMMON_PRE): If there are additional conditions for the enabled transitions to satisfy before firing, these conditions are coded in the COMMON_PRE file.
- The common postprocessor file (COMMON_POST): If there are any postfiring actions to be performed after firing of transitions, these actions can be coded in the common postprocessor file.
2.2. Comparing GPenSIM with the Other Petri Net Simulators
3. Introducing the Activity-Oriented Petri Nets (AOPN) Approach
The Background of AOPN
4. Petri Nets and Event Graphs: Definition and Properties
4.1. Definitions
4.1.1. Definition: Classic Petri Net (PN) [1,2]
- A classic Petri Net is a 4-tuple PN = (P, T, A, m), where
- P is the set of places, P = {p1, p2, … , pn}
- T is the set of transitions, T = {t1, t2, … , tm},
- A is the set of arcs (from places to transitions and from transitions to places),
- A ⊆ (P × T) ⋃ (T × P), and
- m is the row vector of markings (tokens) on the set of places
- m = [m(p1), m(p2), …, m(pn)] ∈ Nn, m0 is the initial marking.
- Definition: Input and Output Sets of a Place
4.1.2. Definition: Timed Petri Net (TPN)
- A Timed Petri Net is a 5-tuple TPN = (P, T, A, m0, D), where
- PN = (P, T, A, m0) is a classic Petri Net, and
- D: T → R+ is the duration function—a mapping of each transition to a positive rational number, meaning that the firing of each transition ti takes dti time units.
4.1.3. Definition: Event Graph (EG)
4.1.4. Definition: Strongly Connected Graph
4.1.5. Definition: Elementary Circuit
4.2. Properties of Strongly Connected Event Graphs
- Property 2: Performance is bounded by its critical circuit [1,20]. The critical circuit is the elementary circuit that has the lowest flowrate r·r* = min Σ(m(pn))/Σ(dti), where Σ(dti) is the sum of the firing times of the transitions in the circuit and Σ(m(pn)) is the sum of all tokens in that circuit.
- Property 3: Under the assumption that a transition fires as soon as it is enabled, the firing rate of each transition in steady state (the same as the current token flow rate at any point in the circuit) is given by r = r* [20].
- Property 4: Deadlock-free if, and only if, every elementary circuit contains at least one token [1].
5. Implementing Petri Nets with GPenSIM
- A classic Petri Net: firing times are not assigned to any of the transitions, meaning all the transitions are primitive [2]; or
- A Timed Petri Net: firing times are assigned to all the transitions, meaning all the transitions are nonprimitive.
5.1. Implementing Timed Petri Nets with GPenSIM
- No variable firing time: the transitions representing events are assigned a firing time beforehand. The pre-assigned firing time can be deterministic (e.g., firing time dti = 5 TU) or stochastic (e.g., firing time dti is normally distributed with mean value 10 TU and standard deviation 2 TU). However, variable firing times are not possible.
- Maximal-step firing policy: The Timed Petri Net operates with the maximal-step firing policy; this means that, if more than one transition is collectively enabled and they are not in conflict with each other at a point of time, all of them fire at the same time.
- Enabled transition starts firing immediately: enabled transition can start firing immediately as long as there is no (forcibly) induced delay between the time a transition became enabled and the time it is allowed to fire.
5.2. The GPenSIM Functions for the Performance Evaluation of Event Graphs
- Flag 1: whether the Petri net is a Binary Petri Net or not (0 = not a binary Petri Net).
- Flag 2: whether the Petri net is a State Machine or not (0 = not a State Machine).
- Flag 3: whether the Petri net is an Event Graph or not (0 = not an Event Graph).
- Flag 4: whether the Petri net is a Timed Petri Net or not (0 = not a Timed Petri Net).
- Flag 5: number of Strongly Connected Components in the Petri Net.
- Increasing the token count of the critical circuit by Δm0,where Δm0 = [efr × Σ(dti)] − Σ(m(pn)); or
- Reducing the delay (total firing times) of the circuit by Δft,where Δft = Σ(dti) − [Σ(m(pn))/efr].
6. Simulation of Event Graphs with GPenSIM: An Example
- The input raw material of type 1 arrives on the conveyor belt C1. Robot R1 picks up the raw material of type 1 and places into the machine M1. Similarly, robot R2 picks up the raw material of type 2 from conveyor belt C2 and places it into the machine M2.
- Machine M1 makes the part P1, and M2 makes the part P2. When the parts are made by the machines M1 and M2, they are placed on the assembly station (AS) by the robots R1 and R2, respectively.
- Assembly station AS is used to join the two parts P1 and P2 together to form the semiproduct. Robot R2 does the part assembly at AS.
- Robot R3 picks the product from the assembly station and places it on the painting station PS.
- Robot R4 performs the surface polishing and painting.
- Once the painting is completed, robot R3 picks up the completed product from the painting station PS and packs it into the cartridge OB.
- tC1: conveyor belt C1 brings the input material of type 1 into the FMS.
- tC2: conveyor belt C2 brings the input material of type 2 into the FMS.
- tC1M1: robot R1 moves raw material from conveyor belt C1 and places it on M1.
- tC2M2: robot R2 moves raw material from conveyor belt C2 and places it on M2.
- tM1: machining of part 1 at machine M1.
- tM2: machining of part 2 at machine M2.
- tM1AS: robot R1 moves part 1 from M1 to the Assembly Station AS.
- tM2AS: robot R2 moves part 2 from M2 to the Assembly Station AS.
- tAS: robot R2 assembles parts P1 and P2 together at the assembly station AS.
- tAP: robot R3 picks the product from the assembly station and places on the painting station PS.
- tPS: robot R4 performs surface polishing and painting on the product.
- tPCK: when the painting job is finished, R3 packs the product into the output cartridge.
6.1. The Petri Net Model
- The supply of raw materials from the input buffers (IB1 and IB2) is never exhausted;
- The finished product will be placed into the output buffer OB that has no capacity restraints.
6.2. GPenSIM Code for Simulation
- Petri Net Definition File (PDF): This is the coding of the static Petri net (the structure of the Petri net defined by the sets of places, transitions, and arcs).
- Main Simulation File (MSF): In this file, the initial dynamics (e.g., initial tokens in places pC1, pC2, pR1, pR2, and pR3, and the firing times of transitions) are declared.
- COMMON_PRE: In this file, the conditions for the enabled transitions to start firing are coded. However, in this FMS example, there are no additional conditions for the transitions as they start firing whenever they become enabled.
- COMMON_POST: The postfiring actions of the transitions are coded in this file. Again, this file is not necessary for the FMS example, as there are no post-actions needed to be carried out.
- The cycle that creates the deadlock,
- The current flow rate, and
- How we can increase the flow rate to 0.07 tokens per TU.
6.3. The Simulation Results
7. The Two Phases of the AOPN Approach
7.1. Phase I: Creating the Static Petri Net Graph
7.2. Phase II: Adding the Run-Time Dynamics
8. Simulation with GPenSIM
8.1. Scheduling Using GPenSIM
- Instances of a resource: A resource can have many indistinguishable copies (“instances”), e.g., there are three cashiers in a shop (resource cashier has three instances). For a customer, it does not make sense to prefer one cashier over the others. In this case, we could generalize all the cashiers into a group, name this resource as “cashier”, and say that cashier is a single resource with three instances.
- Generic resources: There are some “named” resources available, but all of them are the same for some specific applications, e.g., in a mechanical workshop, there are three mechanics named “Alan”, “Bobby”, and “Chan”; though they are specialists in some works, when it comes to engine repair, they all are the same. Thus, for engine repair, we can pick a generic mechanic, without specifically naming anyone.
- Specific resources: When the resources are named, we may request specific (named) resources. For example, in the mechanical workshop, “Chan” is an electrician. Hence, when we need an electrical fixing, we would prefer to use the specific resource “Chan”.
- Write Access: When a resource has many instances, a transition may try to acquire one or many of these instances. Write access means that the resource will be locked, and all the instances will be made available to a requesting transition.
8.2. Code Implementation with GPenSIM
8.3. Simulation Result
9. Discussion
9.1. Gpensim Is Not Only for Event Graphs
9.2. The Advantages of the AOPN Approach
Author Contributions
Conflicts of Interest
References
- Peterson, J.L. Petri Net Theory and the Modeling of Systems; Prentice-Hall: Englewood Cliffs, NJ, USA, 1981. [Google Scholar]
- Proth, J.M. Performance evaluation of manufacturing systems. In Practice of Petri Nets in Manufacturing; Springer: Dordrecht, The Netherlands, 1993; pp. 147–183. [Google Scholar]
- Commoner, F.; Holt, A.W.; Even, S.; Pnueli, A. Marked directed graphs. J. Comput. Syst. Sci. 1971, 5, 511–523. [Google Scholar] [CrossRef]
- GPenSIM: A General Purpose Petri Net Simulator. Available online: http://www.davidrajuh.net/gpensim (accessed on 15 December 2017).
- Davidrajuh, R. Developing a new Petri net tool for simulation of discrete event systems. In Proceedings of the IEEE Second Asia International Conference on Modeling & Simulation (AICMS 08), Kuala Lumpur, Malaysia, 13–15 May 2008; pp. 861–866. [Google Scholar]
- Davidrajuh, R. Modeling Discrete-Event Systems with GPenSIM: An Introduction; Springer: Dordrecht, The Netherlands, 2018. [Google Scholar]
- Pan, X.L.; He, G.; Zhang, C.J.; Ming, T.F.; Wang, X.C. Research on Modeling and Simulating of Discrete Event System Based on Petri Net. In Advanced Engineering Forum; Trans Tech Publications: Zürich, Switzerland, 2012; Volume 4, pp. 80–85. [Google Scholar]
- Davidrajuh, R. Modeling Humanoid Robot as a Discrete Event System: A Modular Approach Based on Petri Nets. In Proceedings of the IEEE 2015 3rd International Conference on Artificial Intelligence, Modelling and Simulation (AIMS), Sabah, Malaysia, 2–4 December 2015. [Google Scholar]
- Cameron, A.; Stumptner, M.; Nandagopal, N.; Mayer, W.; Mansell, T. Rule-based peer-to-peer framework for decentralised real-time service oriented architectures. Sci. Comput. Program. 2015, 97, 202–234. [Google Scholar] [CrossRef]
- Lopez, F.; Barton, K.; Tilbury, D. Simulation of Discrete Manufacturing Systems with Attributed Hybrid Dynamical Nets. Unpublished work. 2017. [Google Scholar]
- Chang, H. A Method of Gameplay Analysis by Petri Net Model Simulation. J. Korea Game Soc. 2015, 15, 49–56. [Google Scholar] [CrossRef]
- Jyothi, S.D. Scheduling Flexible Manufacturing System Using Petri-Nets and Genetic Algorithm; Department of Aerospace Engineering, Indian Institute of Space Science and Technology: Thiruvananthapuram, India, 2012. [Google Scholar]
- Hussein, L.Z.S. Simulation of Food Restaurant Using Colored Petri Nets. J. Eng. Dev. 2014, 18, 77–88. [Google Scholar]
- Sanders, W.H.; Meyer, J.F. Stochastic activity networks: Formal definitions and concepts. In School Organized by the European Educational Forum; Springer: Berlin/Heidelberg, Germany, 2000; pp. 315–343. [Google Scholar]
- Davidrajuh, R. Activity-Oriented Petri Net for Scheduling of Resources. In Proceedings of the 2012 IEEE International Conference on Systems, Man, and Cybernetics, Seoul, Korea, 14–17 October 2012. [Google Scholar]
- Davidrajuh, R. Representing Resources in Petri Net Models: Hardwiring or Soft-coding? In Proceedings of the 2011 IEEE International Conference on Service Operations and Logistics, and Informatics, Beijing, China, 10–12 July 2011. [Google Scholar]
- Davidrajuh, R. Scheduling using ‘Activity-based Modeling’. In Proceedings of the 2011 IEEE Conference on Computer Applications & Industrial Electronics (ICCAIE 2011), Penang, Malaysia, 4–7 December 2011. [Google Scholar]
- Wu, N.; Zhou, M. System Modeling and Control with Resource-Oriented Petri Nets; CRC Press: New York, NY, USA, 2010. [Google Scholar]
- Zhou, M.C.; DiCesare, F. Parallel and sequential mutual exclusions for Petri net modeling of manufacturing systems with shared resources. IEEE Trans. Robot. Autom. 1991, 7, 515–527. [Google Scholar] [CrossRef]
- Chretienne, P. Exécutions controlées des réseaux de Petri temporisés. TSI Tech. Sci. Inform. 1984, 3, 23–31. [Google Scholar]
- Cormen, T.H. Introduction to Algorithms; MIT Press: Cambridge, MA, USA, 2009. [Google Scholar]
- Rader, C.M. Connected components and minimum paths. In Graph Algorithms in the Language of Linear Algebra; Jeremy, K., Gilbert, J., Eds.; SIAM Publications: Philadelphia, PA, USA, 2011. [Google Scholar]
- Tiernan, J.C. An efficient search algorithm to find the elementary circuits of a graph. Commun. ACM 1970, 13, 722–726. [Google Scholar] [CrossRef]
- Johnson, D.B. Finding all the elementary circuits of a directed graph. SIAM J. Comput. 1975, 4, 77–84. [Google Scholar] [CrossRef]
- Complete Code for the Examples. Available online: http://www.davidrajuh.net/gpensim/Pub/2018/computers-j/ (accessed on 15 December 2017).
- Skolud, B.; Krenczyk, D.; Davidrajuh, R. Solving Repetitive Production Planning Problems. An Approach Based on Activity-oriented Petri Nets. In Advances in Intelligent Systems and Computing, Proceedings of the International Joint Conference SOCO’16-CISIS’16-ICEUTE’16 (ICEUTE 2016, SOCO 2016, CISIS 2016), San Sebastián, Spain, 19–21 October 2016; Springer: Cham, Switzerland, 2017; Volume 527, pp. 397–407. [Google Scholar]
- Davidrajuh, R. Solving Assembly Line Balancing Problems with Emphasis on Cost Calculations: A Petri nets Based Approach. In Proceedings of the IEEE Modelling Symposium (EMS), Pisa, Italy, 21–23 October 2014; pp. 99–104. [Google Scholar]
- Davidrajuh, R. Developing a petri nets based real-time control simulator. Int. J. Simul. Syst. Sci. Technol. IJSSST 2012, 12, 28–36. [Google Scholar]
- Fadhilah, R. Fuzzy Petri Nets as a Classification Method for Automatic Speech Intelligibility Detection of Children with Speech Impairments. Ph.D. Thesis, University of Malaya, Kuala Lumpur, Malaya, 2016. [Google Scholar]
- Melberg, R. Modeling, Simulation, and Control of Atlantic Salmon Farming Industry Processes. Ph.D. Thesis, University of Stavanger, Stavanger, Norway, 2010. [Google Scholar]
GPenSIM Function | Purpose |
---|---|
pnclass | Find out the class of Petri net |
stronglyconn | Find out the number of strongly connected components in the Petri net |
mincyctime | Finding the performance bottleneck in a SCEG |
cycles | Extract the elementary circuits in a Petri Net |
Transition | Resources Required to Start Firing | Resources Released After Firing |
---|---|---|
tC1 | C1 | - |
tC1M1 | R1 | C1 (acquired by tC1) |
tM1 | M1 | M1 |
tM1AS | - | R1 (acquired by tC1M1) |
tC2 | C2 | - |
tC2M2 | R2 | C2 (acquired by tC2) |
tM2 | M2 | M2 |
tM2AS | - | - |
tAS | R3 | R2 (acquired by tC2M2) |
tAP | - | - |
tPS | R4 | R4 |
tPCK | - | R3 (acquired by tAS) |
GPenSIM Function | Purpose |
---|---|
availableInst | check whether any instances are available in a resource |
availableRes | check whether any resources are available (not in use) |
requestsSR | request a number of instances from specific (“named“) resources |
requestGR | request a number of resource instances, without naming any re-source |
requestAR | request a number of resource instances among many alternatives |
requestWR | request all the instances of a specific resource (either all or none) |
release | release all the resources and resource instances held by a transition |
Prnschedule | prints information on resource usage |
© 2018 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
Share and Cite
Davidrajuh, R.; Skolud, B.; Krenczyk, D. Performance Evaluation of Discrete Event Systems with GPenSIM. Computers 2018, 7, 8. https://doi.org/10.3390/computers7010008
Davidrajuh R, Skolud B, Krenczyk D. Performance Evaluation of Discrete Event Systems with GPenSIM. Computers. 2018; 7(1):8. https://doi.org/10.3390/computers7010008
Chicago/Turabian StyleDavidrajuh, Reggie, Bozena Skolud, and Damian Krenczyk. 2018. "Performance Evaluation of Discrete Event Systems with GPenSIM" Computers 7, no. 1: 8. https://doi.org/10.3390/computers7010008
APA StyleDavidrajuh, R., Skolud, B., & Krenczyk, D. (2018). Performance Evaluation of Discrete Event Systems with GPenSIM. Computers, 7(1), 8. https://doi.org/10.3390/computers7010008