Download presentation
Presentation is loading. Please wait.
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 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 p2 t1 p1 p4 t3 p3 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
p1 p4 t1 p2 p3 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.
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. t1 t2 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 t2 Firing is atomic.
7
Example
8
Non-determinism t1 t2 Two transitions fight for the same token: conflict. Even if there are two tokens, there is still a conflict.
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
11
Two traffic lights rg1 red1 yellow1 green1 yr1 gy1 rg2 red2 yellow2
12
Two safe traffic lights
rg1 red1 yellow1 green1 yr1 gy1 rg2 red2 yellow2 green2 yr2 gy2 safe
13
Two safe and fair traffic lights
red1 red2 safe2 yr1 yr2 yellow1 yellow2 rg1 rg2 gy1 gy2 safe1 green1 green2
14
Example: life-cycle of a person
child puberty marriage bachelor married divorce death dead
15
br red black rr bb 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.
16
Some definitions black red bb rr br
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. black red bb rr br
17
7 reachable states, 1 dead state.
black red bb rr br (3,2) (1,3) (3,1) (1,2) (3,0) (1,1) (1,0) rr br bb\br 7 reachable states, 1 dead state.
18
Exercise: your life-cycle
sleeping start stop active die dead How many states are reachable? Is there a dead state?
19
Exercise: readers and writers
begin receive_mail mail_box rest rest type_mail read_mail send_mail ready 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)?
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.
hairdresser ready to begin client waiting free start finish waiting busy ready 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. name: Sally age: 28 hairtype: BL name: Harry age: 28 experience: 2 start waiting finish busy free ready
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 Exercise: c := a+b b := -a a + a - b b c a >=0 | b := Ö a
sqrt b select c if a> 0 then b:= a else c:=a fi 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 1 3 9 D=3 D=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. h1 h2 waiting ready h3 start finish busy free
27
Exercise: remove hierarchy
waiting ready h3 start finish busy free begin pending end begin pending end
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.