Using Interval Timed Coloured Petri Nets to Calculate ... - CiteSeerX

0 downloads 0 Views 287KB Size Report
This is the reason we propose an alternative approach based on the Interval ... is the fact that tokens often represent objects or resources in the modelled system. ... The ITCPN model ( 2, 3]) uses a rather new timing mechanism where time is ..... used to calculate performance measures like the average number of tokens in a ...
Using Interval Timed Coloured Petri Nets to Calculate Performance Bounds W.M.P. van der Aalst Eindhoven University of Technology Dept. of Mathematics and Computing Science P.O. Box 513, 5600 MB Eindhoven, The Netherlands e-mail: [email protected]

Abstract.

Nearly all existing techniques in the eld of performance evaluation provide estimates (i.e. average and variation) for performance measures like: response times, throughput times, occupations rates, etc. However, when evaluating the design of a time-critical system, we are particularly interested in accurate bounds for these performance measures. We are concerned with the maximal response time of a controller in a nuclear power plant, the average response time of this controller is of less importance. This is the reason we propose an alternative approach based on the Interval Timed Coloured Petri Net (ITCPN) model. The ITCPN model allows for the modelling of the dynamic behaviour of large and complex systems, without losing the possibility of formal analysis. In addition to the existing analysis techniques for coloured Petri nets, we provide a new analysis method to analyse the temporal behaviour of the net. This method can be used to calculate bounds for all kinds of performance measures. In this paper we will show that this approach can be used to analyse complex time-critical systems.

1 Introduction When designing a system (e.g. a computer system) we are often concerned with two things: (1) correctness and (2) performance. To verify the correctness of the system we have to prove that it performs its intended functions correctly. The performance is often characterised by performance measures like: response times, waiting times, maximum capacity, etc. To evaluate the correctness and performance of a complex system we need powerful analysis methods and tools. In this paper we focus on the analysis of time-critical systems, i.e. real-time systems with `hard' deadlines. These hard (real-time) deadlines have to be met for a safe operation of the system. An acceptable behaviour of the system depends not only on the logical correctness of the results, but also on the time at which the results are produced. Examples of such systems are: real-time computer systems, process controllers, communication systems, exible manufacturing systems and just-in-time manufacturing systems. Note that for these systems correctness and performance issues are tightly coupled. An approach based on Petri nets is used to support the modelling and analysis of these time-critical systems.

Petri nets have been widely used for the modelling and analysis of concurrent systems (Reisig [21]). There are several factors which contribute to their success: the graphical nature, the ability to model parallel and distributed processes in a natural manner, the simplicity of the model and the rm mathematical foundation. Nevertheless, the basic Petri net model is not suitable for the modelling of many processes encountered in logistic, production, communication, exible manufacturing and information processing systems. Petri nets describing real systems tend to be complex and extremely large. Sometimes it is even impossible to model the behaviour of the system accurately. To solve these problems many authors propose extensions of the basic Petri net model. Several authors have extended the basic Petri net model with coloured or typed tokens ([8, 11, 12, 14]). In these models tokens have a value, often referred to as `colour'. There are several reasons for such an extension. One of these reasons is the fact that (uncoloured) Petri nets tend to become too large to handle. Another reason is the fact that tokens often represent objects or resources in the modelled system. As such, these objects may have attributes, which are not easily represented by a simple Petri net token. However, these `coloured' Petri nets allow the modeller to make much more succinct and manageable descriptions, therefore they are often called high-level nets. Other authors have proposed a Petri net model with explicit quantitative time (e.g. [9, 16, 17, 20]). We call these models timed Petri net models. In our opinion, only timed and coloured Petri nets are suitable for the modelling of large and complex real-time systems. There seems to be a consensus of opinion on this matter and several timed coloured Petri net models have been proposed in literature (cf. Van Hee et al. [8, 9], Morasca [18], Jensen and Rozenberg [14]). However, only a few methods have been developed for the analysis of the temporal behaviour of these nets. This is one of the reasons we propose the Interval Timed Coloured Petri Net (ITCPN) model and an analysis method, called MTSRT, based on this model. The ITCPN model ([2, 3]) uses a rather new timing mechanism where time is associated with tokens. This timing concept has been adopted from Van Hee et al. [9]. In the ITCPN model we attach a timestamp to every token. This timestamp indicates the time a token becomes available. Associating time with tokens seems to be the natural choice for high-level Petri nets, since the colour is also associated with tokens. The enabling time of a transition is the maximum timestamp of the tokens to be consumed. Transitions are eager to re (i.e. they re as soon as possible), therefore the transition with the smallest enabling time will re rst. Firing is an atomic action, thereby producing tokens with a timestamp of at least the ring time. The di erence between the ring time and the timestamp of such a produced token is called the ring delay. The ( ring) delay of a produced token is speci ed by an upper and lower bound, i.e. an interval. We have developed an analysis method, called the Modi ed Transition System Reduction Technique (MTSRT), which can be used to analyse ITCPNs (see Van der Aalst [2, 3]). The MTSRT method can be used to calculate bounds for all kinds of performance measures. Nearly all other approaches aiming at performance analysis by means of Petri nets are

