petri nets
play

Petri Nets 1. Finite State Automata 2. Petri net notation and - PowerPoint PPT Presentation

Petri Nets 1. Finite State Automata 2. Petri net notation and definition (no dynamics) 3. Introducing State: Petri net marking 4. Petri net dynamics 5. Capacity Constrained Petri nets 6. Petri net models for . . . FSA Nondeterminism


  1. Petri Nets 1. Finite State Automata 2. Petri net notation and definition (no dynamics) 3. Introducing State: Petri net marking 4. Petri net dynamics 5. Capacity Constrained Petri nets 6. Petri net models for . . . • FSA • Nondeterminism • Data Flow Computation • Communication Protocols Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 1/69

  2. 7. Queueing Systems 8. Petri nets vs. State Automata 9. Analysis of Petri nets • Boundedness • Liveness and Deadlock • State Reachability • State Coverability • Persistence • Language Recognition 10. The Coverability Tree 11. Extensions: colour, time, . . . Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 2/69

  3. Finite State Automaton ( E, X, f, x 0 , F ) • E is a finite alphabet • X is a finite state set • f is a state transition function, f : X × E → X • x 0 is an initial state, x 0 ∈ X • F is the set of final states Dynamics ( x ′ is next state): x ′ = f ( x, e ) Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 3/69

  4. FSA graphical/visual notation: State Transition Diagram 1 1 Init End_1 0 1 0 End_0 0 Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 4/69

  5. FSA Operational Semantics Rule 1 (priority 3) Locate Initial Current State 1 1 ::= <ANY> <COPIED> 3 2 Current State Rule 2 (priority 1) State Transition 1 1 Current State Current State condition: 2 2 matched(4).input == input[0] 4 3 <COPIED> <COPIED> / ::= 3 5 5 4 <COPIED> <ANY> / <ANY> <ANY> <ANY> <COPIED> action: remove(input[0]) Rule 3 (priority 2) Local State Transition 1 1 Current State Current State condition: matched(4).input == input[0] 2 2 ::= 4 4 <COPIED> / <COPIED> <ANY> / <ANY> 3 3 action: <COPIED> <ANY> remove(input[0]) Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 5/69

  6. Simulation steps Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 6/69

  7. 1 1 1 1 Init End_1 Init End_1 input 0 0 0 Rule 1 Rule 2 1 1 0 0 End_0 End_0 Current State Current State 0 0 1 1 1 1 Init End_1 Init End_1 input 1 0 0 input 0 Rule 2 Rule 2 1 1 0 0 End_0 End_0 Current State Current State 0 0 end of input Final Action "Accept Input" Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 7/69

  8. State Automaton ( E, X, Γ , f, x 0 ) • E is a countable event set • X is a countable state space • Γ( x ) is the set of feasible or enabled events x ∈ X, Γ( x ) ⊆ E • f is a state transition function, f : X × E → X , only defined for e ∈ Γ( x ) • x 0 is an initial state, x 0 ∈ X ( E, X, Γ , f ) omits x 0 and describes a class of State Automata. Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 8/69

  9. State Automata for Queueing Systems Departure Arrival Cashier Queue Physical View Departure Arrival Cashier Queue [IAT distribution] [ST distribution] Abstract View Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 9/69

  10. State Automata for Queueing Systems: customer centered a a a a a a 0 1 2 3 4 5 ... d d d d d d E = { a, d } X = { 0 , 1 , 2 , . . . } Γ( x ) = { a, d } , ∀ x > 0; Γ(0) = { a } f ( x, a ) = x + 1 , ∀ x ≥ 0 f ( x, d ) = x − 1 , ∀ x > 0 Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 10/69

  11. State Automata for Queueing Systems: server centered (with breakdown) s I B c b r D Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 11/69

  12. State Automata for Queueing Systems: server centered (with breakdown) E = { s, c, b, r } Events: s denotes service starts, c denotes service completes, b denotes breakdown, r denotes repair. X = { I, B, D } State: I denotes idle, B denotes busy, D denotes broken down. Γ( I ) = { s } , Γ( B ) = { c, b } , Γ( D ) = { r } f ( I, s ) = B, f ( B, c ) = I, f ( B, b ) = D, f ( D, r ) = I Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 12/69

  13. Limitiations/extensions of State Automata • Adding time ? • Hierarchical modelling ? • Concurrency by means of × • States are represented explicitly • Specifying control logic, synchronisation ? Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 13/69

  14. Petri nets • Formalism similar to FSA • Graphical/Visual notation • C.A. Petri 1960s • Additions to FSA: – Explicitly (graphically/visually) represent when event is enabled → describe control logic – Elegant notation of concurrency – Express non-determinism Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 14/69

  15. Petri net notation and definition (no dynamics) ( P, T, A, w ) • P = { p 1 , p 2 , . . . } is a finite set of places • T = { t 1 , t 2 , . . . } is a finite set of transitions • A ⊆ ( P × T ) ∪ ( T × P ) is a set of arcs • w : A → N is a weight function Note: no need for countable P and T . Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 15/69

  16. Derived Entities • I ( t j ) = { p i : ( p i , t j ) ∈ A } set of input places to transition t j ( ≡ conditions for transition) • O ( t j ) = { p i : ( t j , p i ) ∈ A } set of output places from transition t j ( ≡ affected by transition) • Transitions ≡ events • similarly: input- and output-transitions for p i • graphical/visual representation: Petri net graph (multigraph) Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 16/69

  17. Example Petri net • P = { H 2 , O 2 , H 2 O } • T = { t } • A = { ( H 2 , t ) , ( O 2 , t ) , ( t, H 2 O ) } • w (( H 2 , t )) = 2 , w (( O 2 , t )) = 1 , , w (( t, H 2 O )) = 2 Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 17/69

  18. Pure Petri net • No self-loops: � ∃ p i ∈ P, t j ∈ T : ( p i , t j ) ∈ A, ( t j , p i ) ∈ A • Can convert impure to pure Petri net Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 18/69

  19. Impure to Pure Petri net Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 19/69

  20. Introducing State: Petri net Markings • Conditions met ? Use tokens in places • Token assignment ≡ marking x x : P → N • A marked Petri net ( P, T, A, w, x 0 ) x 0 is the initial marking • The state x of a marked Petri net x = [ x ( p 1 ) , x ( p 2 ) , . . . , x ( p n )] Number of tokens need not be bounded (cfr. State Automata states). Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 20/69

  21. State Space of Marked Petri net • All n -dimensional vectors of nonnegative integer markings X = N n • Transition t j ∈ T is enabled if x ( p i ) ≥ w ( p i , t j ) , ∀ p i ∈ I ( t j ) Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 21/69

  22. Example with marking, enabled Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 22/69

  23. Petri Net Dynamics State Transition Function f of marked Petri net ( P, T, A, w, x 0 ) f : N n × T → N n is defined for transition t j ∈ T if and only if x ( p i ) ≥ w ( p i , t j ) , ∀ p i ∈ I ( t j ) If f ( x , t j ) is defined, set x ′ = f ( x , t j ) where x ′ ( p i ) = x ( p i ) − w ( p i , t j ) + w ( t j , p i ) • State transition function f based on structure of Petri net • Number of tokens need not be conserved (but can) Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 23/69

  24. Example “firing” • Use PNS tool http://www.ee.uwa.edu.au/ braunl/pns/ • Select Sequential Manual execution • Transition: [2 , 2 , 0] → [0 , 1 , 2] Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 24/69

  25. Example • order of firing not determined (due to untimed model) • selfloop • “dead” net Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 25/69

  26. Conflict, choice, decision Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 26/69

  27. Semantics • sequential vs. parallel • Handle nondeterminism: 1. User choice 2. Priorities 3. Probabilities (Monte Carlo) 4. Reachability Graph (enumerate all choices) Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 27/69

  28. Application: Critical Section Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 28/69

  29. Reachability Graph t2e t1e [1,0,1,0,1] t1 t2 [0,1,0,0,1] [1,0,0,1,0] Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 29/69

  30. Algebraic Description of Dynamics • Firing vector u : transition j firing u = [0 , 0 , . . . , 1 , 0 , . . . , 0] • Incidence matrix A : a ji = w ( t j , p i ) − w ( p i , t j ) • State Equation x ′ = x + uA Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 30/69

  31. Infinite Capacity Petri net • Add Capacity Constraint: K : P → N • New transition rule Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: Petri Nets 31/69

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend