Presentation is loading. Please wait.

Presentation is loading. Please wait.

Petri Nets Laurie Frazier.

Similar presentations


Presentation on theme: "Petri Nets Laurie Frazier."— Presentation transcript:

1 Petri Nets Laurie Frazier

2 Overview A Brief History What is a Petri Net? An Example of Petri Nets
The Five Chinese Sages Problem References

3 A Brief History Petri Nets has been under development since the 1960’s. The language was defined by Carl Adam Petri with his PhD thesis Kommunikation mit Automaten. Automata Theory: field of computer science which studies finite state machines, by means of mathematical representations of them

4 What is a Petri Net? 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. They are appropriate for modeling systems with concurrency and resource sharing. Concurrent (Parallel) programming – a computer programming technique that provides for the execution of operations concurrently, either within a single computer, or across a number of systems.

5 What is a Petri Net? 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. Input arcs: start at a place and connect to a transition Output arcs: start at a transition and connect to a place

6 What is a Petri Net? The marking of a Petri Net is the current state of the modeled system, determined by the number of tokens in each place. When a transition occurs (or fires), it changes the state of the system. 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). 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. The interactive firing of transitions in subsequent markings is called a token game.

7 Example 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). Dijkstra offered in the year 1968 one of the most known problems - The Five Chinese Sages Problem.

8 The Five Chinese Sages Problem
Places P1...P 5 introduce sticks and all sticks are on the table at first moment (each place has a token inside). Transitions Ti and Ei introduces sages states: Ti−sagei thinks, Ei−sagei eats. To pass from Mi state to Ei state both sticks (on the left and right sides) must be on the table at one moment.

9 References An Introduction to Petri Nets
Protecting Applications with Petri Nets. The CodeBreakers-Journal, Vol. 1, No. 1 (2004).

10 Questions?


Download ppt "Petri Nets Laurie Frazier."

Similar presentations


Ads by Google