based on a stochastic Petri net model. A stochastic Petri net is a timed Petri net with delays described by probability distributions ([7, 15, 16]). Analysis of stochastic Petri nets is possible (in theory), since the reachability graph can be regarded, under certain conditions, as a Markov chain or a semi-Markov process. However, these conditions are quite restrictive: all ring delays have to be sampled from an exponential distribution or the topology of the net has to be of a special form (Ajmone Marsan et al. [15]). Moreover, these Markov chains tend to be extremely large and extensions with colour are impracticable. Since there are no general applicable analysis methods, several authors resorted to using simulation to study the behaviour of the net (see section 3). To avoid these problems, we propose delays described by an interval specifying an upper and lower bound for the duration of the corresponding activity. On the one hand, interval delays allow for the modelling of variable delays, on the other hand, it is not necessary to determine some arti cial delay distribution (as opposed to stochastic delays). Instead, we have to specify bounds. These bounds can be used to verify time constraints. This does not mean that we that we advise against the use of stochastic Petri nets! Moreover, `stochastic analysis' and `interval analysis' can be used in conjunction. In fact, we often use simulation along with the analysis method described in this paper. The main purpose of this paper is to show that the ITCPN model can be used to model and analyse complex time-critical systems. For this purpose we model two non-trivial systems: a computer system (section 4) and a manufacturing system (section 5). Introductions to the ITCPN model and the MTSRT method are given in section 2 and section 3 respectively.

2 Interval Timed Coloured Petri Nets In this section we give an informal introduction to the ITCPN model. The formal de nition is given in appendix A. For the formal semantics of the ITCPN model the reader is referred to [2] or [3]. We use an example to introduce the notion of interval timed coloured Petri nets. Figure 1 shows an ITCPN composed of four places (pin ; pbusy ; pfree and pout ) and two transitions (t1 and t2). At any moment, a place contains zero or more tokens, drawn as black dots. In the ITCPN model, a token has three attributes: a position, a value and a timestamp, i.e. we can use the tuple hhp; vi; xi to denote a token in place p with value v and timestamp x. The value of a token is often referred to as the token colour. Each place has a colour set attached to it which speci es the set of allowed values, i.e. each token residing in place p must have a colour (value) which is a member of the colour set of p. The ITCPN shown in gure 1 represents an abstract computer system, jobs arrive via place pin and leave the system via place pout. The computer is composed of a number of parallel processors. Each processor is represented by a token which is either in place pfree or in place pbusy . The beginning and termination of the execution of a job on a processor are represented by the transitions t1 and t2 respectively. There are three colour sets P = fP 1; P 2; ::g and J = fJ 1; J 2; ::g and P  J . Colour set J (job types) is attached to place pin and place pout , colour set P (processor types) is attached to place pfree . Colour set P  J is attached to place pbusy . Places and transitions are interconnected by arcs. Each arc connects a place and

hhp ; P 1i; 0i w '  p &  hhp ; J 1i; 1i w  [1; 3]  free



free

-

in

pin

t1

-

pbusy

-

t2

$ [0; 0] % [0; 0]  p -

out

Figure 1: An interval timed coloured Petri net a transition in precisely one direction. Transition t1 has two input places (pin and pfree ) and one output place (pbusy ). Transition t2 has one input place (pbusy ) and two output places (pfree and pout ). Places are the passive components, while transitions are the active components. Transitions cause state changes. A transition is called enabled if there are `enough' tokens on each of its input places. In other words, a transition is enabled if all input places contain (at least) the speci ed number of tokens (indicated by the number of interconnecting input arcs). An enabled transition may occur ( re) at time x if all the tokens to be consumed have a timestamp not later than time x. The enabling time of a transition is the maximum timestamp of the tokens to be consumed. Because transitions are eager to re, a transition with the smallest enabling time will re rst. Consider the state shown in gure 1, place pin contains a token with value J 1 and timestamp 1 and place pfree contains a token with value P 1 and timestamp 0. Transition t2 is not enabled because input place pbusy is empty. Transition t1 is enabled and the enabling time of t1 is equal to 1 (the maximum of 1 and 0). Firing a transition means consuming tokens from the input places and producing tokens on the output places. If, at any time, more than one transition is enabled, then any of the several enabled transitions may be `the next' to re. This leads to a non-deterministic choice if several transitions have the same enabling time. Firing is an atomic action, thereby producing tokens with a timestamp of at least the ring time. The di erence between the ring time and the timestamp of such a produced token is called the ring delay. This delay is speci ed by an interval, i.e. only delays between a given upper bound and a given lower bound are allowed. In other words, the delay of a token is `sampled' from the corresponding delay interval. Note that the term `sampled' may be confusing, because the modeller does not specify a probability distribution, merely an upper and lower bound. Moreover, it is possible that the modeller speci es a delay interval which is too wide, because of a lack of detailed information. In this case, the actual delays (in the real system) only range over a part of the delay interval. The number of tokens produced by the ring of a transition may depend upon the values of the consumed tokens. Moreover, the values and delays of the produced tokens may also depend upon the values of the consumed tokens. The relation between the multi-set of consumed tokens and the multi-set of produced tokens is described by the transition function. Function F (t1) speci es transition t1 in the net shown

'   p 1; J 1ii; 3i &hhp ; hP w   [1; 3] p p 

free

-

in

free

-

t1

busy

-

t2

$ [0; 0] % [0; 0]  p -

out

Figure 2: Transition t1 has red in gure 1: dom(F (t1)) = fhpin ; j i + hpfree ; pi j j 2 J and p 2 Pg. For j 2 J and p 2 P , we have:1 F (t1)(hpin ; j i + hpfree ; pi) = hhpbusy ; hp; j ii; [1; 3]i. The domain of F (t1) describes the condition on which transition t1 is enabled, i.e. t1 is enabled if there is (at least) one token in place pin and one token in pfree . This means that transition t1 may occur if there is a job waiting and one of the processors is free. Note that, in this case, the enabling of the transition does not depend upon the values of the tokens consumed. The enabling time of transition t1 depends upon the timestamps of the tokens to be consumed. If t1 occurs, it consumes one token from place pin and one token from pfree and it produces one token for place pbusy . The colour of the produced token is a pair hp; j i, where p represents the processor and j represents the job. The delay of this token is an arbitrary value between 1 and 3, e.g. 2, 2:55 or 4=3. The situation shown in gure 2 is the result of ring t1 in the state shown in gure 1. In this case the delay of the token produced for pbusy was equal to 2. Transition t2 is speci ed as follows: dom(F (t2)) = fhpbusy ; hp; j ii j j 2 J and p 2 Pg. For j 2 J and p 2 P , we have: F (t2)(hpbusy ; hp; j ii) = hhpfree ; pi; [0; 0]i + hhpout ; j i; [0; 0]i. Transition t2 represents the completion of a job. If t2 occurs, it consumes one token from place pbusy and it produces two tokens (one for pfree and one for pout ) both with a delay equal to zero. If t2 occurs in the state shown in gure 2, then the resulting state contains two tokens: hhpout ; J 1i; 3i and hhpfree ; P 1i; 3i.

3 The MTSRT Method In the ITCPN model, a delay is described by an interval rather than a xed value or some delay distribution. On the one hand, interval delays allow for the modelling of variable delays, on the other hand, it is not necessary to determine some arti cial delay distribution (as opposed to stochastic delays). Instead, we have to specify bounds. These bounds are used to specify and to verify time constraints. This is very important when modelling time-critical systems, i.e. real-time systems with `hard' deadlines. These deadlines have to be met for a safe operation of the system. An acceptable behaviour of the system depends not only on the logical correctness 1

