Strategy testing system
Test before you invest


 

 
  Home Downloads Licensing Contact

 

Introduction to Petri Nets

Petri nets are a method of modeling discrete distributed systems invented by Carl Adam Petri.  They are constructed from four basic elements.

Places that are used to represent a system’s state through occupancy by tokens.  They are input and output points for transitions.  By tradition, circles or ovals are used in Petri diagrams to represent places.   A place may be occupied by one or many tokens at any point in time.  All nets must have a Start place and an End place.

 

Transitions are used to change a system’s state by consuming tokens from its input places and distributing new tokens to its output places.  In Petri diagrams they are represented by squares or rectangles.  Transitions contain triggers that become enabled when all of the transition’s input places become occupied with tokens.  When the trigger becomes enabled the transition can then fire.  The firing event depends on the type of trigger employed.  Automatic, manual and timed are the most common.

 

Arcs connect places and transitions.  They are directional and in diagrams are represented by arrows.  Inward arcs go from a place to a transition and an outward arc goes from a transition to a place.  Arcs may also contain a guard, which is a condition that must be passed before a token can be placed on it or consumed from it.  Arcs include a “weight” property that can be used to determine the number of tokens consumed or produced in a transition or to weight the token values.

 

Tokens infer process states from the places they occupy.  On diagrams they are usually symbolized by a solid circle or by a dot inside of a place’s symbol.  In higher-level Petri models (sometimes called Colored P-Nets) tokens are allow to possess properties.

 

Petri net elements are combined to create unique splits and joins.  These in turn control flow through the network.  Below is shown the five types of combinations.

 

In an AND Split a transition places tokens in all of it’s output places, thus creating parallel process threads .

 

In an AND Join a transition awaits the conclusion of parallel threads before it is enabled (i.e., a token must be in each of its input places).

 

In the OR Split two or more transitions compete for the same token.  The token is taken by the transition that fires first.  All of the competing transitions then become disabled.

 

 

In the OR Join any of two or more transitions can move a token to the same place.

 

Explicit OR Splits generate conditional threads from a single transition.

 

The splits and joins are link together to form the logic of the system being modeled.  Below are some common patterns:

Sequential Routing

Parallel Routing

 

Conditional Routing

   

Iterative Routing

 

Back