Executing Petri Nets

A Petri net is ready for executing, once it has been created and confi gured. In this case “executing” means that the user is allowed to fi re enabled transitions manually in order to traverse the net. A transition is enabled, if there are at least as much tokens in the source place as an incoming arc consumes, and if the target place is able to gather all the tokens which are produced by the outgoing arc. One way to switch to the play-mode is by clicking the dedicated button in the toolbar.

Mode_switch

No changes of the net are allowed in play-mode. Hence, elements cannot be moved and keystroke combinations do not work either. Furthermore, the editing buttons for adding and modifying elements disappear from the toolbar. However, a fi eld called “execution trace” shows up instead. The sequence of red transitions is stored in this textbox. An enabled transition is highlighted through a red arrow inside, which signals the user that a click on it triggers the consume/produce action. The following example illustrates how this process works.

Fire_Transitions

A net can be reset by clicking the appropriate button from the menubar, which is only visible in play mode. The execution trace is going to be emptied and the net returns into the initial state before any transition has been fi red.

Reset_Net