Note that hpin ; j i + hpfree ; pi and hhpbusy ; hp; j ii; [1; 3]i are multi-sets, see appendix A.1.

of the results, but also on the time at which the results are produced. Therefore, we are interested in techniques to verify these deadlines and to calculate upper and lower bounds for all sorts of performance criteria. This is the reason we developed the Modi ed Transition System Reduction Technique (MTSRT), which was presented in [2] and [3]. Before giving a short description of this analysis method, we provide a brief survey of existing techniques which can be used to analyse the dynamic behaviour of timed and coloured Petri nets. The techniques may be subdivided into three classes: simulation, reachability analysis and Markovian analysis. Simulation is a technique to analyse a system by conducting controlled experiments. Because simulation does not require dicult mathematical techniques, it is easy to understand for people with a non-technical background. Simulation is also a very powerful analysis technique, since it does not set additional restraints. However, sometimes simulation is expensive in terms of the computer time necessary to obtain reliable results. Another drawback is the fact that (in general) it is not possible to use simulation to prove that the system has the desired set of properties. Recent developments in computer technology stimulate the use of simulation for the analysis of timed coloured Petri nets. The increased processing power allows for the simulation of large nets. Modern graphical screens are fast and have a high resolution. Therefore, it is possible to visualize a simulation graphically (i.e. animation). Reachability analysis is a technique which constructs a reachability graph, sometimes referred to as reachability tree or occurrence graph (cf. Jensen [11, 13]). Such a reachability graph contains a node for each possible state and an arc for each possible state change. Reachability analysis is a very powerful method in the sense that it can be used to prove all kinds of properties. Another advantage is the fact that it does not set additional restraints. Obviously, the reachability graph needed to prove these properties may, even for small nets, become very large (and often in nite). If we want to inspect the reachability graph by means of a computer, we have to solve this problem. This is the reason several authors developed reduction techniques (Hubner et al. [10] and Valmari [22]). Unfortunately, it is not known how to apply these techniques to timed coloured Petri nets. For timed coloured Petri nets with certain types of stochastic delays it is possible to translate the net into a continuous time Markov chain. This Markov chain can be used to calculate performance measures like the average number of tokens in a place and the average ring rate of a transition. If all the delays are sampled from a negative exponential probability distribution, then it is easy to translate the timed coloured Petri net into a continuous time Markov chain. Several authors attempted to increase the modelling power by allowing other kinds of delays, for example mixed deterministic and negative exponential distributed delays, and phase-distributed delays (see Ajmone Marsan et al. [15]). Nearly all stochastic Petri net models (and related analysis techniques) do not allow for coloured tokens, because the increased modelling power is o set by computational diculties. This is the reason stochastic high-level Petri nets are often used in a simulation context only.

Besides the aforementioned techniques to analyse the behaviour of timed coloured Petri nets, there are several analysis techniques for Petri nets without `colour' or explicit `time'. As an example, we mention the generation of place and transition

s1

 @ ? ?   @  ?  @   ?  @     ? R @

s11

s12 s13

?  ? ?  ?   ?

:::

? ?

s1i : : :

? ?

s121 s122 : : : : : : s1i1 : : :

?A

A A A U A

s1ij : : :

