You are on page 1of 10

Ordinary Petri Nets

A Petri net is an ordinary Petri net if all of its arcs’ weights are
ECE-605 1’s.

Define:
Ÿt = {p | I(p, t) >0 }, the set of input places of t

Subclasses of Petri Nets tŸ = {p | O(p, t) >0 } , the set of output places of t


Ÿp = {t | O(p, t) >0 } , the set of input transitions of p

p Ÿ = {t | I(p, t) >0 }, the set of output transitions of p

Conventionally, we also use * instead of dot , i.e.,


Ÿ
*t, t*, *p, and p*

Question: What is ŸŸt or Ÿ(Ÿt)?


We can also define ŸS and SŸ given a subset S in PUT.
Pro f. Me n g Ch u Zh o u 1 Pro f. Me n g Ch u Zh o u 2

State Machines State Machines

• A state machine (SM) is an ordinary Petri net such that each


transition t has exactly one input place and exactly one
output place, i.e.,
|Ÿt| = |tŸ| = 1 for all t T
• SM does not allow synchronization
• Construct an SM with 3 places and 5 transitions

Pro f. Me n g Ch u Zh o u 3 Pro f. Me n g Ch u Zh o u 4

1
State Machines Marked Graph

• A state machine is live iff it is strongly connected and M0 has • A marked graph (MG) is an ordinary Petri net such that each
at least one token. place p has exactly one input transition and exactly one
output transition, i.e.,
• Why? |Ÿp| = |p Ÿ| = 1 for all p ÎP
• What is a strongly connected directed graph? • MG does not allow conflicts
• Construct an MG with 5 places and 3 transitions
• A state machine is safe if M0 has at most one token. A live
state machine is safe if M0 has exactly one token.

Pro f. Me n g Ch u Zh o u 5 Pro f. Me n g Ch u Zh o u 6

Marked Graph Example Turn MG to Marked Directed Graph

• Arcs for places, nodes for transitions, and tokens are placed
on arcs.
• Graph presentation G of the previous MG:

• For a MG, the token count in a directed circuit is invariant


under any transition firing.

Pro f. Me n g Ch u Zh o u 7 Pro f. Me n g Ch u Zh o u 8

2
Live and Safe Marked Graph Free-Choice Net
• A free-choice net (FC) is an ordinary Petri
net such that every arc from a place is either
• A marked graph is live iff M0 places at least one token on each a unique outgoing arc or a unique incoming
directed circuit in G. arc to a transition, i.e.,
• A live MG is safe iff every arc (place) belongs to a directed – For all p in P, |p Ÿ|≤ 1 or Ÿ(p Ÿ) = {p}
circuit C with M0 (C) =1
– Equivalently, for all p1, p2 in P,
– M0 (C): total number of tokens on C.
p1 Ÿ p2 Ÿ ≠ => |p1 Ÿ|=|p2 Ÿ| = 1
• FC does not allow confusion, a situation
where conflict and concurrency are mixed.

Pro f. Me n g Ch u Zh o u 9 Pro f. Me n g Ch u Zh o u 10

Extended Free-Choice Net Asymmetric choice net

• An extended free-choice net (EFC) is • An asymmetric choice net (AC) (also known as a simple net) is
an ordinary Petri net such that for all an ordinary Petri net such that that for all p1, p2 in P,
p1, p2 in P, p1 Ÿ p2 Ÿ ≠ => p1 Ÿ p2 Ÿ or p2 Ÿ p1 Ÿ
p1 Ÿ p2 Ÿ ≠ => p1 Ÿ=p2 Ÿ • Example?

• FC is a special case of EFC

Pro f. Me n g Ch u Zh o u 11 Pro f. Me n g Ch u Zh o u 12

3
Siphons and Traps Siphon and Trap Examples
• Let ŸS and S Ÿ denote the sets of input and output
transitions of place set S in a PN, respectively.

• S is called a siphon if ŸS S Ÿ

• Intuitively, if a transition is going to deposit a token to


a place in a siphon S, the transition must also remove
a token from S.

• S is called a trap if S Ÿ ŸS

• Intuitively, a trap S represents a set of places in


which every transition consuming a token from S must
also deposit a token back into S.
Pro f. Me n g Ch u Zh o u 13 Pro f. Me n g Ch u Zh o u 14

Siphon and Trap Examples Use of Siphons and Traps


A place set S is marked if any of its place is marked;
and it is empty if none of its places has tokens.
Trap or Siphon?
S1= {p1, p2, p3} A free-choice PN is live if and only if (iff) every siphon
in it contains a marked trap.
S2={p1, p2, p4}
S3={p2, p3}
S4={p2, p3, p4} An asymmetric choice net is live if every siphon in it
contains a marked trap.

Pro f. Me n g Ch u Zh o u 15 Pro f. Me n g Ch u Zh o u 16

4
Examples Venn Diagram

Pro f. Me n g Ch u Zh o u 17 3/16/2008 SE306-11 Pro f. Me n g Ch u Zh o u 18 18

Live and Safe Petri nets Timed Petri Nets


