- When in a particular marking m more than one timed transition is enabled, one of them is selected probabilistically as follows: * Let E,m C T denote the set of transitions enabled in m
Trang 1Part IV
ISBNs: 0-471-97228-2 (Hardback); 0-470-84192-3 (Electronic)
Trang 2Chapter 14
to the end of the chapter for an overview
modelling
14.1 Definition
Performance of Computer Communication Systems: A Model-Based Approach.
Boudewijn R Haverkort Copyright © 1998 John Wiley & Sons Ltd ISBNs: 0-471-97228-2 (Hardback); 0-470-84192-3 (Electronic)
Trang 3We finally comment on a number of wide-spread model extensions in Section 14.1.3
Transitions can be one of two types: immediate or timed Immediate transitions do not take any time at all to complete, whereas timed transitions require a negative exponential time to fire, after they have become enabled Immediate transitions are normally drawn
as thin bars and used to model system aspects that do not have physical time associated with them, or system aspects that take only very little time when compared to the time consuming activities in a system Timed transitions are depicted as thick bars
Finally, places may contain one or more tokens, depicted as small black circles A distribution of tokens over places is called a marking
Before we elaborate more on the operation of SPNs, let us first define them formally
An SPN is given as:
where P = {P,,Pz, -,P,,} is a set of places (/PI = n,), T = {tl, tz, ., tn,} is a set
of transitions (ITI = nt), Pr : T + JV is a function which associates priorities with transitions, where timed transitions have lowest priority (coded as 0 here) and immediate transitions have higher priorities (1,2, e) I : P x T -+ IV is a function which associates
a multiplicity with each input arc 0 : 7’ x P -+ LTV is a function which associates a multiplicity with each output arc, and H : P x 7’ + LV is a function which associates a multiplicity with each inhibitor arc W : T + R+ is a function which associates with every transition t, either (i) a firing rate W(t) w h enever t is a timed transition (Pr(t) = 0), or (ii) a weight W(t) w h enever t is an immediate transition (Pr(t) > 0) Finally, m E J’V”p is the initial marking, that is, the initial distribution of tokens over the np places; we assume that m is finite Based on this definition, we can define the following sets:
the input places of transition = {p E PlI(p,t) > 0);
Trang 414.1 Definition 307
l the output places of transition t: O,(t) = {p E PlO(t,p) > 0);
l the inhibiting places of transition t: HP(t) = {p E PIH(p, t) > 0)
We will use these sets in the description of the dynamic properties of SPNs below
l When there are immediate transitions enabled in marking 772, this marking is said to
- The set Ei(m) & T of enabled transitions of highest priority is determined Let
W be the sum of the weights of the transition in I&(m), i.e., W = &EE,(E) IV(t)
- Transition t is selected to fire with probability IV(t)/IV
- Upon firing, transition t removes I(p, t) tokens from input place p E Ip(t) (for
firing of transition t in marking m yields a new marking m’ Firing is an atomic action, it either takes place completely, or not at all
l When there are no immediate transitions enabled, the marking m is said to be tan-
- An enabled transition t fires after an exponentially distributed time with rate W(t)*
- Upon firing, a transition t removes I(p, t) tokens from input place p E Ip(t) and adds O(t,p) tokens to output place p E O,(t) Thus, the firing of transition t in marking m yields a new marking m’
- When in a particular marking m more than one timed transition is enabled, one
of them is selected probabilistically as follows:
* Let E,(m) C T denote the set of transitions enabled in marking 773
Trang 5Figure 14.1: SPN model of simultaneous resource possessing
* All the enabled transitions t E Et (2) take a sample from their correspond- ing exponential distribution with rate IV(t) The transition with the mini- mum sample time fires first, and a new marking arises according to the token flow along the input and output arcs of that transition Alternatively, one can define W = &Et(El IV(t) as the total outgoing rate of marking m
after that delay, transition t will fire (without further timing delay) with probability VV(t)/VV Th is interpretation is equivalent to the former one by the memoryless property of the negative exponential distribution
Consider two computer system users A and B that want to make use of a single, scarce resource such as a printer, every once in a while The behaviour of both users can be described by an infinite repetition of the following activities: do normal work-acquire
Figure 14.1 Formally, we have:
Trang 6{Pa, Pb, WoPa, WoPb, PrA, PrB, Printer}
{Wa, Wb, AcqA, AcqB, RelA, RelB};
((4 O), (m, O), (AcqA, I>, (AcqB, I>, @elk 01, (Redo));
{(Pa, Wa, l), (Pb,Wb, l), (WoPa, AcqA, l), (WoPb, AcqB, l), (Printer, AcqA, l), (Printer, AcqB, l), (PrA, RelA, l), (PrB, RelB, I)};
{(Wa, WoPa, l), (Wb, WoPb, l), (AcqA, PrA, l), (AcqB, PrB, l), (RelA, Pa, l),
(RelB, Pb, l), (RelA, Printer, 1), (RelB, Printer, I)};
(1, LO, 070, 071);
0;
An informal description of the above SPN is as follows There are two users, represented
by the tokens in places Pa and Pb They do an amount of work, represented by the timed transitions Wa and Wb respectively After that, they try to acquire access to the single printer (represented by the single token in place Printer) via the immediate transitions AcqA and AcqB respectively, while remaining in the places (“in state”) WoPa and WoPb (Wait
on Printer) Note that when one of the users already has access to the printer, the other user is “blocked” since its corresponding acquire-transition cannot fire due to the fact that the place Printer is already empty After acquiring access to the printer, the printer is used for some time and released afterwards via the transitions RelA and RelB By the firing
of these transitions, the printer becomes available again for other users, and the user who
Reconsider the SPN of Figure 14.1 and assume that the initial number of tokens in places
Pa and Pb is much larger We can then interpret this model as a two-class model, where customers of class A (and B) arrive at the system in their own buffers, and which require exclusive service from the system (the printer) with durations specified by the transitions RelA and RelB If both WoPa and WoPb contain tokens, the next customer taken into service
is chosen probabilistically, using the weights of the transitions AcqA and AcqB
We can adapt this model to address the case where class A customers have non- preemptive priority over class B customers, by simply adding an inhibitor arc from WoPa
to Acqb; as long as there are class A customers waiting, no work on a class B customer may be started Alternatively, we can set the priority of transition AcqA higher than that
Trang 7Figure 14.2: SPN representation of the MIM1215110 queue
Consider an SPN representation of the MIMl215/10 q ueue as depicted in Figure 14.2 The waiting room is represented by place Pl Idle servers are represented by tokens in place P3 and busy servers are represented by tokens in place P2 Place P4 models the outside world; it is the finite source and sink of tokens Notice that a token in place P2 signifies
the waiting room Pl) Once the waiting room is fully occupied, place P5 is empty, so that
no more arrivals are allowed since Tl is disabled In order to exactly describe the multi- server behaviour, the marking of place ~2 should determine the rate at which customers are served by the timed transition T3: its rate should be proportional to the number of customers in service, i.e., the number of tokens in place P2; we come back to these so-called marking-dependent firing rates below Notice that the movement of customers waiting for service in place Pl to the service area (place P2), via the immediate transition T2 does not
It is important to note that the employed terminology of SPNs is very general It is left open
to the user what places, transitions, etc., represent in reality In most of the SPN models
we interpret tokens as customers or packets and places as buffers or queues; however, they are actually more than that Their interpretation depends on the place they are in As an example of this, in Figure 14.1, a token in place Pa or WoPa indeed represents a customer
On the other hand, the token in place Printer represents a resource Moreover, a token
in place PrA represents a customer using a particular resource Similarly, SPN transitions model system activities such as packet transmissions or the processing of jobs However, a single transition ,might consume two (or more) tokens at the same time from different places
Trang 814.1 Definition 311
and “transform” them into a single token for yet another place (as AcqA does) On the other hand, a single token taken from a single place by a transition may be transformed to multiple tokens put in multiple places (as RelA does) The complex of enabling possibilities
by the input and output arcs then represents the rules for using resources, the involved protocols, etc In the literature, SPNs have also been used to model completely different dynamic phenomena, such as the flow of traffic through cities and paperwork through offices, but also chemical systems where the transitions model partial chemical reactions and the tokens molecules
14.1.3 SPN extensions
Over the years many enhancements and extensions to the definition
published Below, we discuss a number of widely-used extensions
of SPNs have been
the case The weights, represented by the function W : 7’ + R+, can be made marking dependent Denoting with M the set of possible markings, i.e., M c JV”p, the function W becomes: W : T x A4 -+ R+ Using marking dependent weights often results in models that are easier to understand and more compact Graphically, the symbol “#” is placed near a transition with a marking dependent rate; a separate specification of this dependence then needs to be given As an example using this notation, in Figure 14.2, the rate of T3 should equal #P2 ,x
l On top of the normal firing rules, the use of enabling functions (or guards) has become more widespread An enabling function E : 2 x M -+ (0, 1) specifies for every transition t E T in marking m E M whether it is enabled (1) or not (0) Given
a particular marking, the choice of which transition will fire first is based on the normal firing rules; however, for the transitions having passed this first selection, the enabling functions are evaluated Only if these also evaluate to 1 are the transitions said to be enabled The use of enabling functions eases the specification of SPNs, especially when complex enabling conditions have to be expressed A disadvantage of the use of enabling functions is that part of the net semantics is no longer graphically visible
tiplicities We then have to specify functions I : P x 7’ x AL! + JV (and similar extensions for output and inhibitor arcs) that specify the multiplicity of an arc, de-
Trang 9an input arc I(p, t, m) equals the actual number of tokens in p Firing of t then empties place p (given O(t,p, m) = 0) Marking dependent arc multiplicities should
be used with great care; although they often help in keeping the SPN models simple, they also might obscure the semantics of the model Arcs with marking dependent multiplicity are often marked with a “zig-zag” as follows: +
Reconsider the SPN of Figure 14.1 and again assume that the initial number of tokens in places Pa and Pb is larger than 1 Instead of giving absolute priority to class A (over B)
we can also increase the probability of a class A (or B) customer to be taken into service if there are more of them waiting (in comparison to those waiting of the other class) We can
do so by making the weights of AcqA and AcqB proportional to the number of customers of that class waiting
If the printer server is extended to include a second printer, we can simply add an extra (initial) token to place Printer However, to correctly model the cases where the two printers are handling jobs of either class A or B, we should double the rate of the transitions RelA and RelB in those cases This can be accomplished by making the rate
of these transitions proportional to the number of tokens in their input places; if there is only one token there, the normal print rate is employed, but if there are two tokens in that place, both printers are active for that class, hence, the effective rate is twice the original
14.2 Structural properties
Given an SPN as defined in Section 14.1, we can check a number of properties directly from its structure, i.e., its places, transitions, and arcs, which can be used to verify whether the model actually models what it should (the system) as well as to find bounds on the size of the underlying CTMC For the time being, assume that we do not need to make
a distinction between timed and immediate transitions to determine the properties listed below
Given a marking m, we say that marking m’ is immediately reachable from na, if z’ can
be obtained by the firing of an enabled transition t in marking m; we write m t\ m’
A marking m’ is reachable from marking m, if M’ is immediately reachable from m, or
if a” is immediately reachable from VZ, and m’ is reachable from m”; we write m -+ m’
Trang 1014.2 Structural properties 313
Given the initial marking mo, the set of all possible markings that are reachable from
m is called the reachability set R(mo); notice that R(mo) c IN”p The graph (R(mo), E)
in which all possible markings are the vertices (nodes) and in which an edge labelled t exists between two vertices m and m’ whenever m t\ m’, is called the reachability gruph
A marking m from which no other marking m’ is reachable is called a dead marking
In terms of the SPN, this means that after a marking m is reached, no transition can fire any more Such markings therefore generally point to deadlock or absorption situations (either in the system being modelled or in the model)
An SPN is said to be k-bounded when in all m E R(mo) the number of tokens per place
is at most k In the special case of 1-boundedness, we speak of a safe SPN A k-bounded Petri net, possibly with inhibitor and multiple arcs, is always finite and can
represented as a finite state machine with at most (Ic + l)“p states
therefore be
An SPN is said to be strictly conservative if the sum of the number of tokens in all places is the same for all markings This implies that for each transition the number of input and output arcs, measured by their multiplicity, must be equal A Petri net is said
to be conservative if the number of tokens in all places, weighted by a per-place weighting factor is the same in all markings A place invariant then is a vector of weighting factors such that for that vector, the Petri net is conservative; note that some of the weighting factors may be zero!
When using SPNs to represent real systems (in which the tokens represent physical resources) the notion of conservation is important Since physical resources are normally constant in number, the corresponding SPN will have to exhibit conservation properties
We can compute place invariants in t$he following way We define cp,+ = O(t, p) - I(p, t) as the effect that the firing of transition t has on the marking of place p (it takes I(p, t) tokens from p, but adds another 0( t, p) to p), The matrix C = ( c~,~) specifies in each column how the firing of a certain transition affects all the places Define the column vector f E JV”“ -
It can then be proven that for all m E R(mo), we can write:
where the vector f denotes how often every transition in T has been fired, starting from -
so to reach 772 Multiplying this equation with a row vector 2 gives us a m = g mo, for all m E R(mo), provided VC = 0 Since we know m,, the product g m can readily be computed Thus, once we have computed vectors g # Q such that VC = Q, we know the value of the product g m for any reachable marking a This gives us a means to decide whether a certain marking can be reached or not We call a vector 2 # Q such that VC = Q
Trang 11a place invariant Sometimes place invariants are called S-invariants, where the “S” stands for “Stellen”, the German word for place
We readdress the queueing model we have seen before The matrix C can easily be obtained from Figure 14.2 as:
Computing VC = Q leads to the following equations:
i z11 -2’1 -v2 - + + w4 v2 213 - + - 215 213 214 = + = 0, v5 0, = 0,
from which we can conclude the following place invariants: (u4 + 215, v3 + ~4, w3, v4, Q) Notice that these place invariants are not determined uniquely! Assuming values for 7~3 , v4 and w5, we come to the following place invariants: ii = (O,l, l,O,O), i2 = (l,l,O, 1,0) and & = (1, 0, 0, 0,l) Multiplying these invariants with the initial marking mo, we find that:
P2 + P3 = 2, Pl + P2 + P4 = 10, and Pl + P5 = 5, where we have (informally) used the place identifiers to indicate the number of tokens in the places The first place invariant states that the number of servers active and passive always sums up to 2, as it should The second place invariant states that the number of customers buffered, served, or outside of the system, equals 10 The last place invariant states that the number of used and unused buffer places must equal 5 All reachable markings m should obey these invariants; hence, a marking like (1, 1, 1, 0,4) cannot be
Trang 1214.2 Structural properties 315
the Petri net is said to be live Liveness is a property which is closely related to liveness
in computer or communication systems When a system model is live, the corresponding system is deadlock free A live Petri net cannot contain dead markings
A transition invariant is a series of transitions that, when starting from marking m, after the successive firing of these transitions, will yield marking m again Using f as - defined before, f is a transition invariant if -
m=m+Cf
Hence, to find transition invariants, we have to find those f # 0 such that Cf = 0 If -
an SPN is bounded and live, all of its transitions should be part of at least one transition invariant (all transitions should be covered by transition invariants)
The transition invariants for the simultaneous resource possessing example are easy to compute from Cf = 0 with
From Cf = Q we immediately find that f = (1, l,l) - Th is means that after having fired
We finally comment on the applicability of the structural properties for timed Petri nets Originally, these properties have been defined for non-timed Petri nets, However,