PETRINET.MOD

From Support

Jump to: navigation, search

Back to Model Library

See also: How to read .MOD pages

Contents

Description

PETRINET.MOD is an animated simulation of a Petri net that illustrates the so-called "activity" approach to simulation modeling. Here tokens are removed from "places" (balls) when "transitions" (bars) are enabled. This model can be used to simulate two tandem queues. Note that a transparent bitmap is used for some of the vertices. Ungroup one of the "places" to see how this is animated. (See the section on animation for more about transparent bitmaps.).

See also: PETRINET.MOD

State Variables

State Variables in PETRINET.MOD
Variable Name Variable Description Size Type
N Number of tokens for each place 10 Integer
NT Number of tokens for each transition 10 Integer
X Number of tokens passed to a place 1 Integer
I Index for Petri Net PLACE 1 Real
J Index for Petri Net Transitions 1 Real


Vertices

Select Vertices from PETRINET.MOD
Vertex Name Vertex Description State Changes
PSRT a token is added to place 2 N[I]=N[I]+X
TENBL Set firing time for transition number 1 NT[1]=NT[1]+1, N[1]=N[1]-1, N[2]=N[2]-1
PSTRT_0 A token is added to place 2 N[I]=N[I]+X
PSTRT_1 A token is added to place 2 N[I]=N[I]+X
Tenbl_0 Set firing time for transition number 1 NT[J]=NT[J]+1, N[3]=N[3]-1, N[4]=N[4]-1
PSTRT_2 A token is added to place 2 N[I]=N[I]+X

Initialization Conditions

This model has no initialization conditions.

Event Relationship Graph

There is no Event Relationship Graph available for this model.

PETRINET.MOD as seen in SIGMA
PETRINET.MOD as seen in SIGMA

English Translation

An English translation is a verbal description of a model, automatically generated by SIGMA.

The SIGMA Model, PETRINET.MOD, is a discrete event simulation. 
I. STATE VARIABLE DEFINITIONS.
For this simulation, the following state variables are defined:
N[10]: Number of tokens for each place   (integer valued)
NT[10]: Number of tokens for each transition   (integer valued)
X: Number of tokens passed to a place   (integer valued)
I: Index for Petri Net PLACE   (integer valued)
J: Index for Petri Net Transitions   (integer valued)
II. EVENT DEFINITIONS.
Simulation state changes are represented by event vertices (nodes or balls) in a SIGMA graph.  
Event vertex parameters, if any, are given in parentheses. Logical and dynamic relationships 
between pairs of events are represented in a SIGMA graph by edges (arrows) between event vertices.  
Unless otherwise stated, vertex execution priorities, to break time ties, are equal to 5.
1. The START() event occurs when the tokens for the initial marking are set..
   transition times in petrinet.dat.
   This event causes the following state change(s):
   N[1]=2
   N[2]=5
   N[3]=0
   N[4]=1
   After every occurrence of the START event:
   Unconditionally, schedule the pstrt(X,I) event to occur without delay...
   using the parameter value(s) of 0,2.
   (Time ties are broken by an execution priority of 0.)
   Unconditionally, schedule the pstrt_0(X,I) event to occur without delay...
   using the parameter value(s) of 0,1.
   (Time ties are broken by an execution priority of 0.)
   Unconditionally, schedule the pstrt_2(X,I) event to occur without delay...
   using the parameter value(s) of 0,4.
   (Time ties are broken by an execution priority of 0.)
   Unconditionally, schedule the START() event to occur in 100 time units.
