Petri Nets Laurie Frazier Overview v A Brief
Petri Nets Laurie Frazier
Overview v A Brief History v What is a Petri Net? v An Example of Petri Nets § The Five Chinese Sages Problem v References
A Brief History v Petri Nets has been under development since the 1960’s. v The language was defined by Carl Adam Petri with his Ph. D thesis Kommunikation mit Automaten.
What is a Petri Net? v A Petri Net is a formal graphical and mathematical modeling tool. § As a graphical tool, Petri nets can be used as a visual aid similar to flow charts, block diagrams, and networks. § As a mathematical tool, Petri nets can be used to set up equations and other mathematical models. v They are appropriate for modeling systems with concurrency and resource sharing.
What is a Petri Net? v A Petri Net consists of places, transitions, arcs, and tokens. § Places, denoted by a circle, model conditions or objects. § Places may contain tokens, which represent the value of the condition or object. § Transitions, denoted by a solid bar or rectangle, model activities which change the value of conditions or objects. § Arcs connect a place to a transition and vice versa. § Tokens are markers, indicating the presence or absence of whatever they represent – a condition, a signal, a piece to be machined, etc.
What is a Petri Net? v The marking of a Petri Net is the current state of the modeled system, determined by the number of tokens in each place. v When a transition occurs (or fires), it changes the state of the system. v Transitions are only allowed to fire if they are enabled. § A transition is enabled if all the preconditions for the activity are fulfilled (there must be enough tokens available in the input places). v When the transition fires, it removes tokens from its input places and adds them to its output places. § The number of tokens removed/added depends on the cardinality of each arc. v The interactive firing of transitions in subsequent markings is called a token game.
Example v The Five Chinese Sages Problem § Five Chinese sages are sitting at the circle table and have a dinner. Between of each two sages is only one stick. But for eating each of them needs two sticks in a moment. Obviously, if all sages takes sticks from the left side and are waiting for sticks from right side they all will die through starvation (dead loop).
The Five Chinese Sages Problem v Places P 1. . . P 5 introduce sticks and all sticks are on the table at first moment (each place has a token inside). v Transitions Ti and Ei introduces sages states: Ti−sagei thinks, Ei−sagei eats. v To pass from Mi state to Ei state both sticks (on the left and right sides) must be on the table at one moment. http: //www. Code. Breakers-Journal. com
References v An Introduction to Petri Nets § http: //viking. gmu. edu/http/syst 511/vg 511/App. C. html v Protecting Applications with Petri Nets. § The Code. Breakers-Journal, Vol. 1, No. 1 (2004). http: //www. Code. Breakers-Journal. com
Questions?
- Slides: 10