1 Introduction


A. Törn - Contents - - Previous chapter - Next chapter - - Previous page - Next page

1.3 Modeling with Petri Nets

In Petri-net models activities are called transitions and are represented by boxes (rectangles) and conditions are called places and are represented by circles. There are directed arcs from the input places (pre-conditions) of a transition to the transition, and directed arcs from the transition to its output places (post-conditions).

The state of a place, called its marking, is represented by the presence (condition holds) or absence of a black dot (token) in the circle representing the place. If t is a transition then t denotes the set of input places of t, t the set of output places of t, and t the union of these two sets.

Firing rule: If all t hold (has tokens) then t is said to be enabled and t may then fire (the activity may take place). Firing t means that the tokens in the places t will disappear, and all the places t will obtain tokens.

As an example we model the PREPARE activity of Section 1.2. We obtain:

                           _________
            IDLE (•)<----->|       |
	 	           |PREPARE|---->( ) PREPARED
      UNPREPARED (•)------>|       |
                           ---------
The double arrow from IDLE to PREPARE is short hand for arcs in both directions between IDLE and PREPARE, i.e., IDLE belongs to both t and t.

In the net above he transition PREPARE is enabled. Firing PREPARE gives the net below, a state in which PREPARE is not any more enabled, which is as it should.

                           _________
            IDLE (•)<----->|       |
	 	           |PREPARE|---->(•) PREPARED
      UNPREPARED ( )------>|       |
                           ---------
In a net with several transitions, these will have places in common making up a system with interacting activities.