• The concept of time is not given in the
original definition of PN.
• PN without time can describe the logic
structure and behavior of the modeled
system, but not its evolution over time.
• Timed Petri Nets (TPN) are introduced for
performance evaluation of dynamic
systems.

Pro f. Me n g Ch u Zh o u 19 Pro f. Me n g Ch u Zh o u 20

5
Interpretation of Execution Rules in TPN Timed Petri Nets
• If a delay d is associated with a place, • Deterministic Timed PN (DTPN):
after a token arrives in the place, it has to Concurrent choice-free PN that associate
wait for d units before it can be used to fixed time delays to transitions, places, or
enable its output transition. arcs.
• If d is associated with a transition, it takes • Stochastic Petri Nets (SPN): When a firing
d units for the transition to finish firing. time delay is characterized by a random
variable, in particular, if these random
• If d is associated with an arc, then a token variables are exponentially distributed, the
flows through arc in d units. resulting timed Petri nets are stochastic
• A timed Petri net can be converted to a Petri nets.
timed transition or place or arc Petri net.
Pro f. Me n g Ch u Zh o u 21 Pro f. Me n g Ch u Zh o u 22

DTPN – Timed Marked Graph Marked Graphs & Properties


• The token count in an elementary loop of marked
• Deterministic Timed PN: Concurrent graph does not change as a result of transition
choice-free PN that associate fixed time firings.
delays to transitions, places, or arcs. • A marked graph is strongly connected if there is a
path from any node to any other node.
• Choice-free PN is called marked graphs - • For a strongly connected marked graph, a firing
each place has one incoming and one sequence leads back to m0 iff it fires every
outgoing arc. transition for an equal number of times.
• A fundamental approach to studying DTPN
is based on two concepts: total time delay
in a loop and total number of tokens in a
loop (token count).
Pro f. Me n g Ch u Zh o u 23 Pro f. Me n g Ch u Zh o u 24

6
Performance evaluation of Cycle Time in Timed Marked Graph
concurrent systems Loop cycle time and its evaluation:
• Throughput is the inverse of the cycle time. The Transitions-have-delay-o nly case:
cycle time is defined as the largest cycle time in
t1 (10 min.) If m0 =(1 0)T the cycle time is: 24 min.
its marked graph representation. The cycle time
of each cycle is the sum of the delays of all p1 p2 If m0 =(2 0)T the cycle time is: 12 min.
associated transitions (or places) divided by If m0 =(1 1)T the cycle time is: 12 min.
t2 (14 min.)
number of the tokens that can reside in the cycle.
If m0 =(3 0)T the cycle time is: 8 min.

=[d(t1)+d(t2)]/[m0(p1)+m0(p2)]
i.e., the cycle time is the sum of delays
divided by the sum of token in a loop
Pro f. Me n g Ch u Zh o u 25 Pro f. Me n g Ch u Zh o u 26

Cycle Time in Timed Marked Graph Cycle Time in Timed Marked Graph
Loop cycle time and its evaluation: Loop cycle time and its evaluation:
Arcs-have-delay-only case:
t1 Places-have-delay-only case:
p1(10 min.) 10 min.
t1 If m0 =(1 0)T, the cycle time is: 24 min.
p2(14 min.)
If m0 =(1 0)T, the cycle time is: 24 min. p1
p2 If m0 =(2 0)T, the cycle time is: 12 min.
t2
If m0 =(2 0)T, the cycle time is: 12 min. If m0 =(1 1)T, the cycle time is: 12 min.
t2

If m0 =(1 1)T, the cycle time is: 12 min. 14 min.


If m0 =(3 0)T, the cycle time is: 8 min.
If m0 =(3 0)T, the cycle time is: 8 min. …

=[d(p1)+d(p2)]/[m0(p1)+m0(p2)] =[d(p1,t1)+d(t2,p1)]/[m0(p1)+m0(p2)]
i.e., the cycle time is the sum of delays i.e., the cycle time is the sum of delays
divided by the sum of token in a loop divided by the sum of token in a loop
Pro f. Me n g Ch u Zh o u 27 Pro f. Me n g Ch u Zh o u 28

7
Cycle Time in Timed Marked Graph Cycle Time in Timed Marked Graph
Loop cycle time and its evaluation:
General case: • The cycle time (i.e., the time from any beginning
6 min.
If m0 =(1 0)T, state and back to itself) is found as:
t1 (4 min)
p1 (2 min.) 2 min. Loop delay=2+6+4+2+1+4+1+4=24 min =Max{Di /Ni }
p2 (1 min)
Token count in the loop = 1 where Di is the sum of all delays in the i-th loop
4 min.
t2 (1 min.) The cycle time is 24 Min. and Ni is the total number of tokens in it.
4 min. If m0 =(2 0)T, Token count =2 and thus • Di is called loop delay and Ni called the token
the cycle time is: 12 min. count of the i-th loop.
=Loop delay/Token count in the loop • If Dj/Nj= j , the j-th loop is called a bottleneck.