2. The Tenbl() event occurs when SET FIRING TIME FOR TRANSITION NUMBER 1.
   This event causes the following state change(s):
   NT[1]=NT[1]+1
   N[1]=N[1]-1
   N[2]=N[2]-1
   After every occurrence of the Tenbl event:
   Unconditionally, schedule the Tfire() event to occur in DISK{PETRINET.DAT;1} time units.
   (Time ties are broken by an execution priority of 6.)
   If NT[1]==1, then schedule the T1() event to occur without delay.
   (Time ties are broken by an execution priority of 0.)
   If NT[1]==2, then schedule the T2() event to occur without delay.
   (Time ties are broken by an execution priority of 0.)
   Unconditionally, schedule the pstrt(X,I) event to occur without delay...
   using the parameter value(s) of 0,2.
   (Time ties are broken by an execution priority of 1.)
   Unconditionally, schedule the pstrt_0(X,I) event to occur without delay...
   using the parameter value(s) of 0,1.
   (Time ties are broken by an execution priority of 1.)
3. The pstrt(X,I) event occurs when a token is added to place 2.
   This event causes the following state change(s):
   N[I]=N[I]+X
   After every occurrence of the pstrt event:
   If N[I]==1, then schedule the P1() event to occur without delay.
   (Time ties are broken by an execution priority of 0.)
   If N[I]==3, then schedule the P3() event to occur without delay.
   (Time ties are broken by an execution priority of 0.)
   If N[I]==5, then schedule the P5() event to occur without delay.
   (Time ties are broken by an execution priority of 0.)
   If N[I]==4, then schedule the P4() event to occur without delay.
   (Time ties are broken by an execution priority of 0.)
   If N[I]==2, then schedule the P2() event to occur without delay.
   (Time ties are broken by an execution priority of 0.)
   Unconditionally, schedule the Pend() event to occur without delay.
   (Time ties are broken by an execution priority of 3.)
4. The T2() event:
   No additional events are scheduled here.
5. The T1() event:
   No additional events are scheduled here.
6. The Tfire() event occurs when last token leaves transition1.
   This event causes the following state change(s):
   NT[1]=NT[1]-1
   After every occurrence of the Tfire event:
   If NT[1]==1, then schedule the T1() event to occur without delay.
   (Time ties are broken by an execution priority of 0.)
   If NT[1]==2, then schedule the T2() event to occur without delay.
   (Time ties are broken by an execution priority of 0.)
   Unconditionally, schedule the pstrt_0(X,I) event to occur without delay...
   using the parameter value(s) of 1,1.
   (Time ties are broken by an execution priority of 1.)
   Unconditionally, schedule the pstrt_1(X,I) event to occur without delay...
   using the parameter value(s) of 1,3.
   (Time ties are broken by an execution priority of 0.)
 7. The P1() event:
   No additional events are scheduled here.
8. The P3() event:
   No additional events are scheduled here.
9. The P5() event:
   No additional events are scheduled here.
10. The P4() event:
    No additional events are scheduled here.
11. The P2() event:
    No additional events are scheduled here.
12. The Pend() event:
    After every occurrence of the Pend event:
    If N[1]>0 and N[2]>0, then the transition can be enabled;
    that is, schedule the Tenbl() event to occur without delay.
    (Time ties are broken by an execution priority of 1.)
13. The pstrt_1(X,I) event occurs when a token is added to place 2.
    This event causes the following state change(s):
    N[I]=N[I]+X
    After every occurrence of the pstrt_1 event:
    If N[I]==1, then schedule the P1_1() event to occur without delay.
    (Time ties are broken by an execution priority of 1.)
    If N[I]==3, then schedule the P3_1() event to occur without delay.
    (Time ties are broken by an execution priority of 1.)
    If N[I]==5, then schedule the P5_1() event to occur without delay.
    (Time ties are broken by an execution priority of 1.)
    If N[I]==4, then schedule the P4_1() event to occur without delay.
    (Time ties are broken by an execution priority of 1.)
    If N[I]==2, then schedule the P2_1() event to occur without delay.
    (Time ties are broken by an execution priority of 1.)
    Unconditionally, schedule the Pend_1() event to occur without delay.
    (Time ties are broken by an execution priority of 3.)
14. The P1_1() event:
    No additional events are scheduled here.
15. The P3_1() event:
    No additional events are scheduled here.
16. The P5_1() event:
    No additional events are scheduled here.