Figure 3: A reachability graph invariants, which may be used to verify properties which are time independent. For more information about the calculation of invariants in a coloured Petri net, see Jensen [11, 13]. The Modi ed Transition System Reduction Technique is a technique which generates the reduced reachability graph to answer all kinds of questions. If we try to construct the reachability graph of an ITCPN in a straightforward manner we get into problems. The basic idea of a reachability graph is to organize all reachable markings in a graph, where each node represents a state and each arc represents an event transforming one state into another state. Consider for example the reachability graph shown in gure 3. Suppose that s1 is the initial state of the ITCPN we want to consider. This state is connected to a number of states s11; s12; s13; :: reachable from s1 by the ring of some transition, i.e. s1 ?! s1i. These states are called the `successors' (or children) of the s1. Repeating this process produces the graphical representation of the reachability graph, see gure 3. Such a reachability graph contains all relevant information about the dynamic behaviour of the system. If we are able to generate this graph, we can answer many questions about the behaviour of the system. However, for an ITCPN this graph is generally in nite! This is mainly caused by the fact that we use interval timing. Consider an enabled transition. In general, there is an in nite number of allowed ring delays, all resulting in a di erent state. If a transition produces a token for a place with a delay x speci ed by the delay interval [1; 3], then every delay x between 1 and 3 is allowed. Moreover, each x leads to a di erent state. Since one ring already results in a `fan-out' of reachable states, the reachability graph cannot be used to analyse the system. To avoid this fan-out problem, we propose a reduction which aggregates states into state classes. Informally speaking, state classes are de ned as the union of similar states having the same token distribution (marking) but di erent timestamps (within certain bounds). A state s of an ITCPN is a multi-set of tuples hhp; vi; xi. Each tuple hhp; vi; xi corresponds to one token in the net; p is the location of the token (i.e. the place where it resides), v is the value (colour) of the token and x is the timestamp of the token (i.e. the time it becomes available). A state class s is also a multi-set of tuples hhp; vi; [y; z]i. Each tuple also corresponds

p1 p2     [0; 3] [2; 5]   @ @ @ R @

t1

p3   [4; 6] 

? ?@ ? @ ? ? @ ? ? R @ ? @ ? @ ? @ ? @ ? R? @

t2

[1; 3]  Figure 4: An example used to illustrate the modi ed ring rule [0; 2] p4

to one token in the net. However, instead of a timestamp each token has a timeinterval. One state class corresponds to a set of states, state class s corresponds to state s if and only if there is a bijection between the tokens in s and s such that hhp; vi; [y; z]i is mapped onto hhp; vi; xi with x 2 [y; z] (i.e. a token residing in the same place, having the same value and a timestamp which is within the time-interval [y; z]). We can think of these state classes as some kind of equivalence classes. Since tokens bear time-interval instead of timestamps, we have to modify the the ring rules given in section 2. A transition is still enabled if there are enough tokens on each of its input places. However, the enabling time of a transition t is given by an interval! The lower bound of this interval is the minimal enabling time and upper bound of this interval is the maximal enabling time of t. These bounds are calculated by taking the maximum of the upper and lower bounds of the time-intervals of the tokens to be consumed respectively. We will use an example to clarify the modi ed ring rule. Consider the net shown in gure 4. Initially, there is one token in place p1 with an interval of [0; 3], there is one token in p2 with an interval of [2; 5] and there is one token in p3 with an interval of [4; 6]. Note that this state class s corresponds to an in nite number of states in the original reachability graph, for instance the state with a token in p1 with timestamp 2:4 and a token in p2 with timestamp  and a token in p3 with timestamp 31=6. Both transitions are enabled. If transition t1 res rst, then the tokens in p1 and p2 are consumed, if transition t2 res rst, then the tokens in p2 and p3 are consumed. The enabling time of t1 is between 2 (ETmin (t1)) and 5 (ETmax(t1)), the enabling time of t2 is between 4 (ETmin (t2)) and 6 (ETmax(t2)). The transition with the smallest enabling time will re rst. Since the intervals associated to the enabling times of the transitions (i.e. [2; 5] and [4; 6]) overlap it is not determined whether t1 or t2 res rst. However, the upper bound of the transition time (MTmax(s)) is equal to 5, i.e. a transition will re before or at time 5. If t1 res, it will be between 2 (ETmin(t1)) and 5 (MTmax(s)). If t2 res, it will be between 4 (ETmin(t2)) and 5 (MTmax(s)). In both cases a token is produced for place p4. There are two possible terminal states: one with a token in p3 and p4 and one with a token in p1 and p4. In the rst case the time interval of the token in p4 is [2; 7], because the delay interval of a token produced by t1 is [0; 2]. In the second case the time interval of the token in p4 is [5; 8]. Using intervals rather than

timestamps prevented us from having to consider all possible delays in the intervals [0; 2] and [1; 3], i.e. it suces to consider upper and lower bounds. In Van der Aalst [2, 3] a formal de nition of these alternative semantics are given. If we use these semantics to construct a reachability graph, we obtain the reduced reachability graph which is nite for any practical application (see [2]). The alternative semantics have been introduced for computational reasons only. However, calculating the reduced reachability graph only makes sense if the reduced reachability graph can be used to deduce properties of the original reachability graph which represents the behaviour of the ITCPN. Therefore, we have to prove that there exists some relationship between the original reachability graph and the reduced reachability graph. Fortunately, the alternative semantics are `sound' which means that any state reachable in the original reachability graph is also reachable in the reduced reachability graph. A formal proof is given in [2] and [3]. In these references it is also shown that the opposite is not true, i.e. the alternative semantics are not `complete'. Despite the non-completeness, the soundness property allows us to answer various questions. We can prove that a system has a desired set of properties by proving it for the modi ed transition system. For example, we can often use the reduced reachability graph to prove boundedness, absence of traps and siphons (deadlocks), etc. The reduced reachability graph may also be used to analyse the performance of the system modelled by an ITCPN. With performance we mean characteristics, such as: response times, occupation rates, transfer rates, throughput times, failure rates, etc. The MTSRT method can be used to calculate bounds for these performance measures. Although these bounds are sound (i.e. safe) they do not have to be as tight as possible, because of possible dependencies between tokens (non-completeness). However, experimentation shows that the calculated bounds are often of great value and far from trivial. Moreover, we are able to answer questions which cannot be answered by simulation or the method proposed by Berthomieu et al. [6]. We have modelled and analysed many examples using the approach presented in this paper, see Van der Aalst [1, 2] and Odijk [19]. To facilitate the analysis of real-life systems we have developed an analysis tool, called IAT ([2]). This tool also supports more traditional kinds of analysis such as the generation of place and transition invariants. IAT is part of the software package ExSpect (see ASPT [5], Van Hee et al. [9] and Van der Aalst [2, 4]).

