8.Subsystem - larics/Petri.Net GitHub Wiki
One of greatest features of this version of Petri .NET Simulator is the ability to group objects of Petri nets to Subsystems. Each Subsystem object can represent some simpler logical unit which can be used to build more complex Petri nets.
Objects can be grouped by selecting them and clicking Edit -> Group from main menu, or simply by pressing CTRL+G keyboard shortcut. Initial Petri net is shown on Figure 8.1 and result after grouping on Figure 8.2.
Figure 8.1. Before objects are grouped.
Figure 8.2. After objects are grouped.
Selected objects are simply moved inside newly created Subsystem block. This can be verified by double-clicking on Subsystem object. This opens a Subsystem Editor shown on Figure 8.3. Document Explorer window can also be used to see much deeper hierarchy of objects in current document (Figure 8.4).
Figure 8.3. Subsystem Editor.
Figure 8.4. Document Explorer.
This Subsystem object can't be connected to anything because it doesn't have any In and Out objects inside. These objects are used to connect objects outside of the Subsystem with objects inside the Subsystem. In and Out objects must be inside the Subsystem and can only be connected to Place objects. Similarly, only Transition objects can be connected to Subsystem objects. But in order to be able to connect Subsystem to anything we must first add In and Out objects. This is shown in Figure 8.5.
Figure 8.5. Subsystem with added In and Out objects (inside view).
Main Petri net model is now updated. A Subsystem object now has four red arrows which represent inputs and outputs of that Subsystem (Figure 8.6). That red arrows are connectable regions of Subsystem object.
Figure 8.6. Subsystem with added In and Out objects (outside view).
This Subsystem can now be connected to Transitions T1 and T2. This is shown in Figure 8.7. Dashed arcs are so called virtual arcs. This means that they are weightless (they don't have Weight property shown in Property window). For example, an arc connecting Transition T1 with Subsystem S1 (input port 1) is virtual and it's weight is irrelevant because weight of arc connecting In1 with Place P2 inside the Subsystem is counted as overall weight.
Also, virtual arcs show sum of all weights connected to input port inside the Subsystem (and down the Subsystem tree). For example, Subsystem with two arcs of weight 3 and 2 that are connected to In1 In object is shown in Figure 8.8.
Figure 8.7. Connected Subsystem.
Figure 8.8. Subsystem with two weighted arcs connected to same In object (inside).
Main model will look like the one in Figure 8.9. Virtual arcs show sum of all weights. This makes sense, because this is how much tokens will be taken from previous Place when Transition object fires.
Figure 8.9. Subsystem with two weighted arcs connected to same In object.