11.Simulation - larics/Petri.Net GitHub Wiki

A simulation is based on the recursive algorithm shown in Figure 11.1. This is very simplified diagram of simulation algorithm.

Figure 11.1. The simulation algorithm.

Simulation results can be examined in three different ways. The first one is studying the simulation on-line in PetriNet Editor controlled by Simulation toolbar (shown in Figure 11.2).

Figure 11.2. The simulation toolbar.

The execution of the simulation depends on selected Petri net model. If TimeInvariant Petri net model is used then simulation is executed step by step in 1 second intervals and tokens are moving from place to place. If TokenGameAnimation property of PetriNet Document is set to true every token movement will be animated. The black dots that represent tokens are moving on arcs. All tokens are moving with the same speed.

For PTimed Petri nets simulation is executed by predefined sampling interval and duration of task, associated with place, can be seen as red area within the place. The red area is changing dynamically, showing how much time is left until task will be finished. If TokenGameAnimation property of PetriNet Document is set to true every tokens are moving with different speeds showing the processing time of each Place (Figure 11.3).

Figure 11.3. PTimed Petri net model simulation.

The simulation can be paused at any time with Pause button on Simulation toolbar, or can be executed step-by-step with Step button.

Figure 11.4 shows simulation of one unbounded Petri net. It can be seen that TokenGameAnimation flag can give better understanding of Petri net behavior. Tokens are advancing through the arc as the Resource is doing it's work.

Figure 11.4. Example of unbounded Petri net with TokenGameAnimation flag set to true.

Two other ways of simulation results presentation are Spreadsheet and Oscillogram, which can be selected from Response view of PetriNet Document. These two presentations are described in the next section.