# What determines the number of arcs and tokens in a Petri Nets Model?

I study Petri Nets to model some cases related to my job. Currently, I study the basics of Petri Nets and am confused. (For the time being I couldn't get a textbook yet, I will.)

my questions

q1) What determines the required number of tokens required for the model to be constructed properly? What is a bulletproof thinking way to determine the number of tokens required? It may be not needed the correct procedural way of thinking to construct but complex cases will need I think. (Is it only enough to know the conditions, so number of conditions will equal to number of tokens OR number of conditions actually gives me the number of arcs between places-transitions, and then I should assign the number of tokens to places depending on the number of arcs?)

q2) Am I thinking in the correct way below?

q3) Can you please provide the model required for my icing case below?

case: icing ocuurs or no icing. (2 states)

Place 1 : Icing occurs

Place 2 : No Icing

2 conditions (2 arcs so 2 tokens required for enabling & firing) required for icing on air:

1. water molecules AND

2. negative celcius temperature

. If these conditions exists simultaneously, then icing will occur.

So enabler from Place 2 to Place 1 needs 2 conditions. From Place 1 to Place 2, enabler needs "absence of at least 1 condition". After this point I stuck and can not draw the model.

My real world cases are too complicated.

• You should model resources you have given, so... probably the second reading would be helpful.
– Evil
Commented Mar 14, 2016 at 18:03
• Anyway, we discourage multiple questions in the list; "please check my ...", and we expect some research before asking a question. In this particular case, please read Petri Nets description once more, preferably using several different sources.
– Evil
Commented Mar 14, 2016 at 18:07

One of the resources I used to teach myself about Petri Nets was the chapters on Petri Nets in the textbook “Petri Nets and Grafcet: Tools for Modeling Discrete-Event Systems” (David and Alla, 1992).

An example process and a Petri Net model of the process may help you answer your first two questions (Chenier, 2016). Thus I am including the following, a Petri Net model to illustrate the icing process at a logical level. Furthermore control is included for recognizing the presence or absence of water and for identifying the freezing point (below 0 Celsius) and melting point of water (above 0 Celsius). The change of phase from liquid to solid and the change of phase from solid to liquid are reactions to the recognition of water and identification of temperature. Assume when water changes phase, every single molecule undergoes the phase change at the same instant.

Given these assumptions the icing process behaves like an AND-Gate plus controls for the inputs of the AND-Gate. The controls toggle the input values.

Table 1 Input-Output Relations of Water-Temperature versus Ice

Figure 1 is a Petri Net model of the icing process and Table 2 is a summary of places and transitions in the model. [For the PDF version Figure 1 is a dynamic, interactive diagram.] Every (enabled) transition can be triggered by clicking on a green square. To click on an enabled transition is equivalent to an occurrence of the corresponding event. The demonstration mode triggers a transition (T_0,T_1,T_2 or T_3) automatically when any of the other transitions are triggered. Please see Notes for more information about Figure 1.

Figure 1 A Dynamic, Interactive Petri Net Model of an Icing Process with Input Controls

Table 2 A Summary of Places and Transitions

## Notes

1. The Petri Net model in Figure 1 is a Place/Transition Net.
2. The graphics used to represent an inhibitor arc in Figure 1 is an arrow with a small circle near the corresponding place. The small circle stands for the weight (which is 0). As you probably know, an inhibitor arc is an input with an annotation for testing if the input can fire but does not have an annotation for firing the input.
3. Every edge with two arrowheads has one and only one (logic) annotation for testing the condition of the input.
4. A subtle assumption made for the model in Figure 1 is the possibility of transitions (T4,T5,T6,T7) to occur several times while phase changes (T0,T1,T2,T3) may not be fast enough to occur.

## Scenarios

To assist in the interpretation of the model, the following six scenarios are included.

Scenario 1 No water found, normal temperature detected, and no ice.

Scenario 2 From Scenario 1, water was detected (T5 fires). In this scenario: water found, normal temperature detected, no ice.

Scenario 3 From Scenario 2, temperature drops below freezing point (T7 fires) but the ice has not formed yet. In this scenario: water found, freezing temperature detected, no ice.

Scenario 4 From Scenario 3, the system has reacted to the freezing temperature (T3 fires). In this scenario, water found, freezing temperature detected, and ice.

Scenario 5 From Scenario 4, the temperature goes above freezing (T6 fires) but the system has not reacted yet. In this scenario: water found, normal temperature detected, and ice.

Scenario 6 From Scenario 5, the system has reacted to freezing temperature (T2 fires). In this scenario: water found, normal temperature detected, and no ice.

## References

Chionglo, J. F. (2016). A Reply to "How to determine / what determines the number of arcs and tokens in a Petri Net model" at Computer Science Stack Exchange. Available at http://www.aespen.ca/AEnswers/1458112273.pdf.

Chenier, A. (2016). How to Determine / What Determines the Number of Arc and Tokens in a Petri Nets Model. Computer Science Stack Exchange. Retrieved on Mar. 14, 2016 at What determines the number of arcs and tokens in a Petri Nets Model?.

David, R. and H. Alla. (1992). Petri Nets and Grafcet: Tools for Modeling Discrete-Event Systems. Upper-Saddle, NJ: Prentice Hall.