Presentation is loading. Please wait.

Presentation is loading. Please wait.

Modelling by Petri nets

Similar presentations


Presentation on theme: "Modelling by Petri nets"— Presentation transcript:

1 Modelling by Petri nets
Maria Pia FANTI Dipartimento di Elettrotecnica ed Elettronica Polytechnic of Bari, ITALY

2 Outline What are Petri Nets? Definitions and basic concepts
Modelling with Petri Nets: main structures Timed Petri nets Conclusions

3 Petri Nets Petri Nets (PN) offer advantages because of their twofold representation: graphical and mathematical. It is a graphical and mathematical tool for the formal description of the logical interactions and the dynamics of complex systems. PN are particularly suited to model: Concurrency; Conflict; Sequencing; Synchronization; Sharing of limited resources; Mutual exclusion.

4 Petri Nets Petri Nets (PN) originated from the Phd thesis of Carl Adam Petri in 1962. A web service on PN is managed at the University of Aarhus in Denmark, where a bibliography with more that 8,500 items can be found. The main International Conference: ATPN - Application and Theory of PN Other conferences: Int. IFAC conference, IEEE SMC conference, IEEE CASE, WODES, etc.

5 Main references about definitions and properties of ordinary Petri nets
Murata T., (1989), “Petri nets: properties, analysis and applications”, IEEE Proceedings, Vol. 77, no. 4, Peterson, J.L., (1981), Petri Net Theory and the Modeling of Systems, Prentice Hall, Englewood Cliffs, NJ, USA.

6 Definitions A Petri net is a bipartite directed graph consisting of two kinds of nodes: places and transitions Places typically represent conditions within the system being modeled. They are represented by circles. Transitions represent events occurring in the system that may cause change in the condition of the system. They are represented by bars. Arcs connect places to transitions and transitions to places (never an arc from a place to a place or from a transition to a transition).

7 Definitions Input arcs are directed arcs drawn from places to transitions, representing the conditions that need to be satisfied for the event to be activated Output arcs are directed arcs drawn from transitions to places, representing the conditions resulting from the occurrence of the event

8 Definitions Input places of a transition are the set of places that are connected to the transition through input arcs Output places of a transition are the set of places to which output arcs arrive from the transition

9 Example of a PN p1 – resource idle p2 – resource busy
t1 t1 p1 p2 t2 p1 – resource idle p2 – resource busy t1 – task arrives t2 – task completes

10 Definitions More formally, a Petri net is described by the four-tuple PN=(P, T, Pre, Post) where: P is the set of places and |P|=m T is the set of transitions and |T|=n Pre: P×TN is the pre incidence matrix, that specifies the arcs directed from places to transitions Post: P×TN is the post incidence matrix, that specifies the arcs directed from transitions to places

11 Example of Petri net

12 Incidence Matrix

13 PN Definitions Tokens are dots (or integers) associated with places; a place containing tokens indicates that the corresponding condition holds Marking is a function M: PN that associates to each place a non negative number. It is a vector listing the number of tokens in each place of the net

14 PN Definitions M0 is the initial marking
A net system <PN, M0 > is a dynamical system

15 PN dynamics When input places of a transition have the required number of tokens, the transition is enabled. An enabled transition may fire (event happens) removing one or more tokens from each input place and depositing one or more tokens in each of its output place. 2 3 p1 p2 p1 t1 2 3 p1 p2 t1

16 Example of a PN p1 – resource idle p2 – resource busy p3 – user
t1 p1 p2 t2 p1 – resource idle p2 – resource busy p3 – user t1 – task starts t2 – task completes

17 Enabling condition Transition t2 is enabled at M0 because M0 Pre(.,t2). An enabled transition may fire (event happens) removing one token from each input place and depositing one token in each of its output place.

18 Firing

19 Firing It holds: M=M0+ C u Introducing the firing vector

20 Modelling by Petri nets: main structures Concurrency (or Parallelism)
Sequence Concurrency (or Parallelism)

21 Modelling by Petri nets: main structures Choice (non determinism)

22 Modelling by Petri nets: main structures
Synchronization

23 Modelling by Petri nets: main structures
Limited Resources

24 Modelling by Petri nets
Producer/consumer

25 Modelling by Petri nets Transmitter/receiver process

26 Modelling by Petri nets: main structures Mutual exclusion or choice

27 Reachability Analysis
A marking M’ is reachable from M if there exists a firing sequence s=t1t2..tn starting from M that results in the new marking M’ Hence: M’=M+Cu where u is the firing vector associated to s. The reachability set of a PN system <PN,M0> is the set of all markings that are reachable from its initial marking

28 Reachability Analysis
A reachability graph is a directed graph whose nodes are the markings in the reachability set, with directed arcs between the markings representing the marking-to-marking transitions The directed arcs are labeled with the corresponding transition whose firing results in a change of the marking from the original marking to the new marking 7ab15e

29 Reachability Analysis
If the reachability set is infinite then the nodes of the reachability graph are infinite in number: it is necessary to build a coverability graph. Several analysis are based on the reachability graph: behavioral analysis. By properly identifying the frontier nodes, the generation of the reachability graph involves a finite number of steps, even if the PN is unbounded. Three type of frontier nodes: terminal (dead) nodes: no transition is enabled; duplicate nodes: already generated; infinitely reproducible nodes.

30 Reachability graph

31 Structural properties
The structural properties are the properties that depend on the structure of the net and on the initial marking. Reachability Bundness Liveness Conservativeness Deadlock Analysis may be based on the rechability graph or on the state equation

32 Main advantage of the Petri net modeling: linear algebraic structure
While the state of a DES is non numerical the state of a Petri net is a vector The model of an machine that may fails:

33 Powerful modeling tools: timed Petri Nets
For performance and dependability analysis it is necessary to introduce the duration of the events associated to PN transitions. Hence Petri nets are extended by associating time with the firing of transitions, resulting in timed Petri nets. Deterministic timed transitions are typically represented by black boxes t1 t2 2 s


Download ppt "Modelling by Petri nets"

Similar presentations


Ads by Google