Graphics Programs Reference
In-Depth Information
than one are used, the number of tokens required in each input place for
the transition enabling and the number of tokens generated in each output
place by the transition firing are determined by the weight of the arc con-
necting the place and the transition. The firing of a transition is an atomic
operation. Tokens are removed from input places, and deposited into output
places with one indivisible action.
In the simple example PN model given in Fig. 1.1, transition t switch on is
enabled, and it can fire, removing one token from p of f and depositing one
token in p on , so that the new state is such that the “on condition” is true
and the “off condition” is false. In the new state, transition t switch of f is
enabled, and it can fire, restoring the state shown in Fig. 1.1. The simple
PN model in Fig. 1.1 can obviously be interpreted as the PN description of
the behaviour of a switch.
Typically, the firing of a transition describes the result of either a logical
condition becoming true in the system, or the completion of an activity. The
latter interpretation is the reason for associating timing with transitions, as
many authors did in their proposals for the definition of temporal concepts
in PNs.
It should be noted that the PN state transformation is local, in the sense
that it involves only the places connected to a transition by input and/or
output arcs (this will be visible in the forthcoming examples; the PN model
of a switch is so simple that local and global states coincide). This is one
of the key features of PNs, which allows the easy description of distributed
systems.
In order to familiarize the reader with the PN notation, with some elemen-
tary PN concepts, and before giving a formal definition of PNs (in the next
chapter), we now illustrate a few simple examples of PN descriptions of some
typical behaviours of distributed systems.
1.1
Shared Resources
Suppose it is necessary to describe the orderly access to a shared resource.
This may result, for example, because a CPU must address a memory loca-
tion, or a part must be worked by a machine, or a packet must be processed
by a protocol. We can consider the individual states of the resource and of
its user separately. The resource can be in either an idle or a busy condi-
tion, and it obviously alternates between these two states. We can describe
the behaviour of the resource with the PN in Fig. 1.2( b), where two places
describe the two possible resource conditions (p idle and p busy ), and two tran-
sitions (t start and t end ) describe the two events that modify such resource
condition, from idle to busy, and from busy back to idle. One token is
present in the PN, and we can assume that it is initially in place p idle .
The user can be in one of three possible conditions: active (doing something
 
 
Search WWH ::




Custom Search