4 Case A: A Simple Computer System In the remainder, we discuss two applications of the approach just presented. This section describes a model of a simple computer system. This system is composed of multiple CPU's and a number of disks. Each job which is processed by this computer system visits one CPU and one disk. Initially there are three parallel processors (CPU's) and three disks. Each processor has a service time between 50 and 60 milliseconds. The I/O service time of disk 1 is between 95 and 100 milliseconds. Disk 2 has a service time between 100 and 115 milliseconds and disk 3 has a service time between 95 and 110 milliseconds. For each job some memory has to be allocated. To swap a job into memory some time is required (between 20 and 25 ms.). Jobs that are `swapped in' are called `active'. Active jobs visit a CPU and a disk, then they are

Figure 5: An ITCPN modelling a simple computer system `swapped out' to allow other jobs to be swapped in. The time required to release the memory (swap-out time) is between 40 and 45 ms. The maximum number of active jobs is 10. Figure 5 shows an ITCPN which models this system. Jobs enter the system via place p1 and leave the system via place p5. Transitions swap in and swap out take care of the memory management. Initially there are 10 tokens in place memory. (The maximumnumber of active jobs is 10.) The three disks are modelled by the transitions disk1, disk2 and disk3. Initially place idle contains 3 tokens, each representing one processor. Transition start represents the beginning of the execution of a job on a processor. Note that transition start is enabled if an active job is waiting in place p2 and one of the processors is free (i.e. there is a token in idle). Transition stop represents the termination of the execution of a job on a processor, i.e. stop releases the processor and sends the job to one of the three disks. The delay intervals are constructed in a straightforward manner on the basis of the information just given. The MTSRT method allows us to calculate bounds for all kinds of performance measures, e.g. throughput times, waiting times, occupations rates, average number of active processes, etc. Figure 6 shows the relation between the load (i.e. the number of jobs arriving each second) and the average throughput times in milliseconds. (We assume batch arrivals.) The dashed line gives an upper bound for the average throughput time given a speci c load. The solid line gives a lower bound for the average throughput time. If the load is 20 jobs per second, then the average throughput time is between 327.5 and 394.5 ms. Recall that all results are obtained by inspecting the reduced reachability graph. To calculate bounds for the average throughput time given a load of 20 jobs per second we need to construct a reduced reachability graph with 2304 states. This takes about 20 seconds on a SUN/SPARC-station (ELC). Further analysis shows that the three CPU's are the main bottle-neck. To speed up this system we investigated two alternatives: (1) adding processors and memory and (2) replacing the processors by faster ones. In the rst alternative we have added two processors (i.e. there are 5 identical processors) and the maximum number

=’lower_bound(3_serv.,max_10_proc.)’ =’upper_bound(3_serv.,max_10_proc.)’

762ms 740 720 700 680 660 640 620 600 580 560 540 520 500 480 460 440 420 400 380 360 340 320 300 280 260 240 220 200 180 160 140 120 100 80 60 40 20 0 5

10

15

20

25

30

35

40

x1 45 jobs/sec.

Figure 6: The relation between the load and the average throughput times of active jobs is equal to 15 instead of 10. (Analysis shows that just adding extra processors is not sucient, because in this case the memory management becomes a bottle-neck.) In the second alternative there are still three processors, however they are twice as fast. These processors have service times between 25 and 30 milliseconds. It is easy to modify the ITCPN for each of the two alternatives. In gure 7 these two alternatives are compared with the original situation. The lines :::::: and : : : : correspond to the bounds for the throughput times of alternative (1) and the lines and : correspond to the bounds for the throughput times of alternative (2). If the load is 20 jobs per second, then the average throughput time is between 253.75 and 306.25 ms for alternative (1) and between 360.0 and 313.5 ms for alternative (2). Clearly, both alternatives give a signi cant speed-up. For low occupation rates (a load below +/- 15 jobs per sec.) alternative (2) is better. However, for higher loads alternative (1) is preferable. It is also possible to verify all kinds of properties. The MTSRT can be used to prove boundedness, reachability, etc. This may be very useful. For example, we can decide to add a surplus of processors (e.g. 50) to the original system. In this case, place busy is still 10-bounded. This means that it makes no sense to have more than 10 CPU's without extending the memory.

=’lower_bound(3_serv.,max_10_proc.)’ =’upper_bound(3_serv.,max_10_proc.)’ =’lower_bound(3_f_serv.,max_10_proc.)’ =’upper_bound(3_f_serv.,max_10_proc.)’ =’lower_bound(5_serv.,max_15_proc.)’ =’upper_bound(5_serv.,max_15_proc.)’

762ms 740 720 700 680 660 640 620 600 580 560 540 520 500 480 460 440 420 400 380 360 340 320 300 280 260 240 220 200 180 160 140 120 100 80 60 40 20 0 5

10

15

20

25

30

35

40

x1 45 jobs/sec.

Figure 7: The two alternatives compared with the original situation

5 Case B: A Manufacturing System The ITCPN model and related techniques have been used in many other applications areas, in particular logistics ([2]). Note that a just-in-time production system is also an example of a time-critical system. In this section we model and analyse a manufacturing system. This manufacturing system is divided into ve units, see gure 8. The manufacturing system receives raw materials and transforms them into end-products. The raw materials are divided over two production units. Each production unit transforms raw materials into intermediate products. These intermediate

production unit (I)

-

-

assembly unit

divider production unit (II)

-

-

packing unit

-

-

Figure 8: A manufacturing system

  I      E  F  B    A   @  I ? @ ? @ ? 6

6

  J      G   H      C D   ? ?

@  I ? @ @

6

6

Figure 9: The bill of materials of end-products I and J products are assembled into end-products by the assembly unit. The packing unit prepares these products for shipment. In this particular case, there are two kinds of end-products I and J . To manufacture I , we need two kinds of raw material: A and B. A is transformed into E , B is transformed into F and E and F are assembled into I . J has a similar production process. The bill of materials of these two end-products is shown in gure 9. We model this manufacturing process in terms of an ITCPN. This ITCPN has an `input' place p1 to receive raw materials and an `output' place p18 which contains endproducts ready to be shipped. These two places are the only places having interactions with the environment of the manufacturing system, see gure 10. Tokens in these places represent products (or materials) and have a value which describes, the kind of product it represents, the identi cation of the product and some status information. Therefore, the value of such a token is a three tuple hpt; id; stati

 p1  -

