280 likes | 742 Views
Petri Nets A Tutorial. Based on: Petri Nets and Industrial Applications: A Tutorial. Petri Net Intro. Often used for description of distributed systems Provide a graphical notation for stepwise processes Choice Iteration Concurrent execution
E N D
Petri Nets A Tutorial Based on: Petri Nets and Industrial Applications: A Tutorial
Petri Net Intro. • Often used for description of distributed systems • Provide a graphical notation for stepwise processes • Choice • Iteration • Concurrent execution • Has exact mathematical definition of their execution semantics
Petri Nets Basics • Bipartite directed graph • Made of: • Places • Transitions • Directed Arcs • Tokens
Petri Nets Basics • Places • Circles • Input place to a transition if there is a directed arc connecting the place to a transition • Output place to a transition if there is an arc connecting a transition to the place
Petri Nets Basics • Transitions • Bars (box) • Represent events • Tokens • Dot in places • Indicate if a condition is true or false • Petri Net Marking – defines current state of modeled system, distribution of tokens.
Petri Nets Formal Notation • PN = {P,T,I,O,M0} where • P={p1,p2,…,pn} is a finite set of places • T={12,t1,…,tn} is a finite set of transitions, • P ᴜ T ≠ {} and P ∩ T = {} • I: (P X T) → N is an input function that defines directed arcs from places to transitions, N is set of nonnegative integers • O: (P X T) → N is an output function that defines directed arcs from transitions to places • M0: P→N is the initial marking
Petri Nets Formal Notation Formalize this Petri Net • PN = {P,T,I,O,M0}
Petri Nets Formal Notation • PN = {P,T,I,O,M0} • P={p1,p2,p3} • T={t1} • I(p1,t1)=2 • O(p2,t1)=2 • O(p3,t1)=1 • M0(p1)=2
Petri Nets Token Flow Rules • Enabling Rule • t:T, t is enabled if each input place p of t has at least the same number of tokens as weight of directed arc
Petri Nets Token Flow Rules • Firing Rule • A) Enabled transition may or may not fire depending on additional interpretation • B) Firing of an enabled transition t, removes an equal number of tokens from each input place as the weight of the transition, and puts tokens in each output place.
Petri Net Properties • Reachability – a marking Mi is said to be reachable from M0 if there exists a sequence of transitions firings which transforms a marking M0 to Mi. • Boundedness and safeness – Petri net is k-bounded if the number of tokens in a p is always less than or equal to k. A Petri Net is safe it k =1. • Conservativeness – Petri Net is conservative if number of tokens is conserved.
Petri Net Properties Boundedness and Conservativness
Petri Net Analysis • The Coverability Tree • Enumerate all possible markings reachable from the initial state. • Algorithm: • Let M0 be root of tree, tag as ‘new’ • While ‘new’ markings exist: • Select a ‘new’ marking • If M is identical to another marking, tag as ‘old’ • If no transitions are enabled in M, then M is ‘terminal’ • For every transition in t enabled in M: • Obtain the marking M’ , result from firing • If a token value can increase indefinitely place ‘ω’ • Introduce M’ as a node, tag as ‘new’ draw arc from M to M’
Petri Net Analysis Boundedness and Conservativness
Petri Net Uses Uses: Software Development Industrial Engineering Chemistry