Petri Nets 1 Definition of Petri Net n

  • Slides: 18
Download presentation
Petri Nets 1

Petri Nets 1

Definition of Petri Net n C = ( P, T, I, O) Places P

Definition of Petri Net n C = ( P, T, I, O) Places P = { p 1, p 2, p 3, …, pn} ¨ Transitions T = { t 1, t 2, t 3, …, tn} ¨ Input I : T Pr (r = number of places) ¨ Output O : T Pq (q = number of places) ¨ n marking µ : assignment of tokens to the places of Petri net µ = µ 1, µ 2, µ 3, … µn 2

Applications of Petri Net n Petri net is primarily used for studying the dynamic

Applications of Petri Net n Petri net is primarily used for studying the dynamic concurrent behavior of network-based systems where there is a discrete flow. n Petri Nets are applied in practice by industry, academia, and other places. -reference 3

Basics of Petri Nets n Petri net consist two types of nodes: places and

Basics of Petri Nets n Petri net consist two types of nodes: places and transitions. And arc exists only from a place to a transition or from a transition to a place. n A place may have zero or more tokens. n Graphically, places, transitions, arcs, and tokens are represented respectively by: circles, bars, arrows, and dots. p 1 t 1 p 2 4

Basics of Petri Nets -continued n Below is an example Petri net with two

Basics of Petri Nets -continued n Below is an example Petri net with two places and one transaction. n Transition node is ready to fire if and only if there is at least one token at each of its input places p 1 t 1 p 2 state transition of form (1, 0) (0, 1) p 1 : input place p 2: output place 5

Properties of Petri Nets n Sequential Execution Transition t 2 can fire only after

Properties of Petri Nets n Sequential Execution Transition t 2 can fire only after the firing of t 1. This impose the precedence of constraints "t 2 after t 1. " n p 2 t 2 p 3 Synchronization Transition t 1 will be enabled only when a token there at least one token at each of its input places. n p 1 t 1 Merging t 1 Happens when tokens from several places arrive for service at the same transition. 6

Properties of Petri Nets n -continued Concurrency t 1 and t 2 are concurrent.

Properties of Petri Nets n -continued Concurrency t 1 and t 2 are concurrent. - with this property, Petri net is able to model systems of distributed control with multiple processes executing concurrently in time. t 1 t 2 7

Properties of Petri Nets n -continued Conflict t 1 and t 2 are both

Properties of Petri Nets n -continued Conflict t 1 and t 2 are both ready to fire but the firing of any leads to the disabling of the other transitions. t 1 t 2 8

Properties of Petri Nets n -continued Conflict - continued ¨ the resulting conflict may

Properties of Petri Nets n -continued Conflict - continued ¨ the resulting conflict may be resolved in a purely non-deterministic way or in a probabilistic way, by assigning appropriate probabilities to the conflicting transitions. there is a choice of either t 1 and t 2, or t 3 and t 4 t 1 t 2 t 3 t 4 9

Example: In a Restaurant (A Petri Net) Waiter free Customer 1 Customer 2 Take

Example: In a Restaurant (A Petri Net) Waiter free Customer 1 Customer 2 Take order wait eating Serve food Order taken Tell kitchen wait eating Serve food 10

Example: In a Restaurant (Two Scenarios) n Scenario 1: ¨ Waiter takes order from

Example: In a Restaurant (Two Scenarios) n Scenario 1: ¨ Waiter takes order from customer 1; serves customer 1; takes order from customer 2; serves customer 2. n Scenario 2: ¨ Waiter takes order from customer 1; takes order from customer 2; serves customer 1. 11

Example: In a Restaurant (Scenario 1) Waiter free Customer 1 Customer 2 Take order

Example: In a Restaurant (Scenario 1) Waiter free Customer 1 Customer 2 Take order wait eating Serve food Order taken Tell kitchen wait eating Serve food 12

Example: In a Restaurant (Scenario 2) Waiter free Customer 1 Customer 2 Take order

Example: In a Restaurant (Scenario 2) Waiter free Customer 1 Customer 2 Take order wait eating Serve food Order taken Tell kitchen wait eating Serve food 13

Example: Vending Machine (A Petri net) Take 15 c bar Deposit 10 c 5

Example: Vending Machine (A Petri net) Take 15 c bar Deposit 10 c 5 c 15 c Deposit 5 c 0 c Deposit 5 c Deposit 10 c Deposit 5 c 20 c Deposit 10 c Take 20 c bar 14

Example: Vending Machine (3 Scenarios) n Scenario 1: ¨ Deposit 5 c, deposit 5

Example: Vending Machine (3 Scenarios) n Scenario 1: ¨ Deposit 5 c, deposit 5 c, take 20 c snack bar. n Scenario 2: ¨ Deposit n 10 c, deposit 5 c, take 15 c snack bar. Scenario 3: ¨ Deposit bar. 5 c, deposit 10 c, deposit 5 c, take 20 c snack 15

Example: Vending Machine (Token Games) Take 15 c bar Deposit 10 c 5 c

Example: Vending Machine (Token Games) Take 15 c bar Deposit 10 c 5 c 15 c Deposit 5 c 0 c Deposit 5 c Deposit 10 c Deposit 5 c 20 c Deposit 10 c Take 20 c bar 16

Petri Net with Time n n n 1962 - Carl Adam Petri originally proposed

Petri Net with Time n n n 1962 - Carl Adam Petri originally proposed Petri without any notion of time. Concept of time was intentionally avoided because addition of time restricts the behavior of the net. 1970 s ~ - Addition of time has been discussed in order to analyze the performance of the modeled system. Many properties are still undecided for Petri nets extended with data and time. 17

References i i Fishwick, Paul(1995) – Simulation Model Design and Execution Petri Nets World

References i i Fishwick, Paul(1995) – Simulation Model Design and Execution Petri Nets World Ling, Chris(2001) – Lecture on Petri Nets Method Chapman, Nick(1997) – Surprise 97 journal on Petri Nets Models 18