manufacturing system

 p18 

-

Figure 10: The interactions of the manufacturing system with the environment

       

               

       

p2 - - p6 - - p10 @  ?t6 I c1 t2@  @

   * p3   -

  p1

 



H H t1A HH j p4 A A A A A A AU p5

@  ? @ ? c2

? - - p7

t3

@ I -

t7

@

                  c5 

@ ? @ I @ ? R? @ @ - p14 - p11 @ I @ @ t10 ? ? I @ ? t12 @@ R @  ? @ ? p16 @  o ? @ ? ? ? I  ? ? @ ? @ - p12? R? @ ? - p15 @ ? -?

- - p8 t8 I c3 ? t4@ t11 ? I @ ? @ ? t13 @  @ c6 ? ? ? @ ?  ? c4 ? ? I @ - - p9 - - p13?

t5

t9

c7

? ? I t14@

@



@ I @ p18

? t15 ?

p17

Figure 11: The ITCPN where pt 2 f`A'; `B'; `C '; `D'; `E '; ::g, id 2 IN and stat is a string value. The ITCPN describing the entire manufacturing system is shown in gure 11. Note that this gure does not contain information on colour sets and transition functions. In this paper we will not a supply a detailed description of the net. Instead we will give a sketch of each of the subsystems. (A more detailed description of this case is given in [2]). The divider works as follows: it takes raw materials from place p1 and distributes them over the two production units. Moreover, the divider di erentiates between the four kinds of raw material. Figure 11 shows the divider which is modelled by a transition t1 dividing the raw material over four places p2, p3, p4 and p5. Transition t1 res if there is some raw material available, material of kind A goes to place p2, material of kind B goes to place p4, material of kind C goes to place p3 and material of kind D goes to place p5. Note that we assume that distributing these goods takes no time. The rst production unit transforms products of type A into E and products of type C into G . These transformations are performed by one machine alternately working on products of type A and C . This machine needs between 0.35 and 0.37 hours to transform A into E and between 0.78 and 0.81 hours to transform C into G . Figure 12 shows this production unit in terms of an ITCPN. The machine has four states: (i) busy, transforming A into E , (ii) busy, transforming C into G , (iii) free, waiting for product A and (iv) free, waiting for product C . Initially, the machine is in state (iv). In this example tokens in c1 and c2 are colourless and the tokens in the other places (p2; p3; p6; p7; p10 and p11) represent products. The delay of a token produced by t2 is between 0.35 and 0.37, the delay of

   p 2 p 6 p10 t2    c1 t6   c2     p 3 p 7 p11 t3 t7  -

-

@ I

-

?

@ @

? ? -

-

-

? ?

? @

@ I @ -

-

 c5   p14  t12     o p16    p15  t13  c6 

Figure 12: Production unit I

 p10   p 12 t10  p11   t11 p 13

? ? @ ? @ R @ @ ? I ? I @ @ @ ? @ @

@ I @

? ? ? @ ? ? ? ? @ ? R? @ -

@ I @

@ ? I ? @ ? @

@ @ ? @ ? @ ? R @

? ?

 ? ? ? @ -? ?

Figure 13: The assembly unit a token produced by t3 is between 0.78 and 0.81.

