5.PetriNET Editor - larics/Petri.Net GitHub Wiki

PetriNet Editor is the most important view of PetriNet Document. Its surface is used for drawing a Petri net model. All objects that are in Toolbox window can be placed at PetriNet Editor's surface. A simple drag&drop puts selected object to surface. Using this method a model, similar to the one shown in Figure 5.1, can be built. It contains only Petri net specific objects, Places and Transitions. This and other objects supported by Petri .NET Simulator application (like Label, Subsystem block, In and Out) will be described later in this manual.

Figure 5.1. Building a Petri net model on PetriNet Editor surface.

The objects placed on PetriNet Editor surface can be selected by left/right mouse click. Upon selection the object's color changes to blue and Properties window shows properties of the selected object. The object can be moved by pressing and holding left mouse button while moving mouse around the PetriNet Editor surface. A complete Petri net model requires definition of arcs (connections) between Places and Transitions. Arcs can be added to the model by using the following procedure: right-click on source object (place or transition; the object becomes blue) and move mouse to the destination object (transition or place) while holding right mouse button, as shown in Figure 5.2. When the mouse is over the object that can be connected with the source, the connection arrow becomes yellow. The connection is created by releasing the right mouse button. In case connection between two already connected objects is undertaken, the connection arrow turns to red, and upon release of right mouse button, the user is asked if existing connection should be deleted.

Figure 5.2. Drawing an arc.

A graphical shape of an arc is formed automatically. It mainly depends on beginning point of arc within first object and end point of arc within second object. It also depends on locations of both objects. Once arc is created it's begin and end point cannot be changed. This arc creation mechanism needs more detailed explanation. Every object's surface is divided into smaller areas. These areas are called connectable areas. When arc between objects is created, it's begin and end direction is determined by checking in which area begin and end point fall into. For example, every Place object is divided into 4 areas as shown on Figure 5.3.

Figure 5.3. Connectable areas of Place object.

This means that arcs that go in or out of place can have either Left, Right, Up or Down begin directions. Transition object on the other hand has only 2 connectable areas (Figure 5.4). They divide Transition in left and right half (or upper and lower half, if Transition direction is Horizontal; more about this in Transitions chapter). In and Out objects, used for Subsystems input and output points, are divided in same way as Place object. Because they have elliptic shape connectable areas are slightly different than place's connectable areas as shown on Figure 5.5.

Figure 5.4. Connectable areas of Transition object.

Figure 5.5. Connectable areas of In and Out objects.

Subsystem object has different way of treating connectable regions. This will be explained in Subsystems chapter, later in this manual.

When all arcs are created using previously described method, model from Figure 5.1 can, for example, look like one shown in Figure 5.6.

Figure 5.6. Complete Petri net model.

This method of drawing arcs adds more freedom in drawing Petri nets and also makes Petri net models look much more understandable.

⚠️ **GitHub.com Fallback** ⚠️