Professional Documents
Culture Documents
Petri Nets
Lionel Amodeo
Professor
University of Technology of Troyes
lionel.amodeo@utt.fr
References
n Yalaoui A., Chehade H., Yalaoui F., Amodeo L., Optimization of Logistics,
WILEY, ISBN: 9781848214248, 2012
Outline
n I. Introduction
n II. Definitions
!" !$
Performance
Modelization Evaluation Optimization
!#
(cost, service)
!%
Real case
Or project
Linear programming Direct Exact Methods
State model Or indirecte Approach Methods
Markov Process Discrete (Heuristics -
Queuing files Event Metaheuristics)
Petri Nets Simulation
I. Introduction
n Graphical and Mathematical tool, applied to several areas
(automatic, computer science and manufacturing systems)
n First, introduced by Carl Adam Petri in 1962, at the University
of Darmstadt. And developed after by the MIT in 1968.
n It can be used as modeling, performance analysis and simulation
of discrete event systems
n Several simulation software have been developed for many
applications (manufacturing systems, computer sciences). Refer
to the Petri net Web Site (http://www.informatik.uni-
hamburg.de/TGI/PetriNets/)
II.1. Definitions
n A Petri Net is a directed bipartite graph with 2 types of nodes:
places and transitions
PN = (P, T, Pre, Post)
§ P : finite set of places, P = (P1,P2,...,Pn),
§ T : finite set of transitions, T = (T1,T2,...,Tm),
§ Pre : (PxT) ® IN : input function that defines directed
arcs from places to transitions
§ Post : (PxT) ® IN : output function that defines directed
arcs form transitions to places
n Notations :
• Pre(Pi,Tj) is the weight of the arc between Pi and Tj.
II.1. Definitions
n Example Oriented arc
n P = {P1, P2}
n T = {T1, T2} P1 T1 P2 T2
2
T1 T2
é1 0ù P1
pre = ê ú
ë0 2û P2 Place (circle) Transition (bar) Weight of the arc
é0 1 ù é- 1 1 ù
post = ê ú W = post - pre = ê ú
ë1 0û ë 1 - 2û
II.1. Definitions
n Notations
n
°T preset of transition Tj , set of its input places
j
n T°j postset of transition Tj , set of its output places
n °Pi postset of place Pi, set of its input transitions
n P°i postset of place Pi, set of its output transitions
n Example
P1 T1 P2 T2 P°1 = {T1}
2
°T2 = {P2}
II.1. Definitions
n Dynamic behavior of a Petri Net, introduction of tokens in
the net.
n A marked Petri Net is a 4-tuple:
PN = (P,T, Pre, Post)
n M : P ® IN is the marking function.
n M0 is the initial marking of the PN.
P1 T1 P2 T2
M0 = (2, 0)
2
Token or mark
II.2. Principles
Firing rules (2 steps)
n 1) A transition Tj is enabled (to firing) for a
marking M if and only if :
M(Pi) ³ Pre(Pi,Tj), " Pi Î °Tj.
n 2) Firing of a transition Tj
n Remove (consume) (Pre(Pi,Tj) tokens from each input
place of transition Tj tokens
n Add (produce) Post(Pi,Tj) tokens from each output
place of transition Tj
II.2. Principes
n Firing example
n Phase 1: Is T enabled?
n 2 conditions must be checked: M(P1) ≥ Pre(P1,T) et M(P2) ≥
Pre(P2,T) ?
n Phase 2: Firing of T
P3
3 T
P1
2
M0 = (3,1,0,0,0) P4 M1 = (0,0,1,2,2)
2
P2 P5
P1
2
T2
n Conflict Free Petri Net
n Every place has at most one output transition
P1 P3 P1 P3
2 2
T1 T1
M0 = (2,0,1) M1 = (1,1,1)
P2 P2
III. Analysis of PN
n Qualitative Analysis
n Properties of the Petri Net (structure of the net,
place, transition, markings)
n Quantitative Analysis
n Performance evaluation (introduction of time)
n Places (Average number of tokens)
n Transitions (Average number of firings)
III. Analysis of PN
The main analysis methods can be classified in 3 groups:
P1 T1 P2 T2
P1 T1 P2 T2
P3
P3
n 2 ways
n To use the reachability graph
n To use the mathematical equation
n Remark
n The fundamental equation does not guarantee if the
sequence S is feasible.
Petri Nets – Lionel Amodeo 22
III.4. Properties
Two types of qualitative properties exist:
III.4.1 Reachability
n Definition
n The problem of reachability of a marking M’
from a marking M is to check whether there is a
sequence of transitions s such that:
S
M® M’
III.4.2 Boundedness
n Definitions
n A place Pi is said bounded for an initial marking
M0 if there is a natural integer k such that, for
all marking reachable from M0, we have:
M(Pi) £ k
n A PN is bounded for an initial marking M0 if all
the places are bounded for M0.
n The boundedness property depends on the
initial marking
n Particular case : Safe PN : M(Pi) £ 1
Petri Nets – Lionel Amodeo 25
III.4.3 Liveness
n Definitions
n A transition Tj is life for an initial marking M0, if
for every reachable marking Mi, a firing
sequence S from Mi exists, which contains
transition Tj.
n A PN is live for an initial marking M0, if all
transitions are live for M0.
n The liveness excludes any deadlock (sink state)
– No transition can be fired.
III.4.4. Deadlock
n Example
n After 2 firing of T1 : deadlock
P1
T1
P2
III.5.5. Reversibility
n Definition
n A Petri net (PN, M0) is reversible if, for all
marking M reached from the initial marking M0,
M0 is reached from M.
Example
n With the following PN, find:
n The incidence matrix W
n The initial marquing
n The reachability graph
n The properties
n Introduction of time
n Timed PN, Temporal PN, Stochastic PN, continuous PN
n Structuration of complex data (used generally in computer
sciences)
n High level PN (Coloured, Object PN, …).
or positive)
Temp(Ti) = di = temporization (timing) associated to
Ti
n Functioning
n The token has two states:
n Reserved: when the firing of the transition is decided.
n Non-reserved
n The enabling of a transition does not involve the
immediate reservation of the token.
Petri Nets – Lionel Amodeo 31
M(P1)
P1 1
T1 d1
P2 0
t0 t1 t1+d1
d1=0.5 d2=1
Stock Machine
n The transitions reserve only one token per firing
n Properties: The PN is bounded, life and
reversible.
n M*=(0.5, 9.5) 9
8
n f*=(1, 1) 7
6
Marquage
5
4
3
2
1
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Temps
T3 P3 T4
T2 P2