Chapter2 M. USAM
Chapter2 M. USAM
2.1. INTRODUCTION
The rapid development in science and technology has brought about a lot of man-made
systems, which cannot be described with traditional differential or difference equations.
The examples of these systems include flexible manufacturing systems, computer
network systems, various transportation systems and others. The behaviour of these
systems is determined mostly by discrete events functioning in them. Such systems are
called discrete event systems (DES) or discrete event dynamic systems (DEDS), whose
characteristics can be identified as follows:
Concurrency: In a discrete event system many operations may take place at the same
time, i.e., simultaneously.
Petri nets, as a graphical and mathematical tool, are being increasingly used in the
modelling, analysis, design and control of discrete event systems (Zhou and DiCesare,
1993). Petri nets were named after Carl A. Petri, a contemporary German mathematician,
introduced a net-like mathematical tool for the study of communication with automata
(Petri, 1962). Ever since, there has been a great deal of research in different disciplines,
including manufacturing systems, computer science, communication systems, etc.
(Zurawski and Zhou, 1994). Petri nets enable a discrete event system of any kind to be
modelled. They present two interesting characteristics. Firstly, they make it possible to
model and visualise behaviours comprising concurrency, synchronisation and resource
sharing. Secondly, the theoretical results concerning them are plentiful (Alla and David,
1994). Petri nets have proven to be very useful in the modelling, analysis, simulation, and
control of manufacturing systems. They provide very useful models for the following
reasons (Desrochers and Al-Jaar, 1995):
Ordinary Petri nets are not always sufficient to represent and analyse complex industrial
systems. This has prompted the development of new classes of Petri nets. For example,
when modelling complex systems, consisting of many similar interacting activities
ordinary Petri nets increase the graphical complexity of the model. In order to address
this issue, Petri nets, which allow tokens to have distinct identity, were proposed. These
nets, referred to as high-level Petri nets, include predicate-transition nets (Genrish and
Lautenbach, 1981), coloured nets (Jensen, 1981), and nets with individual tokens
(Reisig, 1985). An important development in the area of high-level Petri nets was the
introduction of object oriented Petri nets (Sibentin-Blanc, 1985). Due to the need for
representing approximate and uncertain information has led to the various types of fuzzy
Petri nets (Chen et al, 1990; Garg et al, 1991; Loony, 1988; Valette et al, 1989). The
need for the temporal analysis of the systems resulted in the introduction of temporal
Petri nets (Timed Petri nets) (Suzuki and Lu, 1989).
The purpose of this chapter is to provide a brief introduction to Petri nets. The remainder
of this chapter is arranged as follows: Firstly, some Petri net basics are introduced. This
is followed by some important Petri net extensions, such as inhibitor arc Petri nets,
weighted arc Petri nets, etc. After that, some Petri net modules are considered for
modelling of manufacturing systems. Finally, an extended Petri net formalism, called
Automation Petri nets (APN) is proposed.
Where,
• P = { p1,.........., pn} is a finite set of places,
Note that P and T are disjoint sets and that any element of P U T is called a node. Petri
nets are assumed to be connected. This means that there exists at least one path between
any two nodes. Generally, places are used to express the states of the systems, while
transitions correspond to control evolutions from one state to another.
Petri nets can be represented graphically, which is helpful in both describing how they
work and gaining an understanding of a particular model. A Petri net graph uses circles
and bars to represent places and transitions, respectively. The input and output functions
are represented by directed arcs between the two types of nodes. An arc directed from a
place to a transition defines the place to be an input place of the transition. Similarly, an
arc directed from a transition to a place defines the place to be an output place of the
transition.
A marked Petri net contains tokens in addition to the elements described above. Tokens
reside in places, travel along arcs, and their flow through the net is controlled by
transitions. They are represented graphically by dots. The marking M(p) of a Petri net is
a mapping of each place to a non-negative integer representing the number of tokens in
that place. A marked Petri net is defined by the quintuple:
The marking M is an n-dimensional vector whose ith component M(Pi) represents the
number of tokens in the ith place Pi. The initial marking is denoted by Mo. A simple Petri
net, showing places, transitions, directed arcs and a token, is given in Fig. 2.1.
Token
Transition
Directed Arc
Place
The execution of an ordinary Petri net is controlled by the number and distribution of
tokens in the net and causes the token to flow in the net. Execution is performed by
firing enabled transitions. A transition is enabled when each of its input places is marked
with at least one token. A transition fires by removing a token from each of its input
places and by placing a token in each of its output places. The firing of transitions causes
tokens to flow through the net.
The firing of a simple Petri net is shown in Fig. 2.2, where there are four places P = { p1,
p2, p3, p4 } and two transitions T = { t1, t2 }. Initially, as shown in Fig. 2.2.(a), transition
t1 is enabled, because M(p1) = 1, Pre(p1, t1) = 1 and M(p2) = 1, Pre(p2, t1) = 1, and
transition t2 is not enabled, because M(p3) = 0 and Pre(p3, t2) = 1. When transition t1
fires, it removes one token each from places p1 and p2 and deposits one token in place p2,
as shown in Fig. 2.2(b). In this case, transition t2 becomes, because M(p3) = 1 and
Pre(p3, t2) = 1. When transition t2 fires, it removes one token from places p3 and deposits
one token in place p4, as shown in Fig. 2.2(c).
p1 p2 p1 p2 p1 p2
t1 t1 t1
p3 p3 p3
t2 t2 t2
p4 p4 p4
The tokens, places and transitions must be assigned a meaning for proper integration of
the model. In general, they are interpreted in the following way: Places represent
resources or possible states of the system. The existence of one or more tokens in a place
represents the availability of a particular resource or presence of a condition being met.
A transition represents changings in the system states. A firing transition may be
interpreted as an activity happening. Places and transitions together represent conditions
and precedence relations in the system’s operation. For example, a token in a place can
imply that the condition is true, and no token, that it is false.
Petri nets as graphical and mathematical tools have a lot of properties. Such properties,
when interpreted in terms of the modelled system, make it possible to identify the
presence or absence of functional properties of the system under design (Zurawski and
Zhou, 1994). There are two types of properties, namely, behavioural and structural. The
former depends on the initial marking of the Petri net, while the latter does not depend
on the initial marking. The structural properties are related to the net structure of a given
Petri net. In this section, some of the most important behavioural properties, from the
practical point of view, are provided. These properties are reachability, boundedness,
safeness, conservativeness, liveness and reversibility. Detailed information about the
other behavioural properties and the structural properties of a Petri net can be found in
(Murata, 1989).
Reachability: The firing of an enabled transition changes the marking, i.e., token
distribution of a Petri net. A marking Mi is said to be reachable from an initial marking
M0 if there exist a sequence of firings that can transform M0 to Mi. A firing sequence is
represented by σ = t1, t2, t3......tn. To show Mi is reachable from Mo by σ the following
representation is used: M0 [σ > Mi.
Safeness: A Petri net is said to be safe if all its places are safe. A place ‘p’ is safe if it
contains no more than one token. In other words, a Petri net is called safe if it is 1-
bounded.
In general, there are two techniques for the analysis of Petri nets: linear algebraic method
and graph-based method. The linear algebraic method is based on matrix equations. In
this case matrix equations represent the dynamic behaviour of Petri nets. The
fundamental to this approach is the incidence matrix, which defines all possible
interconnections between places and transitions in a Petri net. The use of the incidence
matrix representation results in a homogeneous system of linear algebraic equations. This
immediately poses some problems, since the solutions will not be unique (Koussoulas,
1994). Additionally, this method does not provide the firing sequences necessary to
reach a certain marking. Finally, the linear algebraic analysis technique can not be applied
on all Petri nets; they have to be free of self-loops. The advantages of this technique over
the graph-based analysis technique is the existence of simple linear-algebraic properties
(Desrochers and Al-Jaar, 1995).
The graph-based analysis method can be split into two parts for bounded systems: the
reachability tree analysis and the reachability graph analysis. Both methods involve
essentially the enumeration of all reachable markings and it should be able to apply to all
different types of Petri nets. However, they are limited to not very big systems, because
of the computational complexity, and the so called the state explosion problem: the
number of markings can be exponential with respect to the size of the Petri net. For a
bounded Petri net, the reachability tree contains all possible markings. The analysis
problems (i.e., properties of Petri nets), as discussed in the previous section, can be
solved by the reachability tree (Murata, 1989). For bounded systems, the reachability tree
provides all valid firing sequences together with all reachable markings, but the
reachability graph provides only all the reachable markings and firing of transitions
among them.
Given a Petri net, from the initial marking M0, as many “new” markings as the number of
the enabled transitions can be obtained. From each new marking, more markings can be
reached. This process results in a tree representation of the markings. Nodes represent
the markings generated from the initial marking M0 and its successors, and each arc
represents a transition firing, which transforms one marking to another. Consider the
Petri net shown in Fig. 2.3.(a), where there are three places, P = { p1, p2, p3 } and three
transitions T = { t1, t2, t3 }. The reachability tree of this Petri net is shown in Fig. 2.3.(b).
Note that the valid firing sequences of the transitions are as follows: t1t3, t1t2t1t3,
t1t2t1t2t1t3, ......
The reachability graph associated with a system is a graph, in which each node represents
a marking reachable from the initial marking M0 and each arc represents the firing of a
transition. If the marked Petri net is bounded the graph construction process finishes
when all possible firing from the reachable markings have been explored. For the Petri
net, shown in Fig. 2.3.(a), the reachability graph is shown in Fig. 2.3.(c). When the
reachability tree and the reachability graph are considered the difference between these
two techniques can be seen easily. The former simply provides all the valid firing
sequences of a Petri net together with all reachable markings, while the latter only
provides all possible markings and the firing of transitions, which go from one marking
to another. It is important to note that when carrying out reachability tree/graph analysis
only one transition is assumed to fire at a time.
t1
t3 p3
p1 p2
t2
(a)
1, 0, 0
t1
1, 0, 0
0, 1, 0
t2 t3 t2 t1
1, 0, 0 0, 0, 1 0, 1, 0 0, 0, 1
t3
t1
0, 1, 0 (c)
t2 t3
1, 0, 0 0, 0, 1
t1
.
.
. (b)
Figure 2.3. (a) A Petri net. (b) Its reachability tree. (c) Its reachability graph.
Several extensions have been made to ordinary Petri net framework in order to be able to
represent complex systems easily. In this section some of these extensions are
considered. The extensions considered in this section involves the following:
A weighted arc Petri net is one in which weights are associated with arcs. The Pre and
Post mappings may take values over the set of all non-negative integers. In this case,
each arc is said to have multiplicity k, where k represents the weight of arcs. Ordinary
Petri nets have a multiplicity of 1. The weight of an arc is indicated by a non-negative
integer assigned to the arc. A transition is enabled, if each of its input places is marked
with at least the number of the tokens equal to the weight of the related arc, which
connects the input place to the transition. The transition fires by removing necessary
number of tokens from input places, according to the weights of the input arcs, and by
putting sufficient number of tokens to the output places, according to the weights of the
output arcs. Such a weighted arc Petri net is shown in Fig. 2.4.(a), in which the input arc
p1 → t1 has the weight of ‘n’, i.e., Pre(p1, t1) = n, and the output arc t1 → p2 has the
weight of ‘m’, i.e., Post(t1, p2) = m. In this case, if the number of tokens in the input
place p1 is at least equal to the number ‘n’, then the transition t1 is enabled. When the
transition t1 fires, it removes ‘n’ tokens from input place p1 and deposits ‘m’ tokens to
the output place p2. Instead of using weighted arcs Peterson used the concept of ‘bag of
arcs’ (Peterson, 1981). In this case, Peterson would use ‘n’ number of arcs directed from
place p1 to transition t1 and ‘m’ number of arcs directed from transition t1 to place p2.
This is shown in Fig. 2.4.(b). When the transition is fired, every arc, directed from place
p1 to transition t1, will remove one token from place p1 -‘n’ tokens in total- and every
arc, directed from transition t1 to place p2, will deposit one token to the place p2 -‘m’
tokens in total. However, it is possible to represent the weighted arcs by using the
representation shown in Fig. 2.4.(c), where 2n+1 places are used to represent place p1
and the weighted arc Pre(p1, t1), and m+1 places are used to represent place p2 and the
weighted arc Post(t1, p2). In this case, number of the tokens in place p1 is equal to the
sum of the tokens in places p1i, p11, p12, ...., p1n, i.e., M(p1) = M(p1i) + M(p11) + M(p12) +
.....+ M(p1n), and the number of the tokens in place p2 is equal to sum of the tokens in
places p2o, p21, p22, ...., p2m, i.e., M(p2) = M(p2o) + M(p21) + M(p22) + .....+ M(p2m).
i
p1 4
p1 4 1 4
4 4
44 4
4
n ...................................
t1
m
p2 ...........................
2 3 44 4
24 2 34 44 4
3 n
(a) p11 p1 2 p1 p1
.................
t1
p1 ..............
4 3 3 3 3
44 4 1 2 3 m
4 p2 p2 p2 p2
1 2 3 .............. n
t1
1 2 3 .............. m
p2 2
p2 o 1
(b)
(c)
Figure 2.4. (a). A weighted arc Petri net (b). Equivalent Petri nets with ‘bag of arcs’ representing the
weights. (c). Equivalent ordinary Petri net representing the weighted arcs.
Now consider the firing of a weighted arc Petri net, shown in Fig. 2.5, where there are
four places P = { p1, p2, p3, p4 } and one transition T = { t1 }. In this Petri net, the input
arc p2 → t1 has the weight of 2, i.e., Pre(p2, t1) = 2, and the output arc t1 → p3 has the
weight of 3, i.e., Post(t1, p3) = 3. The other arcs, whose weights are not explicitly
specified, have a weight of 1. In Fig. 2.5.(a), transition t1 is not enabled, because Pre(p2,
t1) = 2 and M(p2) = 1, although Pre(p1, t1) = 1 and M(p1) = 3 and similarly, in Fig 2.5.(b),
transition t1 is not enabled, because Pre(p1, t1) = 1 and M(p1) = 0, although Pre(p2, t1) =
2 and M(p2) = 2. However, the Petri net, shown in Fig. 2.5.(c), is enabled, because
Pre(p1, t1) = 1 and M(p1) = 2, and, Pre(p2, t1) = 2 and M(p2) = 3. When transition t1 fires,
it removes one token from place p1 and two tokens from place p2 and at the same time it
deposits three tokens into place p3 and one token into place p4, as shown in Fig. 2.5.(d).
p1 p2 p1 p2
2 2
t1 t1
3 3
p3 p4 p3 p4
(a) (b)
p1 p2 p1 p2
2 2
t1 t1
3 3
p3 p4 p3 p4
(c) (d)
Figure 2.5. A weighted arc Petri net. (a). Not enabled. (b). Not enabled.
(c). (Enabled) before firing. (d). After firing.
The modelling power of Petri nets can be increased by adding the ‘zero testing’ ability,
i.e., the ability to test whether a place has no token. This is achieved by introducing an
inhibitor arc. The inhibitor arc connects an input place to a transition and is represented
by an arc whose end is marked by a small circle. The presence of an inhibitor arc
connecting an input place to a transition means that the transition is only enabled if the
input place does not have any tokens. Firing of a transition does not change the marking
of a place, which is connected to the transition with an inhibitor arc. In the general case,
an inhibitor arc Petri net can not be transformed into an ordinary Petri net (David and
Alla, 1992). An inhibitor arc Petri net is shown in Fig. 2.6, where there are three places P
= { p1, p2, p3 } and one transition T = { t1 }. In the Petri net, the arc p2 → t1 is an
inhibitor arc, i.e., In(p2, t1). The Petri net is not enabled in Fig. 2.6.(a), because Pre(p1,
t1) = 1 and M(p1) = 0, although In(p2, t1) = 1 and M(p2) = 0 and similarly, in Fig 2.6.(b),
transition t1 is not enabled, because In(p2, t1) = 1 and M(p2) = 1, although Pre(p1, t1) = 1
and M(p1) = 1. However, the inhibitor arc Petri net in Fig. 2.6.(c) is enabled, because
Pre(p1, t1) = 1 and M(p1) = 1, and, In(p2, t1) = 1 and M(p2) = 0. When transition t1 fires,
it removes one token from place p1 and deposits one token into place p3, as shown in
Fig. 2.6.(d). Note that after the firing of transition t1, the marking of the place p2 remains
the same.
p1 p2 p1 p2 p1 p2 p1 p2
t1 t1 t1 t1
p3 p3 p3 p3
Figure 2.6. A inhibitor arc Petri net : (a). Not enabled. (b). Not enabled.
(c). (Enabled) before firing. (d). After firing.
It is possible to associate weights with inhibitor arcs. In this case, an inhibitor arc is
called weighted inhibitor arc, which has the ability to test the number of tokens in a
place. If the number of tokens in an input place, connected to a transition with a
weighted inhibitor arc whose weight is ‘k’, is less than the weight value, then the
transition is enabled. If it is equal to or bigger than ‘k’ then the transition is not enabled.
However, in this case it is assumed that all the other input places have sufficient tokens
to enable the transition. The firing does not change the marking in the inhibitor arc
connected places. A weighted inhibitor arc Petri net is shown in Fig. 2.7, where there are
three places P = { p1, p2, p3 } and one transition T = { t1 }. In the Petri net, the arc
p2 → t1 is a weighted inhibitor arc with the weight of 3, i.e., In(p2, t1) = 3. The Petri net is
not enabled in Fig. 2.7.(a), because Pre(p1, t1) = 1 and M(p1) = 0, although In(p2, t1) = 3
and M(p2) = 1 and similarly, in Fig 2.7.(b), transition t1 is not enabled, because In(p2, t1)
= 3 and M(p2) = 4, although Pre(p1, t1) = 1 and M(p1) = 1. However, the Petri net in Fig.
2.7.(c) is enabled, because Pre(p1, t1) = 1 and M(p1) = 1, and, In(p2, t1) = 3 and M(p2) =
2. When transition t1 fires, it removes one token from place p1 and deposits one token
into place p3, as shown in Fig. 2.7.(d).
p1 p2 p1 p2 p1 p2 p1 p2
3 3 3 3
t1 t1 t1 t1
p3 p3 p3 p3
Figure 2.7. A weighted inhibitor arc Petri net : (a). Not enabled. (b). Not enabled.
(c). (Enabled) before firing. (d). After firing.
The modelling power of Petri nets can be increased by adding the ‘one testing’ ability,
i.e., the ability to test whether a place has a token(s). This is achieved by introducing an
‘enabling arc’. The enabling arc connects an input place to a transition and is represented
by an arc, whose end is marked by an empty arrow. The presence of an enabling arc
connecting an input place to a transition means that the transition is only enabled if the
input place has a token(s). The firing does not change the marking in the enabling arc
connected places. An enabling arc Petri net is shown in Fig. 2.8, where there are three
places P = { p1, p2, p3 } and one transition T = { t1 }. In the Petri net, the arc p2 → t1 is
an enabling arc, i.e., En(p2, t1). The Petri net is not enabled in Fig. 2.8.(a), because En(p2,
t1) = 1 and M(p2) = 0, although Pre(p1, t1) = 1 and M(p1) = 1, and similarly, in Fig
2.8.(b), transition t1 is not enabled, because Pre(p1, t1) = 1 and M(p1) = 0, although
En(p2, t1) = 1 and M(p2) = 1. However, the enabling arc Petri net in Fig. 2.8.(c) is
enabled, because Pre(p1, t1) = 1 and M(p1) = 1, and, En(p2, t1) = 1 and M(p2) = 1. When
transition t1 fires, it removes one token from place p1 and deposits one token into place
p3, as shown in Fig. 2.8.(d). Note that after the firing of transition t1, the marking of the
place p2 remains the same.
p1 p2 p1 p2 p1 p2 p1 p2
t1 t1 t1 t1
p3 p3 p3 p3
Figure 2.8. An enabling arc Petri net : (a). Not enabled. (b). Not enabled.
Although an enabling arc can be represented by two ordinary arcs, as shown in Fig. 2.9.
(a) and (b), enabling arcs are distinctively different from ordinary arcs in the sense that
they do not lead to conflicts in a Petri net. This is shown in Fig. 2.9.(c), where transition
t1 and t2 can fire at any time without any conflict. However, if the enabling arcs En(p2, t1)
and En (p2, t2) are replaced with normal arcs as shown in Fig. 2.9.(d), then it is obvious
that this is a potential conflict situation.
p1 p2
p1 p2
t1 t1
p3 p3
(b)
(a)
p2 p2
p1 p3 p1 p3
t1 t2 t1 t2
p4 p5 p4 p5
(c) (d)
Figure 2.9. (a) An enabling arc Petri net. (b) Its equivalent.
(c). An enabling arc, where there is no conflict. (d) An ordinary Petri net, where there is a conflict.
It is also possible to associate weights with enabling arcs. In this case an enabling arc is
called weighted enabling arc, which has the ability to test the number of tokens in a
place. If the number of tokens in an input place, connected to a transition with a
weighted enabling arc, whose weight is ‘k’, is at least equal to the weight value then the
transition is enabled. If it is less than ‘k’ then the transition is blocked, i.e., it is not
enabled. However, in this case it is assumed that all the other input places have sufficient
tokens to enable the transition. The firing does not change the marking in the weighted
enabling arc connected places. A weighted enabling arc Petri net is shown in Fig. 2.10,
where there are three places P = { p1, p2, p3 } and one transition T = { t1 }. In the Petri
net, the arc p2 → t1 is a weighted enabling arc with the weight of 3, i.e., En(p2, t1) = 3.
The Petri net is not enabled in Fig. 2.10.(a), because En(p2, t1) = 3 and M(p2) = 2,
although Pre(p1, t1) = 1 and M(p1) = 1, and similarly, in Fig 2.10.(b), transition t1 is not
enabled, because Pre(p1, t1) = 1 and M(p1) = 0, although En(p2, t1) = 3 and M(p2) = 3.
However, the Petri net in Fig. 2.10.(c) is enabled, because Pre(p1, t1) = 1 and M(p1) = 1,
and, En(p2, t1) = 3 and M(p2) = 3. When transition t1 fires, it removes one token from
place p1 and deposits one token into place p3, as shown in Fig. 2.10.(d).
p1 p2 p1 p2 p1 p2 p1 p2
3 3 3 3
t1 t1 t1 t1
p3 p3 p3 p3
Figure 2.10. A weighted enabling arc Petri net : (a). Not enabled. (b). Not enabled.
(c). (Enabled) before firing. (d). After firing.
A finite capacity Petri net is one in which capacities (positive integers) are associated
with places. Firing of an input transition of a place pi , whose capacity is CAP(pi), is only
possible, if firing of this transition does not result in a number of tokens in pi that exceeds
the capacity (David and Alla, 1992). Place p2 in Fig. 2.11 is a finite capacity place with
the capacity of 2, i.e., CAP(p2) = 2. Firing of t1 in Fig. 2.11.(a) results in the marking
shown in Fig. 2.11.(b) and similarly firing of t1 in Fig. 2.11.(b) results in the marking
shown in Fig. 2.11.(c). However, transition t1 in Fig. 2.11.(c) can not fire anymore,
because the marking of place p2 has reached its maximum capacity. It is possible to
represent the finite capacity place with two places (p2 and p2’). In this case, first place
(p2) represents the place itself and the marking of second place, i.e., M(p2’), represents
the capacity of the place. In other words, the marking invariant M(p2) + M(p2’) = 2 is
hold. This is shown in Fig. 2.12. Note that Fig. 2.12 (a), (b) and (c) is equivalent to Fig.
2.11 (a), (b) and (c), respectively. Another representation of a finite capacity place can
be done by using weighted inhibitor arc, whose weight ‘k’ equals to the capacity of the
place. This is shown in Fig. 2.13. Note that Fig. 2.13 (a), (b) and (c) is equivalent to Fig.
2.11 (a), (b) and (c), respectively.
p1 p1 p1
t1 t1 t1
t2 t2 t2
p3 p3 p3
Figure 2.11. A finite capacity Petri net : (a). Initial marking (t1 is enabled). (b). Marking after t1 fires (t1
and t2 are enabled). (c). Marking after t1 fires (only t2 is enabled).
p1 p1 p1
t1 t1 t1
t2 t2 t2
p3 p3 p3
Figure 2.12. A finite capacity place, represented by two places. (a). Initial marking (t1 is enabled). (b).
Marking after t1 fires (t1 and t2 are enabled). (c). Marking after t1 fires (only t2 is enabled).
p1 p1 p1
t1 t1 t1
2 2 2
p2 p2 p2
t2 t2 t2
p3 p3 p3
Figure 2.13. A finite capacity place, represented by weighted inhibitor arc. (a). Initial marking (t1 is
enabled). (b). Marking after t1 fires (t1 and t2 are enabled). (c). Marking after t1 fires (only t2 is enabled).
Ordinary Petri nets do not include any concept of time. With this class of nets, it is
possible only to describe the logical structure of the modelled system, but not its time
evolution. Due to the need for the temporal analysis of discrete event systems, time has
been introduced into Petri nets in variety of ways. In general, there are two types of
timed Petri nets, namely timed-place Petri nets and timed-transition Petri nets. If the
timings are associated with the places, then the Petri net is called timed-place Petri net. If
the timings are associated with the transitions, then the Petri net is called timed-transition
Petri net. In this thesis only the timed-transition Petri net is considered.
A timed-transition Petri net (TTPN) is a tuple as defined in (David and Alla, 1992);
TTPN = ( PN , τ ).....................................................................................................(3)
In (4), PN is a marked Petri net and τ is a function from the set of transitions to the set
of positive or zero rational numbers. τ (ti) = Ti = timing associated with transition ti. In
this case, a token can have two states: it can be reserved for the firing of a timed-
p1 p1 p1 p1 : Reserved
token
t1 t1 t1 t1
: Unreserved
token
p2 p2 p2 p2
p3 p3 p3 p3
Figure 2.14. A timed-transition Petri net (TTPN) : (a). Initial marking (t1 is enabled). (b). After t1 is
fired, an unreserved token is deposited in place p2 for a time T2 (t2 is enabled). (c). Firing condition
occurs for t2 and then the unreserved token becomes reserved for firing transition t2, (0<t<T2). (d). After
time T2 has elapsed, transition t2 is effectively fired and a token is deposited in place p3.
In this section, some basic design modules are considered. These modules are useful in
the construction of models for both high level and low level system operations. The
advantage of these modules is obvious: they are specific and therefore easily accepted
and applied when a practical problem is encountered. In this section the following design
modules are considered:
• sequence
• concurrency and synchronisation
• conflict
• buffer
• FIFO queue
• machine
• motor and actuator
2.4.1. Sequence
p1 t1 p2 t2 p3 pn tn p n+1
.........
Concurrency and synchronisation are shown in Fig. 2.16. As can be seen from the Petri
net when the system starts (t1 fires) two machines, i.e., machine 1 and machine 2, start
operating concurrently in order to produce parts, part 1 and part 2, respectively. When
machine 1 finishes its operation (t2 fires), it produces a part 1. When machine 2 finishes
its operation (t3 fires), it produces a part 2. One machine could finish its operation before
the other one. However, in order to make an assembly both parts are required
(synchronisation).
In terms of Petri nets, concurrency means that two or more events are occurring at the
same time. That is, concurrency will be present when more than one transition is enabled
and firable at the same time. Synchronisation is present, when there is more than one
input place, each of which representing a different activity, to a transition.
p1 ready
starts t1 Concurrency
machine 1 machine 2
p2 p3
working on working on
part 1 part 2
t2 finishes t3 finishes
part 1 part 2
p4 p5
is ready is ready
p6 assembled parts
2.4.3. Conflict
In a manufacturing system, when two machines share the same resource and both try to
access it at the same time, this situation leads to conflict. In a Petri net, a conflict
situation occurs when a place enables more than one transition at the same time. In
conflict, only one transition can fire. A conflict in Petri nets is shown in Fig. 2.17.(a). As
can be seen from Fig. 2.17.(a), when there is a token in place p0 all transitions are
enabled. Since only one transition can fire in the case of conflict, any conflict, arising in a
Petri net, must be solved. The conflict can be solved by assigning a priority between the
conflicting transitions. Such a priority for resolving conflict has been proposed by (Zhou
and Dicesare, 1993) as shown in Fig. 2.17.(b), where there are 2n+1 places and ‘n’
transitions. As can be seen from the structure of the Petri net, shown in Fig. 2.17.(b),
each token deposited into place p0 is equally shared by places p1, p2, p3......pn, one by
one. It is also possible to introduce a priority scheme, in which every place, i.e., p1, p2,
....., pn, will receive different number of tokens. Such priority can be represented as
shown in Fig. 2.17.(c), where there are 3n+1 places and 2n transitions. Initially, there are
‘r’ tokens in place p3n and r, m, k, l are non-negative integers. Note that in this case
weighted arcs used to represent different number of tokens. Upon reaching the specified
number of tokens for each output transition the Petri net structure enables the next
output transition, and so on.
p0
t1 t2 ............ tn
p1 p2 ............ pn
(a)
p0
p2n
t1 t2 t3 ............ tn
(b)
p0
p3n
r
(c)
Figure 2.17. (a) Conflict. (b) Conflict free Petri net. (c) Conflict free Petri net in general case.
p0
p0 p0
p6 p5
p4
2
3
t1 t2 t1 t2 t1 t1 ' t2 t2 '
p3 2 3
p3 p4
p1 p2 p1 p2 p1 p2
(c)
(a) (b)
Figure 2.18. (a) Conflict. (b) Conflict free Petri net. (c) Conflict free Petri net in general case.
2.4.4. Buffer
weight k of the inhibitor arc represents the available spaces. In this case, transition t1 can
fire as long as the number of tokens in place p1 is less than k. When the number of tokens
in place p1 equals to k, transition t1 can not fire. This means that the buffer is full.
(a)
available spaces
p1 k
t1 t2
p2
...... ......
(b)
t1 k t2
p1
...... ......
(c)
Figure 2.19. (a). Buffer in a manufacturing system. (b). Buffer model, implemented by two places.
(c). Buffer model, implemented by a place and a weighted inhibitor arc.
..................
(a)
t1 p1 t2 p2 t3 p3 t4 tn-1 pn tn
........ ......... ........
(b)
t1 p1 t2 p2 t3 t4 tn-1 tn
p3 pn
........ ......... ........
(c)
Figure 2.20. (a) A conveyor belt. (b). Its FIFO queue model.
(c) FIFO queue model implemented with inhibitor arcs.
The FIFO queue models considered above are simple, because it was assumed that all
tokens (parts) were the same. However, in many practical situations the FIFO queues
have more than one part-type. For example, in Fig. 2.21.(a) there are two part-types,
namely part a and part b, on a conveyor. This is an example of a FIFO queue with two
parts. It is possible to model this system with a Petri net as shown in Fig. 2.21(b), where
tokens in places p1a, p2a, p3a, ....., pna represent the presence of part a’s on the 1st place,
2nd place, 3rd place......., on the nth place of the conveyor belt respectively, while tokens in
places p1b, p2b, p3b, ....., pnb represent the presence of part b’s on the 1st place, 2nd place
3rd place, ......., on the nth place of the conveyor belt respectively. Tokens in places p1, p2,
p3, ......, pn represent the absence of part a’s or b’s on the 1st place, 2nd place, 3rd place,
......., on the nth place of the conveyor belt. An alternative safe FIFO queue for two part
types is shown in Fig. 2.21.(c), where inhibitor arcs are used to specify available spaces
on the conveyor.
..................
part a part b
(a)
p1 p2 p3 pn
(b)
t 1b t 2b t 3b t 4b t (n-1)b t nb
p1b p2b p3b pnb
........ ......... ........
(c)
Figure 2.21. (a) A conveyor belt with two part-types. (b). Its FIFO queue model.
(c) FIFO queue model for two part-types, implemented with inhibitor arcs.
Note that p1’, p2’, p3’.....pn’ of the Fig. 2.20.(b) as well as p1, p2, p3.....pn of the Fig.
2.21.(b) are called monitor places. In Fig. 2.20.(b) the place invariant M(p1) + M(p1’) = 1
is hold for places p1 and p1’. This means that the number of tokens that can be present in
places p1 and p1’ can not be more than one. Similarly, in Fig. 2.21.(b), the place invariant
M(p1a) + M(p1b) + M(p1) = 1 is hold for places p1a, p1b and p1. This means that the
number of tokens that can be present in places p1a, p1b and p1 can not be more than one.
How the place invariant method is used to represent the maximum number of tokens,
which can be present in a group of places, is considered in detail in (Moody et al 1994,
Yamalidou et al, 1996).
2.4.6. Machine
There are two types of machine operations, that can be considered. In the first case, a
machine is assumed to work without any breakdown. The machine in this case is called a
reliable machine. In the second case, any possible breakdown is also taken into account.
The machine in this case is called an unreliable machine. A reliable machine can be
modelled as shown in Fig. 2.22.(a), where a token in place p1 represents the machine
being idle and a token in place p2 represents the machine working. Initially, the machine
is idle. When it is started to its operation (t1 fires), it is working. When it is stopped, it is
idle again. An unreliable machine can be modelled as shown in Fig. 2.22.(b), where the
machine has three different states: idle, working and down. When the machine is working
it may either finish its operation (transition t2) or it may breakdown (transition t3). When
the machine is down it needs to be repaired (transition t4) before returning back to its
working state.
p1
p1
idle idle
t1 t2 t1 t2
p2 p2
(a) (b)
t1 t1 t2
p1 p2 p1 p12 p3
(a) (b)
As manufacturing systems become more complex, the need for an effective automation
tool to produce Discrete Event Control System (DECS) becomes increasingly more
important. Petri nets have appeared as the most promising tool to facilitate such design
work. In this section, Automation Petri nets (APN) are proposed as a new method for
the design of DECSs. Since ordinary Petri nets do not deal with sensors and actuators,
the Petri net concepts are extended, by including actions and sensor readings as formal
structures within the APN. These extensions involve extending the Petri nets to
accommodate sensor signals at transitions and to assign action to the places. A typical
discrete event control system (DECS) is shown in Fig. 2.24.(a). It consists of a discrete
event system (DES), to be controlled and a discrete event controller (DEC). Sensor
readings are regarded as inputs from the DES to the DEC, and control actions are
considered as outputs from the DEC to the DES. The main function of the DEC is to
supervise the desired DES operation and to avoid forbidden operations. To do this, the
DEC processes the sensor readings and then it forces the DES to conform to the desired
specifications through control actions. Nowadays, PLCs are the most popular
implementation tools for this type of DEC. Petri nets can be used to design such DECs.
However, ordinary Petri nets do not deal with actuators or sensors. Because of this, it is
necessary to define a Petri net-based controller (Automation Petri net, APN) which can
embrace both actuators and sensors within an extended Petri net framework. An APN is
shown in Fig. 2.24.(b). In the APN, sensor readings can be used as firing conditions at
transitions. The presence or absence of sensor readings can be used in conjunction with
the extended Petri net pre-conditions to fire transitions. In the APN, two types of
actuation can be considered, namely impulse actions and level actions. Actions are
associated with places. With these additional features, it is possible to design Discrete
Event Control Systems. Fig. 2.24.(c) shows how an APN can be used as a DEC in a
DECS.
p
1
t1 x1
2
p p p p sensor
p 2 3 5
4
sensor 1 readings
3 2
t1 t2 x t3 x3
Discrete Event readings x1 2
Controller(DEC) 2
p p p p
2 3 4 5 p Action1
6
3 2
t2 x t3 x3
2
Discrete Event
control System (DES) control Discrete Event
p Action1 actions System (DES)
actions 6
Where,
• P = { p1, p2, ......,pn } is a finite, nonempty set of places,
• T = { t1, t2, ......., tn } is a finite, nonempty set of transitions, P ∪ Τ ≠ ∅ and P ∩ T= ∅,
• Pre: (P×T) → Ν is an input function that defines directed ordinary arcs from places to
transitions, where N is a set of nonnegative integers,
• Post: (P×T) → Ν is an output function that defines directed ordinary arcs from
transitions to places,
• In: (P×T) → Ν is an inhibitor input function that defines inhibitor arcs from places to
transitions,
• En: (P×T) → Ν is an enabling input function that defines enabling arcs from places to
transitions,
• χ = { χ1, χ2, ........, χm } is a finite, nonempty set of firing conditions associated with
the transitions,
• Q = { q1, q2, ......., qn } is a finite set of actions that might be assigned to the places,
• M0 : P → Ν is the initial marking.
The APN consists of two types of nodes called places, represented by circles ( O ), and
transitions, represented by bars ( ). There are three types of arcs used in the APN,
namely, ordinary arcs, represented by a directed arrow ( ), inhibitor arcs, represented
by an arrow, whose end is a circle ( ), and finally enabling arcs, represented by a
directed arrow, whose end is empty ( ). Weighted and directed ordinary arcs connect
places to transitions and vice versa, while weighted enabling arcs and inhibitor arcs
connect only places to transitions. Places represent the status of the system and
transitions represent events. Each transition has a set of input and output places, which
represent the pre-condition and post-condition of the transition. The actions (Q),
assigned to the places, can be either impulse actions or level actions. Impulse actions are
enabled at the instant when a token is deposited into the place and level actions are
enabled when there is a token(s) at the place. More than one action may be assigned to a
place. Firing conditions in the APN are recognised as external events such as sensor
readings. A firing condition, χ, associated with a transition t, is a Boolean variable that
can be 0, in which case related transition t is not allowed to fire, or it can be 1, in which
case related transition t is allowed to fire if it is enabled. The marking of the APN is
represented by the number of tokens in each place. Tokens are represented by black dots
(•). Movement of tokens between places describes the evolution of the APN and is
accomplished by the firing of the enabled transitions. The following rules are used to
govern the flow of tokens:
Enabling Rules: In the APN, there are mainly three rules which define whether a
transition is enabled to fire.
2. If the input place of a transition t is connected to the transition with an enabling arc,
then transition t is said to be enabled when the input place p contains at least the
number of tokens equal to the weight of the enabling arc connecting p to t.
3. If the input place of a transition t is connected to the transition with an inhibitor arc,
then transition t is said to be enabled when the input place p contains less tokens than
the weight of the inhibitor arc connecting p to t.
In the case, where a transition may have the mixture of these input arcs, enabling rule for
the transition must be analysed accordingly.
Firing Rules: In the APN, an enabled transition t can or can not fire depending on the
external firing condition χ of t. These firing conditions can be, positive level or zero level
of a sensor reading. Broadly speaking, a firing condition χ may include more than one
sensor reading with ‘AND’, ‘OR’ and ‘NOT’ logical operators. When dealing with more
than one sensor readings as firing conditions, the logical operators of firing conditions
must be taken into account accordingly. In the special case, where χ = 1, transition t is
always allowed to fire when it is enabled. When an enabled transition t fires, it removes
from each input place p the number of tokens equal to the weight of the directed
ordinary arc connecting p to t. It deposits, at the same time, in each output place p the
number of tokens equal to the weight of the directed arc connecting t to p. It should be
noted that, the firing of an enabled transition t does not change the marking of the input
places, which are connected to the transition t only by enabling or inhibitor arcs. It is also
possible to consider timed APNs, as in normal Petri nets.
2.6. DISCUSSION
In this chapter, an introduction to Petri nets has been given. This has included firstly, the
definition of ordinary Petri nets and firing of a simple Petri net. After that some of the
most important behavioural properties such as reachability, boundedness, liveness, of
Petri nets have been considered. Analysis techniques for Petri nets have also been
discussed. It is necessary to note that Petri net models considered in this thesis are
bounded, live, and also reversible, safe and conservative unless otherwise stated. Since
ordinary Petri nets are not always sufficient to represent and analyse complex systems,
some new classes of Petri nets have been proposed in the literature. Therefore, some
important extended Petri nets, such as weighted arc Petri net and timed Petri nets, have
been introduced by the research community. Then, some basic design modules have been
considered. It is important point out that the basic Petri net modules provided can be
used as building blocks when modelling a system with Petri nets. Finally, in this thesis an
extended Petri net formalism, called Automation Petri nets, has been proposed in order
to include sensor readings and actuator operations within the Petri net formalism. APNs
make it possible to design a controller for a discrete event system.