17. The P4_1() event:
    No additional events are scheduled here.
18. The P2_1() event:
    No additional events are scheduled here.
19. The Pend_1() event:
    After every occurrence of the Pend_1 event:
    If N[3]>0 and N[4]>0, then schedule the Tenbl_0(J) event to occur without delay...
    using the parameter value(s) of 2.
20. The pstrt_0(X,I) event occurs when a token is added to place 2.
    This event causes the following state change(s):
    N[I]=N[I]+X
    After every occurrence of the pstrt_0 event:
    If N[I]==1, then schedule the P1_0() event to occur without delay.
    (Time ties are broken by an execution priority of 0.)
    If N[I]==2, then schedule the P2_0() event to occur without delay.
    (Time ties are broken by an execution priority of 0.)
    Unconditionally, schedule the Pend_0() event to occur without delay.
    (Time ties are broken by an execution priority of 3.)
21. The P1_0() event:
    No additional events are scheduled here.
22. The P2_0() event:
    No additional events are scheduled here.
23. The Pend_0() event:
    After every occurrence of the Pend_0 event:
    If N[1]>0 and N[2]>0, then schedule the Tenbl() event to occur without delay.
    (Time ties are broken by an execution priority of 1.)
24. The Tenbl_0(J) event occurs when SET FIRING TIME FOR TRANSITION NUMBER 1.
    This event causes the following state change(s):
    NT[J]=NT[J]+1
    N[3]=N[3]-1
    N[4]=N[4]-1
    After every occurrence of the Tenbl_0 event:
    Unconditionally, schedule the Tfire_0(J) event to occur in DISK{PETRINET.DAT;2} time units...
    using the parameter value(s) of J.
    (Time ties are broken by an execution priority of 6.)
    If NT[J]==1, then schedule the T1_0() event to occur without delay.
    (Time ties are broken by an execution priority of 0.)
    Unconditionally, schedule the pstrt_1(X,I) event to occur without delay...
    using the parameter value(s) of 0,3.
    (Time ties are broken by an execution priority of 1.)
    Unconditionally, schedule the pstrt_2(X,I) event to occur without delay...
    using the parameter value(s) of 0,4.
    (Time ties are broken by an execution priority of 1.)
25. The T1_0() event:
    No additional events are scheduled here.
26. The Tfire_0(J) event occurs when last token leaves transition1.
    This event causes the following state change(s):
    NT[J]=NT[J]-1
    After every occurrence of the Tfire_0 event:
    If NT[J]==1, then schedule the T1_0() event to occur without delay.
    (Time ties are broken by an execution priority of 0.)
    Unconditionally, schedule the pstrt_2(X,I) event to occur without delay...
    using the parameter value(s) of 1,4.
    (Time ties are broken by an execution priority of 1.)
27. The pstrt_2(X,I) event occurs when a token is added to place 2.
    This event causes the following state change(s):
    N[I]=N[I]+X
    After every occurrence of the pstrt_2 event:
    If N[I]==1, then schedule the P1_2() event to occur without delay.
    (Time ties are broken by an execution priority of 0.)
    If N[I]==2, then schedule the P2_2() event to occur without delay.
    (Time ties are broken by an execution priority of 0.)
    Unconditionally, schedule the Pend_2() event to occur without delay.
    (Time ties are broken by an execution priority of 3.)
28. The P1_2() event:
    No additional events are scheduled here.
29. The P2_2() event:
    No additional events are scheduled here.
30. The Pend_2() event:
    After every occurrence of the Pend_2 event:
    If N[3]>0 and N[4]>0, then schedule the Tenbl_0(J) event to occur without delay...
    using the parameter value(s) of 2.

Comments

Event Graphs are more general than standard timed stochastic Petri nets and it is easy to convert a Petri net model to an Event Graph - Simply replace all PN Transitions with timed edges connected by at most one conditional edge for each PN Place.

This model is not available using the educational version of SIGMA.



Back to top

Back to Model Library

Personal tools
Navigation