Академический Документы
Профессиональный Документы
Культура Документы
Introduction
First introduced by Carl Adam Petri in 1962. A diagrammatic tool to model concurrency and synchronization in distributed systems. Very similar to State Transition Diagrams. Used as a visual communication aid to model the system behavior. Based on graphical representation & strong mathematical foundation.
Introduction
A Petri net is one of several mathematical modelling languages for the description of distributed systems. It is also known as a place/transition net or P/T net. A Petri net is a directed bipartite graph, in which the nodes represent transitions and places. The directed arcs describe which places are pre- and/or post conditions for which transitions occurs. Petri nets offer a graphical notation for stepwise processes that include choice, iteration, and concurrent execution. Unlike these standards, Petri nets have an exact mathematical definition of their execution semantics, with a well-developed mathematical theory for process analysis.
Transitions:
Arcs:
Tokens:
(name)
transition
Tokens
Tokens reside on places. A transition is enabled if there is a token in each of its input places. Although the structure of Petri nets is fixed the tokens may change their position according to firing rules. The movement of the tokens in the Petri net according to firing rules is called token play.
The places from which an arc runs to a transition are called the input places of the transition; the places to which arcs run from a transition are called the output places of the transition. Graphically, places in a Petri net may contain a discrete number of marks called tokens. Any distribution of tokens over the places will represent a configuration of the net called a marking. A transition of a Petri net may fire whenever there are sufficient tokens at the start of all input arcs. When it fires, it consumes these tokens, and places tokens at the end of all output arcs
P1
T1
P2
T2
P3
Synchronization
Transition T1 will be enabled only when there is at least one token at each of its input places.
Merging
Happens when tokens from several places arrive for service at the same transition.
T1
Concurrency
T1 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
Conflict
T1 and T2 are both ready to fire but the firing of any leads to the disabling of the other transitions.
t1
t2
t1
t2
Example
A Petri net is a tuple (P, T, F) with A finite set P of places A finite set T of transitions such that T P = and A flow relation F (P T) (T P) A place p 2 P is an input place of a transition t 2 T if and only if there exists a directed arc from p to t, i.e., if and only if (p, t) 2 F. The set of input places for a transition t is denoted t. A place p is an output place of a transition t if and only if there exists a directed arc from t to p, i.e., if and only if (t, p) 2 F. The set of output places for a transition t is denoted t. p and p denote the sets of transitions that share p as input places and output places, respectively.
Graphical representations of Petri nets can be mapped onto a tuple (P, T, F), and vice versa. For instance, the Petri net shown in Figure 4.27 can be represented by (P, T, F) such that P = {p1, p2, p3, p4, p5, p6, p7}, T = {t1, t2, t3, t4, t5}, F = {(p1, t1), (t1, p2), (p2, t2), (t2, p3), (t2, p4), (p3, t3), (p4, t4), (t3, p5), (t4, p6), (p5, t5), (p6, t5), (t5, p7)}.