Graphics Programs Reference
In-Depth Information
at a physical location, or in a logical situation. In our example, all places
but p 5 belong to this category: for example, place p 6 is used to describe
the logical situation “accessing the database for a read”; and place p 7 to
describe “accessing the database for a write”.
Transitions in PN models are in general used to represent either events or
logical choices. In our example, the two transitions t 2 and t 3 form a conflict
that describes the selection of the access type; all other transitions describe
events. Actually, also the choice can be viewed as an event, so that we can
state that the transitions in the model of Fig. 2.1 describe the following
a database access request is generated (transition t 1 );
the access request is for a read (transition t 2 ), or for a write (transition
t 3 ) action;
the database read (transition t 4 ), or write (transition t 5 ) starts;
the database read (transition t 6 ), or write (transition t 7 ) terminates.
Once more, the reader should note the difference between the static nature
of places, that are instrumental for the definition of the PN marking, and
the dynamic nature of transitions, that specify the rules for the change of
Modelling logical conditions — The PN formalism provides ways for
testing the marking of a place p. Different types of tests are possible, such
as >, or =; they can be implemented by carefully combining input and
inhibitor arcs, and by adjusting their associated weights (multiplicities).
If transition t must be enabled only when the number of tokens in p is
> n (we shall write simply M(p) > n), an input arc of weight n + 1 is
su cient; instead, to check if M(p) = n we connect p to t with an input arc
of multiplicity n and an inhibitor arc of weight n + 1 (indeed M(p) = n is
equivalent to M(p) n M(p) < n + 1), as shown in Fig 2.5.
Another useful test consists in checking whether a place contains more than n
tokens, without modifying the token count in the place. The implementation
of the test is tricky. Indeed, avoiding the removal of the n tokens through the
firing of t is not possible, but tokens can be put back into the place with an
output arc, exploiting the fact that firing is an atomic action. The resulting
pair of arcs is usually called a “test arc”. As a further generalization, Fig. 2.6
is an example of a transition that tests if there are n tokens in p 1 , and
produces a new marking with n m less tokens in p 1 , if n m, or m n
more tokens, if m n.
The enabling rule of PN transitions is basically an and rule, and it is very
well suited to express conditions such as “p 1 n and p 2 < n”. Conditions of
Search WWH ::

Custom Search