The second production unit has a similar structure, instead of one machine there are are two identical machines. This is represented by the initial state, where there is one token in c3 and one token in c4. Both machines are capable of doing two kinds of transformations: B into F and D into H. Transforming B into F takes between 1.58 and 1.61 hours. Transforming D into H takes between 0.18 and 0.20 hours. Initially, one of the machines is ready to transform B into F , the other one is ready to transform D into H. There is one assembly unit. This unit is capable of assembling E and F into I and G and H into J . Products are assembled in order of their arrival, i.e. the assembly unit uses a `First Come First Served' discipline. The assembly unit consists of two dedicated assembly lines, one for end-product I and one for end-product J . Figure 13 shows these two assembly lines. The two assembly lines share a number of operators. Free operators are represented by tokens in the place o. Initially, there are ve operators in the place o. To assemble E and F into I two operators are needed, this takes between 0.5 and 0.6 hours. Transition t10 consumes two tokens from place o and produces one token for place p14. Transition t12 produces two tokens for place

=’EAT_I’

=’LAT_I’

=’EAT_J’

=’LAT_J’

26 hrs 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1

2

3

4

5

6

x1 7 job_no

Figure 14: Upper and lower bounds for the completion time of products I and J

p14 and one token for place p16. To assemble G and H into J three operators are needed, this takes between 1.3 and 1.4 hours. Transitions t11 and t13 represent the beginning and termination of this operation. Note that place p16 may contain two kinds of products: I and J . The subnet composed of the transitions t14 and t15 and the places p16, p17, p18 and c7 represents the packing unit. The packing unit is used to prepare end-products I and J for shipment. To prepare these products, they are packed in wooden crates. Moreover, end-products J have to be tuned. The time needed to prepare a product for shipment depends on the type of product: packing I takes between 0.2 and 0.3 hours, packing and tuning product J takes between 2.3 and 2.5 hours. The packing unit handles the products one by one. Using the MTSRT method we can calculate several performance measures, for example upper and lower bounds for the arrival time of tokens in place p18. Assume that initially there are 32 pieces of raw material available (8 of each kind), i.e. in the initial state s there are 32 tokens in p1, eight with a value x such that 1(x) = `A', .. etc. In gure 14 the upper and lower bounds for the completion times of both kinds of products are given. The eighth end-product of type I leaves the manufacturing system between 9.39 and 25.11 hours after the production started. The completion time of the eighth product of type J is between 21.28 and 25.11 hours. Note that the completion times of products of type I are quite uncertain. Nevertheless, we can prove that the entire production process nishes within 25.11 hours! The reduced reachability graph needed to compute these results contains 21237

states. It takes about 12 minutes to produce these results on a SUN/SPARC-station. Experience shows that the memory required to store the reduced reachability graph is more restrictive than the processing time required to construct and inspect this graph.

6 Conclusion In this paper, we have used ITCPNs to model and analyse two non-trivial cases, a computer system and a manufacturing system. The ITCPN model uses a new timing mechanism where time is associated with tokens and transitions determine a delay speci ed by an interval. Specifying each delay by an interval rather than a deterministic value or stochastic variable is promising, since it is possible to model uncertainty without having to bother about the delay distribution. We have used the MTSRT method to analyse the two cases. This analysis method constructs a reduced reachability graph. In such a graph a node corresponds to a set of (similar) states, instead of a single state. The reduced reachability graph can be used to prove certain properties or to calculate accurate bounds for all kinds of performance measures (e.g. throughput times, waiting times, occupation rates). The application of the ITCPN model and the MTSRT method to the two cases described in this paper shows that the results obtained by using this approach are quite meaningful. Moreover, the bounds calculated for performance measures just mentioned are always valid. Therefore, the proposed approach is extremely useful when evaluating the design of a time-critical system.

