1 / 24

Petri Nets

Petri Nets. Sunday, November 18, 2012. Definition of Petri Net. C = ( P, T, I, O) Places P = { p 1 , p 2 , p 3 , …, p n } Transitions T = { t 1 , t 2 , t 3 , …, t n } Input I : T  P r (r = number of places) Output O : T  P q (q = number of places)

kimberly
Télécharger la présentation

Petri Nets

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Petri Nets Sunday, November 18, 2012

  2. Definition of Petri Net • C = ( P, T, I, O) • PlacesP = { p1, p2, p3, …, pn} • TransitionsT = { t1, t2, t3, …, tn} • Input I : T  Pr (r = number of places) • OutputO : T  Pq (q = number of places) • marking µ : assignment of tokens to the places of Petri net µ = µ1, µ2, µ3, … µn

  3. Basics of Petri Nets Petri net is primarily used for studying the dynamic concurrent behavior of network-based systems where there is a discrete flow. 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. A place may have zero or more tokens. Graphically, places, transitions, arcs, and tokens are represented respectively by: circles, bars, arrows, and dots.

  4. Basics of Petri Nets … Below is an example Petri net with two places and one transaction. Transition node is ready to fire if and only if there is at least one token at each of its input places state transition of form (1, 0)  (0, 1) p1 : input place p2: output place p1 t1 p2

  5. Basics of Petri Nets … Sequential ExecutionTransition t2 can fire only after the firing of t1. This impose the precedence of constraints "t2 after t1." SynchronizationTransition t1 will be enabled only when a token there are at least one token at each of its input places. MergingHappens when tokens from several places arrive for service at the same transition. p1 t1 p2 t2 p3 t1

  6. Basics of Petri Nets … Concurrencyt1 and t2 are concurrent. - with this property, Petri net is able to model systems of distributed control with multiple processes executing concurrently in time. t1 t2

  7. Basics of Petri Nets … Conflictt1 and t2 are both ready to fire but the firing of any leads to the disabling of the other transitions. t1 t2 t1 t2

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

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

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

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

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

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

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

  15. Petri Net examples (Dining Philosophers) • Five philosophers alternatively think and eating • Chopsticks: p0, p2, p4, p6, p8 • Philosophers eating: p10, p11, p12, p13, p14 • Philosophers thinking/meditating: p1, p3, p5, p7, p9

  16. Time in Petri Net • Original model of Petri Net was timeless. Time was not explicitly considered. • Even though there are arguments against the introduction of time, there are several applications that require notion of time. • General approach: • Transition is associated with a time for which no event/firing of a token can occur until this delay time has elapsed. • This delay time can be deterministic or probabilistic.

  17. Modeling of Time • Constant times • Transition occurs at pre-determined times (deterministic) • Stochastic times • Time is determined by some random variable (probabilistic) • Stochastic Petri Nets(SPN)

  18. Stochastic Petri Nets • An SPN is defined as a 7-tuple SPN= (P, T, I(.), O(.), H(.), W(.), M0) where • PN = (P, T, I(.), O(.), H(.), M0) is the P/T system underlying the SPN • Transitions have an exponentially distributed delay • W(.): T --> R assigns a rate to each transition (inverse of the mean firing time)

  19. Stochastic Petri Nets … • The stochastic process underlying an SPN is a CTMC in which • the state transition rate diagram is isomorphic to the reachability graph • the transition labels are computed from the W(.) functions of the transitions enabled in a state.

  20. Stochastic Petri Nets …

  21. Generalized Stochastic Petri Net (GSPN) • Two types of transitions • timed with an exponentially distributed delay • immediate, with constant zero delay • immediate have priority over timed • Why immediate transitions: • to account for instantaneous actions (typically choices) • to implement logical actions (e.g. emptying a place) • to account for large time scale differences (e.g. bus arbitration vs. I/O accesses)

  22. Generalized Stochastic Petri Net (GSPN) …

  23. Stochastic Activity Network (SAN) • The desire to represent system characteristics of parallelism and timeliness, as well as fault tolerance and degradable performance, precipitated the development of general level performability models known as stochastic activity networks. • Stochastic activity networks are probabilistic extensions of activity networks the nature of the extension is similar to the extension that constructs stochastic Petri nets from (classical) Petri nets.

  24. Stochastic Activity Network (SAN) …

More Related