Presentation on theme: "1 Modeling based on Petri-nets. Lecture 8. 2 High-level Petri nets The classical Petri net was invented by Carl Adam Petri in 1962. A lot of research."— Presentation transcript:
1 Modeling based on Petri-nets. Lecture 8
2 High-level Petri nets The classical Petri net was invented by Carl Adam Petri in A lot of research has been conducted (> publications). Until 1985 it was mainly used by theoreticians. Since the 80-ties the practical use is increasing because of the introduction of high-level Petri nets and the availability of many tools. High-level Petri nets are Petri nets extended with –color (for the modeling of attributes) –time (for performance analysis) –hierarchy (for the structuring of models, DFD's)
3 The classical Petri net model A Petri net is a network composed of places ( ) and transitions ( ). t2 p1 p2 p3 p4 t3 t1 Connections are directed and between a place and a transition. Tokens ( ) are the dynamic objects. The state of a Petri net is determined by the distribution of tokens over the places.
4 Transition t1 has three input places (p1, p2 and p3) and two output places (p3 and p4). Place p3 is both an input and an output place of t1. p1 p2 p3 p4 t1
5 Enabling condition Transitions are the active components and places and tokens are passive. A transition is enabled if each of the input places contains tokens. t1t2 Transition t1 is not enabled, transition t2 is enabled.
6 Firing An enabled transition may fire. Firing corresponds to consuming tokens from the input places and producing tokens for the output places. t2 Firing is atomic.
8 Non-determinism Two transitions fight for the same token: conflict. Even if there are two tokens, there is still a conflict. t1 t2
9 Modeling States of a process are modeled by tokens in places and state transitions leading from one state to another are modeled by transitions. Tokens represent objects (humans, goods, machines), information, conditions or states of objects. Places represent buffers, channels, geographical locations, conditions or states. Transitions represent events, transformations or transportations.
10 Example: traffic light rg red yellow green yr gy
14 Example: life-cycle of a person bachelor child married puberty marriage divorce deathdead
15 The number of arcs between two objects specifies the number of tokens to be produced/consumed. This can be used to model (dis)assembly processes. blackred bbrr br
16 current state The configuration of tokens over the places. reachable state A state reachable form the current state by firing a sequence of enabled transitions. dead state A state where no transition is enabled. Some definitions blackred bbrr br
18 Exercise: your life-cycle How many states are reachable? Is there a dead state? dead sleeping active startstop die
19 Exercise: readers and writers How many states are reachable? Are there any dead states? How to model the situation with 2 writers and 3 readers? How to model a "bounded mailbox" (buffer size =4)? rest mail_box receive_mail type_mail ready rest begin send_mail read_mail
20 High-level Petri nets In practice the classical Petri net is not very useful: The Petri net becomes too large and too complex. It takes too much time to model a given situation. It is not possible to handle time and data. Therefore, we use high-level Petri nets, i.e. Petri nets extended with: color time hierarchy
21 To explain the three extensions we use the following example of a hairdresser's saloon. start waiting finish busy free ready client waiting hairdresser ready to begin Note how easy it is to model the situation with multiple hairdressers.
22 The extension with color A token often represents an object having all kinds of attributes. Therefore, each token has a value (color) with refers to specific features of the object modeled by the token. start waiting finish busy free ready name: Harry age: 28 experience: 2 name: Sally age: 28 hairtype: BL
23 Each transition has an (in)formal specification which specifies: the number of tokens to be produced, the values of these tokens, and (optionally) a precondition. The complexity is divided over the network and the values of tokens. This results in a compact, manageable and natural process description.
24 Examples c := a+b a b c + b := -a b-a if a> 0 then b:= a else c:=a fi a b c select a >=0 | b := a bsqrta Exercise: calculate |a+b| using these buiding blocks
25 The extension with time For performance analysis we need to model durations, delays, etc. Therefore, each token has a timestamp and transitions determine the delay of a produced token. start waiting finish busy free ready =3 =0
26 The extension with hierarchy A mechanism to structure complex Petri nets comparable to DFD's. A subnet is a net composed out of places, transitions and subnets. waitingready h1 h2 h3 startfinishbusy free