References 1. W.M.P. van der Aalst. Modelling and Analysis of Complex Logistic Systems. In H.J. Pels and J.C. Wortmann, editors, Integration in Production Management Systems, volume B-7 of IFIP Transactions, pages 277{292. Elsevier Science Publishers, Amsterdam, 1992. 2. W.M.P. van der Aalst. Timed coloured Petri nets and their application to logistics. PhD thesis, Eindhoven University of Technology, Eindhoven, 1992. 3. W.M.P. van der Aalst. Interval Timed Coloured Petri Nets and their Analysis. In M. Ajmone Marsan, editor, Application and Theory of Petri Nets 1993, volume 691 of Lecture Notes in Computer Science, pages 453{472. Springer-Verlag, New York, 1993. 4. W.M.P. van der Aalst and A.W. Waltmans. Modelling logistic systems with EXSPECT. In H.G. Sol and K.M. van Hee, editors, Dynamic Modelling of Information Systems, pages 269{288. Elsevier Science Publishers, Amsterdam, 1991. 5. ASPT. ExSpect 4.0 User Manual. Eindhoven University of Technology, 1993. 6. B. Berthomieu and M. Diaz. Modelling and veri cation of time dependent systems using Time Petri Nets. IEEE Transactions on Software Engineering, 17(3):259{273, March 1991. 7. G. Florin and S. Natkin. Evaluation based upon Stochastic Petri Nets of the Maximum Throughput of a Full Duplex Protocol. In C. Girault and W. Reisig,

8. 9.

10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22.

editors, Application and theory of Petri nets: selected papers from the rst and the second European workshop, volume 52 of Informatik Fachberichte, pages 280{288, Berlin, 1982. Springer-Verlag, New York. K.M. van Hee. Information System Engineering: a Formal Approach. Cambridge University Press, (to appear) 1994. K.M. van Hee, L.J. Somers, and M. Voorhoeve. Executable speci cations for distributed information systems. In E.D. Falkenberg and P. Lindgreen, editors, Proceedings of the IFIP TC 8 / WG 8.1 Working Conference on Information System Concepts: An In-depth Analysis, pages 139{156, Namur, Belgium, 1989. Elsevier Science Publishers, Amsterdam. P. Hubner, A.M. Jensen, L.O. Jepsen, and K. Jensen. Reachability trees for high level Petri nets. Theoretical Computer Science, 45:261{292, 1986. K. Jensen. Coloured Petri Nets. In W. Brauer, W. Reisig, and G. Rozenberg, editors, Advances in Petri Nets 1986 Part I: Petri Nets, central models and their properties, volume 254 of Lecture Notes in Computer Science, pages 248{299. Springer-Verlag, New York, 1987. K. Jensen. Coloured Petri Nets: A High Level Language for System Design and Analysis. In G. Rozenberg, editor, Advances in Petri Nets 1990, volume 483 of Lecture Notes in Computer Science, pages 342{416. Springer-Verlag, New York, 1990. K. Jensen. Coloured Petri Nets. Basic concepts, analysis methods and practical use. EATCS monographs on Theoretical Computer Science. Springer-Verlag, New York, 1992. K. Jensen and G. Rozenberg, editors. High-level Petri Nets: Theory and Application. Springer-Verlag, New York, 1991. M. Ajmone Marsan, G. Balbo, A. Bobbio, G. Chiola, G. Conte, and A. Cumani. On Petri Nets with Stochastic Timing. In Proceedings of the International Workshop on Timed Petri Nets, pages 80{87, Torino, 1985. IEEE Computer Society Press. M. Ajmone Marsan, G. Balbo, and G. Conte. A Class of Generalised Stochastic Petri Nets for the Performance Evaluation of Multiprocessor Systems. ACM Transactions on Computer Systems, 2(2):93{122, May 1984. P. Merlin. A Study of the Recoverability of Computer Systems. PhD thesis, University of California, Irvine, California, 1974. S. Morasca, M. Pezze, and M. Trubian. Timed High-Level Nets. The Journal of Real-Time Systems, 3:165{189, 1991. M.A. Odijk. ITPN analysis of ExSpect speci cations with respect to production logistics. Master's thesis, Eindhoven University of Technology, Eindhoven, 1991. C. Ramchandani. Performance Evaluation of Asynchronous Concurrent Systems by Timed Petri Nets. PhD thesis, Massachusetts Institute of Technology, Cambridge, 1973. W. Reisig. Petri nets: an introduction. Prentice-Hall, Englewood Cli s, 1985. A. Valmari. Stubborn sets for reduced state space generation. In Proceedings of the 10th International Conference on Applications and Theory of Petri Nets, Bonn, June 1989.

A Formal De nition In this section we de ne interval timed coloured Petri nets in mathematical terms, such as functions, multi-sets and relations. This de nition was presented in [3].

A.1 Multi-sets

A multi-set, like a set, is a collection of elements over the same subset of some universe. However, unlike a set, a multi-set allows multiple occurrences of the same element. Another word for multi-set is bag. Bag theory is a natural extension of set theory (Jensen [12]).

De nition 1 (multi-sets) A multi-set b, over a set A, is a function from A to IN, i.e. b 2 A ! IN.2 If a 2 A then b(a) is the number of occurrences of a in the multi-set b. AMS is the set of all multi-sets over A. The empty multi-set is denoted by ;A (or ;). We often represent a multi-set b 2 AMS by the formal sum:3 b(a) a

X

a2A

Consider for example the set A = fa; b; c; ::g, the multi-sets 3a, a + b + c + d, 1a + 2b + 3c + 4d and ;A are members of AMS .

De nition 2

We now introduce some operations on multi-sets. Most of the set operators can be extended to multi-sets in a rather straightforward way. Suppose A a set, b1; b2 2 AMS and q 2 A:

q 2 b1 i b1(q)  1 b1  b2 i 8a2A b1(a)  b2(a) b1 = b2 i b1  b2 and b2  b1 b1 + b2 = (b1(a) + b2(a)) a a2A b1 ? b 2 = ((b1(a) ? b2(a)) max 0) a a2A #b1 = b1(a)

X X X

a2A

(membership) (inclusion) (equality) (summation) (subtraction) (cardinality of a nite multi-set)

See Jensen [12, 13] for more details.

A.2 De nition of Interval Timed Coloured Petri Nets

The ITCPN model presented in this paper is analogous to the model described in [2]. However, in this paper we give a de nition which is closer to the de nition of Coloured Petri Nets (CPN), see Jensen [11, 12, 13]. 2 3

IN = f0; 1; 2; ::g This notation has been adopted from Jensen [12].

Nearly all timed Petri net models use a continuous time domain, so do we.

De nition 3 TS is the time set, TS = fx 2 IR j x  0g, i.e. the set of all non-negative reals. INT = f[y; z] 2 TS  TS j y  zg, represents the set of all closed intervals. If x 2 TS and [y; z] 2 INT , then x 2 [y; z] i y  x  z. We de ne an interval timed coloured Petri nets as follows:

De nition 4 (ITCPN) An Interval Timed Coloured Petri Net is a ve tuple ITCPN = (; P; T; C; F )

satisfying the following requirements: (i)  is a nite set of types, called colour sets. (ii) P is a nite set of places. (iii) T is a nite set of transitions. (iv) C is a colour function. It is de ned from P into , i.e. C 2 P ! . (v) CT = fhp; vi j p 2 P ^ v 2 C (p)g is the set of all possible coloured tokens. (vi) F is the transition function. It is de ned from T into functions. If t 2 T , then:4 F (t) 2 CTMS 6! (CT  INT )MS

(i)  is a set of types. Each type is a set of colours which may be attached to one of the places. (ii) and (iii) The places and transitions are described by two disjoint sets, i.e. P \ T = ;. (iv) Each place p 2 P has a set of allowed colours attached to it and this means that a token residing in p must have a value v which is an element of this set, i.e. v 2 C (p). (v) CT is the set of all coloured tokens, i.e. all pairs hp; vi where p is the position of the token and v is the value of the token. (vi) The transition function speci es each transition in the ITCPN. For a transition t, F (t) speci es the relation between the multi-set of consumed tokens and the multi-set of produced tokens. The domain of F (t) describes the condition on which transition t is enabled. Note that the produced tokens have a delay speci ed by an interval. In this paper, we require that both the multi-set of consumed tokens and the multi-set of produced tokens contain nitely many elements. Apart from the interval timing and a transition function instead of incidence functions, this de nition resembles the de nition of a CP-matrix (see Jensen [11, 13]). The formal semantics (i.e. a mathematical de nition of the dynamic behaviour) of the ITCPN model are given in [2] and [3]. 4

A 6! B denotes the set of all partial functions from A to B .