= D/N
Pro f. Me n g Ch u Zh o u 29 Pro f. Me n g Ch u Zh o u 30

Computing Cycle Time Example: Producer/Consumer


• Enumerate all loops Loops Total time delay Token sum Cycle time
p1t1 p2 t2 p1 10 1 10
• Find loop delays, token count and cycle p4 t3 p5 t4 p4 6 1 6
time for each loop. t1 Producing process is slower than
p1 consuming process. We may want
• Apply to find the system cycle time p 2 10s
to add more producer to satisfy the
t2
=Max{D
i
i/Ni}
consumer. If we add one more
p3
producer (two tokens in p1):
• Identify all bottleneck loops. t3
p4 p 5 6s Loops Delay Token sum Cycle time
p1t1 p2 t2 p1 10 2 5
t4 p4 t3 p5 t4 p4 6 1 6

Will it help if more producers are added?


Pro f. Me n g Ch u Zh o u 31 Pro f. Me n g Ch u Zh o u 32

8
Example: Manufacturing cell Example: Manufacturing cell
Output
p1: Raw part av ailable T1 p2 t2 t3 p4 t4 (t4,p1)
I nput Storage
Area Storage Area
p2: M1 proc es s ing a part (10) Time delay 1 10 1 1 16 1 2
p3: Intermediate parts ready p5 p6 p7
p4: M2 proc es s ing a part (16) p1
Machine
1 Machine
2
p5: M1 av ailable p2 p4 System cycle time:32
Robot1 Robot2 p6: buffer s lots av ailable
t1 t2 p3 t3 t4 Adding one more token
Buffer
p7: M2 av ailable p8 p9 to p1 (load one more
p8: R1 av ailable
p5 p6 p7 raw part to input storage
p9: R2 av ailable
Loops Di Ni Di/Ni area) will lower 32 to 16.
p1 t1: R1 loading (1)
p4
p2
t2: R1 unloading (1) p5t1p2t2p5 12 1 12 Will loading more raw
p3 t3 t4 t3: R2 loading (1) p6t2 p3 t3 p6 2 2 1 parts to input area
t1 t2
p8 p9 t4: R2 unloading (1) p 7 t3 p 4 t4 p 7 18 1 18 storage area shorten the
(t4,p1): load a raw part to input p 1 t1 p 2 t2 p 3 t3 p 4 t4 p 1 32 1 32 cycle time?
s torage area (2) p 8 t1 p 2 t2 p 8 12 1 12
Pro f. Me n g Ch u Zh o u 33
p 9 t3 p 4 t4 p 9 18 1 18
Pro f. Me n g Ch u Zh o u 34

Example Example (Continued)


p5 Loops Total time delay Token sum Cycle time
p1t1 p2 t2 p3 t3 p1 28 2 14
δ5 =0 p1 t1 p4 t3 p1 16 2 8
p2 t2 p3
p5 t1 p2 t2 p5 13 1 13
t3
p1 t1 If you are given the opportunity to reduce one and only
δ 2 =8 τ2 = 2 δ 3 =9 one activity’s delay into half, which activity would you
p4 choose? p5
δ1 = 2 τ1 = 3 τ3 = 4
p5
δ 4 =7 What is the improvement δ 5 =0
p2 t2 p3
percentage? t3
p1 t1
Loops Total time delay Token sum Cycle time τ2 =2
δ 2 =8 δ 3 =9
p1t1 p2 t2 p3 t3 p1 28 2 14 p4
p1 t1 p4 t3 p1 16 2 8 δ1 = 2 τ1 = 3 τ3 = 4
p5
p5 t1 p2 t2 p5 13 1 13
System cycle time is 14 time units. δ 4 =7

Pro f. Me n g Ch u Zh o u 35 Pro f. Me n g Ch u Zh o u 36

9
Example (Continued) Exercise
Loops
p1t1 p2 t2 p3 t3 p1
Total time delay
28
Tok en s um
2
Cy c le time
14 Production System
p1 t1 p4 t3 p1 16 2 8
p5 t1 p2 t2 p5 13 1 13
p7 p8 p9
If you are given the opportunity to reduce one and only one activity’s p1 t1 t3 t4
delay into half, which activity would you choose? t2 p3 t5 p6 t6
Solution: p2 p5
p2 p5
p4
What is the improvement
percentage? δ 5 =0
p2 t2 p3 p10 p11
Solution: (14-12)/14*100%
t1 t3
p1
δ 2 =8 τ2 =2 δ 3 =9
p4 d 1 =1, d 2 =10, d 3 =1, d 4=1, d 5=20, d 6=1
δ1 = 2 τ1 = 3 τ3 = 4
p5
δ 4 =7

Pro f. Me n g Ch u Zh o u 37 Pro f. Me n g Ch u Zh o u 38

Exercise
Traffic Control System
red1 red2

safe2
yr1 yr2

rg1 yellow1 rg2


yellow2

gy1 gy2 What is the


safe1 cycle time when
time for each
green1 green2 light is given?
Pro f. Me n g Ch u Zh o u 39

10

You might also like