Timed coloured Petri nets and their application to logistics


299 103 3MB

English Pages 274 Year 1992

Report DMCA / Copyright

DOWNLOAD PDF FILE

Recommend Papers

Timed coloured Petri nets and their application to logistics

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
File loading please wait...
Citation preview

Timed oloured Petri nets and their appli ation to logisti s

The study reported in this monograph is sponsored by the TNO Institute for Produ tion and Logisti s (IPL) as part of the TASTE proje t.

TIMED COLOURED PETRI NETS AND THEIR APPLICATION TO LOGISTICS

PROEFSCHRIFT ter verkrijging van de graad van do tor aan de Te hnis he Universiteit Eindhoven, op gezag van de Re tor Magni us, prof. dr. J.H. van Lint, voor een ommissie aangewezen door het College van Dekanen in het openbaar te verdedigen op donderdag 17 september 1992 om 16.00 uur door

Willibrordus Martinus Pan ratius van der Aalst geboren te Eersel

Dit proefs hrift is goedgekeurd door de promotoren prof. dr. J. Wessels en prof. dr. K.M. van Hee

Contents 1 Introdu tion 1.1 Problem statement . . . . . . . . . . . . . . . . . . . 1.2 Petri nets . . . . . . . . . . . . . . . . . . . . . . . . 1.3 Time and olour in Petri nets . . . . . . . . . . . . . 1.3.1 Adding olour . . . . . . . . . . . . . . . . . . 1.3.2 Adding time . . . . . . . . . . . . . . . . . . . 1.4 Analysis of timed oloured Petri nets . . . . . . . . . 1.4.1 Currently used analysis methods . . . . . . . 1.4.2 Analysis methods based on the ITCPN model 1.5 ExSpe t . . . . . . . . . . . . . . . . . . . . . . . . . 1.6 Appli ation to logisti s . . . . . . . . . . . . . . . . . 1.7 Other methods . . . . . . . . . . . . . . . . . . . . . 1.8 Outline of this monograph . . . . . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

1 1 4 6 6 7 10 10 12 16 18 19 22

2 A timed oloured Petri net model 2.1 Introdu tion . . . . . . . . . . . . . . 2.2 Notations . . . . . . . . . . . . . . . 2.3 Transition systems . . . . . . . . . . 2.4 The model . . . . . . . . . . . . . . . 2.4.1 Semanti s of an ITCPN . . . 2.4.2 Alternative ring rules . . . . 2.5 Some further on epts and properties 2.6 Interesting performan e measures . . 2.7 Con lusion . . . . . . . . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

23 23 24 29 34 37 41 47 58 65

3 Analysis of time in nets 3.1 Introdu tion . . . . . . . . . . . . . . . . . . 3.2 Method ATCFN . . . . . . . . . . . . . . . . 3.2.1 Appli ation to proje t engineering . . 3.3 Method MTSRT . . . . . . . . . . . . . . . 3.3.1 The modi ed transition system . . . 3.3.2 Using the modi ed transition system 3.4 Method PNRT . . . . . . . . . . . . . . . . 3.5 Dealing with large olour sets . . . . . . . . 3.5.1 Approa h 1: remove the olour . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

67 67 71 76 79 82 90 97 109 111

i

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

CONTENTS

ii 3.5.2 Approa h 2: 3.6 An example . . . . 3.7 Con lusion . . . . . 3.8 Appendix . . . . .

re ne the net . . . . . . . . . . . . . . . . . . . . . . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

4 Language and tool 4.1 Motivation . . . . . . . . . . . . . . . . . . . . . . 4.2 The language . . . . . . . . . . . . . . . . . . . . 4.2.1 Type de nitions . . . . . . . . . . . . . . . 4.2.2 Fun tion de nitions . . . . . . . . . . . . . 4.2.3 Pro essor de nitions . . . . . . . . . . . . 4.2.4 System de nitions . . . . . . . . . . . . . 4.3 The software pa kage . . . . . . . . . . . . . . . . 4.3.1 The shell . . . . . . . . . . . . . . . . . . . 4.3.2 The design interfa e . . . . . . . . . . . . 4.3.3 The type he ker . . . . . . . . . . . . . . 4.3.4 The interpreter and the runtime interfa e . 4.3.5 The ITPN Analysis Tool . . . . . . . . . . 4.4 Engineering the modelling pro ess . . . . . . . . . 4.5 A library: QNM . . . . . . . . . . . . . . . . . . . 5 Modelling logisti systems 5.1 Introdu tion . . . . . . . . . . . . 5.2 Logisti s . . . . . . . . . . . . . . 5.3 Why Petri nets ? . . . . . . . . . 5.4 Stru turing logisti systems . . . 5.4.1 Typi al logisti a tivities . 5.4.2 Typi al ontrol stru tures 5.5 A logisti library . . . . . . . . . 5.5.1 The type de nitions . . . 5.5.2 The supply system . . . . 5.5.3 The demand system . . . 5.5.4 The produ tion unit . . . 5.5.5 The sto k point . . . . . . 5.5.6 The transport system . . . 5.6 Some guidelines . . . . . . . . . . 5.7 An example . . . . . . . . . . . . 5.7.1 The present situation . . . 5.7.2 Alternatives . . . . . . . . 5.8 Con lusion . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . .

. . . .

116 126 136 141

. . . . . . . . . . . . . .

145 . 145 . 146 . 147 . 148 . 149 . 151 . 157 . 159 . 159 . 161 . 161 . 161 . 165 . 167

. . . . . . . . . . . . . . . . . .

175 . 175 . 176 . 180 . 192 . 199 . 201 . 208 . 210 . 214 . 217 . 219 . 223 . 228 . 233 . 238 . 238 . 244 . 244

6 Con lusions and further resear h

247

Bibliography

251

CONTENTS

iii

Index

262

Samenvatting

262

Curri ulum vitae

264

Chapter 1 Introdu tion 1.1

Problem statement

Re ently, logisti s has be ome an important issue in many organizations. This is a dire t onsequen e of the fa t that modern organizations are required to o er a wide variety of produ ts, in less time and at redu ed pri es. To improve their logisti s fun tion, many organizations have integrated the ontrol of the logisti a tivities su h as produ tion, transportation, storage, a quisition and distribution. This integration ompli ates the management of the logisti pro esses. The omplexity of the ontrol problems en ountered in logisti s urges the ne essity of an integrated framework for the modelling and analysis of logisti systems. This monograph fo uses on the modelling and analysis of omplex logisti systems and outlines solutions based on a timed oloured Petri net model. Although these solutions are useful in the ontext of logisti s, their appli ation is not limited to the logisti domain. Examples of other appli ation domains whi h may bene t from the results presented in this monograph are: exible manufa turing systems, distributed information systems and real-time systems. In fa t most of the results apply to systems whi h are: dynami The systems we are interested in are subje t to hanges. At any moment

the system has a ertain state, at a later time this state may have hanged.

dis rete We restri t ourselves to dis rete systems, i.e. hanges in the system o

ur

dis ontinuously. These hanges only happen at a nite number of time points.

distributed A distributed system is omposed of a number of autonomous subsys-

tems whi h intera t and share resour es in performing a spe i task. These subsystems are often physi ally distributed.

In other words: we onsider distributed systems that hange in a dis rete fashion. We all these systems dis rete dynami systems. 1

2

CHAPTER 1.

INTRODUCTION

We use a Petri net based approa h to the modelling and analysis of these dis rete dynami systems. Petri nets are appropriate for the modelling of distributed systems, sin e they allow for the representation of parallelism and syn hronization. However, the lassi Petri net model is unsuitable for the modelling of systems having large state spa es or a omplex temporal behaviour. Therefore, we have developed a Petri net model extended with time and olour. This model is the foundation of a framework that has been developed to solve problems related to the design and ontrol of

omplex dis rete dynami systems. In this monograph, we fo us on two important aspe ts of this framework:

modelling There are several reasons for modelling a system, e.g. to reate and

evaluate a design of a new system, to ompare alternative designs and to investigate possible improvements in a real system. Model building for es us to organize, evaluate and examine the validity of our thoughts. This way modelling reveals errors and possible improvements. The out ome of any modelling pro ess is a `model'. We distinguish three kinds of models: (1) informal models, (2) mathemati al models and (3) formal spe i ations. An informal model is a verbal and/or graphi al des ription of the system under

onsideration. Su h a model la ks formal semanti s.

Mathemati al models are those in whi h one or more aspe ts of a system are represented by mathemati al entities, like: equations, matri es, relations, Markov hains, graphs, et . These models are often an abstra tion of the real system in whi h simplifying assumptions are required if the model is to be solvable. A formal spe i ation is a pre ise and stru tured des ription of (aspe ts of) a system. Su h a spe i ation is an abstra tion of the real system, expressed in a spe i ation language having a prede ned syntax and semanti s. Unlike most mathemati al models, a formal spe i ation annot be `solved' analyti ally. However, most formal spe i ations are based on a mathemati al model allowing for one or more kinds of analysis. Although analysis is possible by analysing the underlying model, the primary fun tion of a formal spe i ation is to provide a on ise and unambiguous des ription of the system (i.e. a `blueprint'). In this monograph we fo us on spe i ations based on timed oloured Petri nets. A timed oloured Petri net is a mathemati al model whi h is suitable for the modelling of dis rete dynami systems. The development of a good spe i ation of a omplex dis rete dynami system is often time onsuming and requires onsiderable knowledge and experien e. Therefore, there is a need for on epts and tools to fa ilitate the modelling pro ess. Sin e we on entrate on logisti s, we are parti ularly interested in

1.1.

'  & ' &

$ %

PROBLEM STATEMENT

  $ % ' & ' &

dis rete dynami systems

logisti systems

?

modelling

formal spe i ation

HH HjH

timed oloured Petri net

analysis

?

answers and solutions

3

$ % $ %

Figure 1.1: A survey of this monograph

on epts useful for the modelling of omplex logisti systems. Consequently, some of the on epts we have developed apply to logisti systems in parti ular. analysis The out ome of the modelling pro ess is a spe i ation whi h orresponds to a timed oloured Petri net. Analysis of this net may be useful to verify its

orre tness and to make statements about the performan e of the system. It also helps the modeller to understand the behaviour of the system. To analyse the dynami behaviour of a timed oloured Petri net, we need analysis methods. Simulation is a suitable te hnique for the analysis of this type of nets. Although simulation is exible and easy to use, there is an urge for other te hniques whi h exploit the features of Petri nets extended with `time' and ` olour'. Many analysis te hniques developed for lassi Petri nets have been extended for oloured nets. However, these te hniques annot be used to analyse the temporal behaviour of a timed oloured Petri net. Therefore, we have developed a number of powerful analysis methods, three of whi h are presented in this monograph. The purpose of this monograph is summarized in gure 1.1. On the one hand this monograph dis usses on epts and tools to fa ilitate the modelling of logisti

4

CHAPTER 1.

INTRODUCTION

systems, on the other hand it provides methods to analyse timed oloured Petri nets. These results are outlined in this monograph and are based on on epts from Petri net theory, systems analysis and knowledge of logisti s as an appli ation domain. 1.2

Petri nets

The systems we onsider are often very omplex, large, dis rete dynami systems of many intera ting omponents. The omponents of su h a system exhibit on urren y or parallelism, i.e. a tivities of one omponent may o

ur simultaneously with other

omponents. The omponents of the system intera t and sometimes they have to syn hronize, i.e. one omponent waits for the other in order to exe ute an a tivity simultaneously. The Petri net formalism (Petri [102℄, Reisig [111℄) was one of the rst approa hes introdu ed for dealing with on urren y and syn hronization. Histori ally speaking, Petri nets originate from the early work of Carl Adam Petri ([101℄). Petri's work ame to the attention of Holt and others of the Information System Theory Proje t of Applied Data Resear h, In , in the United States. Mu h of the early theory and notation has been developed by this group ([65℄). The work of Petri also ame to the attention of Proje t MAC at the Massa husetts Institute of Te hnology (MIT), resulting in a number of publi ations and reports. Sin e the late-1970's, the use and study of Petri nets has in reased onsiderably. Espe ially Europeans have been very a tive in the eld of Petri nets. Resear h on and the appli ation of Petri nets have be ome widespread a tivities. A review of the history of Petri nets and an extensive bibliography is given by Murata in [93℄. The lassi (or basi ) Petri net is a dire ted bipartite graph with two node types

alled pla es and transitions. The nodes are onne ted via dire ted ar s. Conne tions between two nodes of the same type are not allowed. Pla es are represented by ir les and transitions by bars. Pla es may ontain zero or more tokens, drawn as bla k dots. The number of tokens may hange during the exe ution of the net. A pla e p is alled an input pla e of a transition t if there exists a dire ted ar from p to t. A pla e p is alled an output pla e of a transition t if there exists a dire ted ar from t to p. Ea h transition puts a weight to ea h of its input and output pla es, i.e. ea h ar is labelled with a weight (positive integer). A transition is alled enabled if ea h of its input pla es ontains at least a number of tokens equal to its weight. In other words, a transition is enabled if all input pla es ontain (at least) the spe i ed number of tokens. An enabled transition an re. Firing a transition t means onsuming tokens from the input pla es and produ ing tokens for the output pla es, i.e. t `o

urs'. The number of tokens produ ed for ea h of the output pla es is equal to the weight of the orresponding ar . A state of a Petri net is a distribution of tokens over the pla es. Many authors use the term marking to denote the state of a basi Petri net. A ring sequen e is a sequen e of states s1 ; s2 ; s3 ; ::, su h that any state si is followed by a state si+1 , resulting from the ring of some enabled transition in state si .

1.2.

PETRI NETS

5

For a Petri net whi h models a dis rete dynami system, we are often interested in properties, su h as boundedness, liveness, safety and freedom of deadlo k. Moreover, given an initial state (marking), we are also interested in the rea hability set, i.e. the set of all states visited by some ring sequen e starting in this initial state. To answer these questions, several analysis te hniques have been suggested. Most of the analysis te hniques des ribed in literature, either generate a rea hability graph or involve linear algebrai te hniques. A rea hability graph is a graph representation of the rea hable states and an be used to answer a variety of questions. Several redu tion te hniques have been developed to redu e the size of su h a graph. Linear algebrai te hniques are often used to al ulate invariants. Note that a marking an be represented as a ve tor, and a Petri net an be represented as a set of linear algebrai equations. Invariants are hara teristi solutions of these equations. Therefore, it is possible to ompute them by linear algebrai te hniques. An example of an invariant is a so- alled pla e invariant, this invariant assigns a weight to ea h pla e, su h that the weighted token ount remains onstant during the exe ution of any ring sequen e. For an introdu tion to basi Petri nets and their analysis we refer to Reisig [111℄ and Peterson [100℄. Sin e the beginning of the 1970's the study of Petri nets has developed in two dire tions: pure Petri net theory and applied Petri net theory. The rst line of resear h on entrates on the fundamental theory of Petri nets. People working on this line of resear h are mainly on erned with the development of a rm mathemati al foundation of Petri net theory. Although the results of this kind of resear h are useful, many te hniques and on epts developed in this area are diÆ ult to apply to problems en ountered in pra ti e. The se ond line of resear h is on erned with the appli ation of Petri nets to the modelling and analysis of systems. Typi al appli ation areas are ommuni ation proto ols, omputer systems, distributed systems, produ tion systems and exible manufa turing systems. In applying Petri nets, it is often ne essary to extend the basi Petri net model.1 These extensions do not allow the use of many te hniques developed in the eld of pure Petri net theory. Fortunately, many of these te hniques have been generalized to oloured Petri nets. Both dire tions did not lead to a omprehensive framework of Petri nets, whi h fully utilizes the analysis apabilities and is appli able in pra ti e. Consequently, there is still a great gulf between pure and applied Petri net theory. This monograph des ribes on epts and te hniques whi h are useful for bridging this gulf. 1 Note

that we use the term `Petri net model ' to denote a formal de nition of Petri nets, su h a model is in fa t a meta-model, sin e it is used to des ribe models of systems.

6 1.3

CHAPTER 1.

INTRODUCTION

Time and olour in Petri nets

The basi Petri net model is not suitable for the modelling of many systems en ountered in logisti s, produ tion, ommuni ation, exible manufa turing and information pro essing. Petri nets des ribing real systems tend to be omplex and extremely large. Sometimes, it is even impossible to model the behaviour of the system a

urately. To solve these problems many authors propose extensions of the basi Petri net model. We distinguish two kinds of extensions: (1) extensions to in rease the modelling power and (2) extensions to merely fa ilitate the user in making more su

in t and manageable models. Examples of extensions that do not in rease the power of a Petri net model are multiple ar s and pla es with apa ity onstraints (see Murata [93℄). On the other hand there are extensions, su h as inhibitor ar s (`zero test') and priorities (Peterson [100℄, Pagnoni [97℄), that do in rease the modelling power. When adding these extensions, areful attention must be paid to the tradeo between modelling and analysis apability. That is, the more general the model, the more diÆ ult it is to analyse. The approa h presented in this monograph is based on a timed oloured Petri net model, alled the Interval Timed Coloured Petri Net (ITCPN) model. We start with an informal introdu tion to the ITCPN model by relating it to other timed and/or

oloured Petri net models known in literature. 1.3.1

Adding olour

Many authors have extended the basi Petri net model with oloured or typed tokens ([132℄, [99℄, [46℄, [70℄, [71℄, [53℄). In these models tokens have a value, often referred to as ` olour'. There are several reasons for su h an extension. One of these reasons is the fa t that (un oloured) Petri nets tend to be ome too large to handle. Another reason is the fa t that tokens often represent obje ts or resour es in the modelled system. As su h, these obje ts may have attributes, whi h are not easily represented by a simple Petri net token. These ` oloured' Petri nets allow the modeller to make mu h more su

in t and manageable des riptions, therefore they are alled `high-level' nets. Although Zervos ([132℄) presented a oloured Petri net in 1977, the rst well-known high-level Petri net model, alled Predi ate/Transition (PrT) nets, was presented in 1979 by Genri h and Lautenba h (see [45℄). It turned out that Predi ate/Transition nets presented some te hni al problems when generalizing the invariant methods. To over ome this problem the Coloured Petri Net (CPN) model was de ned in [69℄ by Jensen. For more information about the CPN model and the al ulation of invariants in a high-level net, see Jensen et al. [69℄, [70℄, [71℄ and [72℄. In theory it is also possible to extend a number of other analysis te hniques to high-level nets. As long as the number of olours is nite, a high-level net is equivalent to a (mu h larger) Petri net without olours (`unfolding'). If the number of olours is in nite, then the high-

1.3.

TIME AND COLOUR IN PETRI NETS

7

level net is equivalent to a basi Petri net with in nitely many pla es and transitions. Allowing an in nite number of olours results in a modelling power equivalent to a Turing ma hine for whi h many questions are unde idable (see Peterson [99℄), but on the other hand, Chur h's thesis implies that the Turing ma hine is the most powerful model of omputation (Wood [129℄). Our ITCPN model is a su

essor to the DES model developed by Van Hee, Somers and Voorhoeve ([53℄). Like in the other high-level net models, a olour is atta hed to ea h token. Ea h pla e has a type (a set of olours) and tokens in a pla e have a

olour (value) belonging to the orresponding type. The number of tokens produ ed by the ring of a transition, and their values ( olours), may depend upon the values ( olours) of the tokens onsumed. Instead of using ar ins riptions, like in CPN, we use fun tions to des ribe the relation between the set of onsumed tokens and the set of produ ed tokens. Note that, unlike in CPN, the enabling of a transition does not depend upon the values of the tokens to be onsumed. 1.3.2

Adding time

The formal properties of `Time' have attra ted the attention of many philosophers, physi ists and mathemati ians (Benthem [14℄). Time is an important aspe t of all dis rete dynami systems. There are several ways to deal with this timing aspe t. First, one has to de ide whether time has to be quanti ed. If time is not quanti ed, the model an only be used to reason about qualitative temporal properties, like liveness, mutual ex lusion, deadlo k, fairness, et . We de ide to quantify time, be ause only then, it is also possible to express quantitative temporal properties, like deadlines, a tivity durations, response times, delays, et . If time is quanti ed, one has to de ide whether time is impli it or expli it. In physi s and mathemati s, time has traditionally been represented as just another variable. Consider for example rst order predi ate al ulus, whi h an be used to reason about expressions ontaining a time variable, i.e. apparently there is no ompelling need for expli it time. However, time plays a prominent part in the appli ations we

onsider, for we are interested in dynami systems. Therefore, we de ided to make time expli it (for reasons of onvenien e). This de ision is based on the argument that the aspe t of time is an important fa tor in the systems we want to onsider, and the modelling e ort is redu ed onsiderably by adding expli it time onstru ts. The basi Petri net model is not apable of handling quantitative time. The introdu tion of high-level nets allowed people to quantify time in an impli it manner, i.e. time is represented by the value or olour of a token. In this ase, we have to model a global lo k using a pla e onne ted to every transition. This pla e ontains one token, whose value represents the urrent time. Sin e this is rather umbersome, many authors have proposed a Petri net model with expli it quantitative time (e.g. [133℄, [108℄, [89℄, [82℄, [53℄, [113℄). We all these models Timed Petri Net (TPN) models.

8

CHAPTER 1.

INTRODUCTION

There are a lot of ways to introdu e the on ept of time into the basi Petri net model. In essen e, there are two things one has to de ide on: (1) the lo ation of the time delays and (2) the type of these delays.

The lo ation of the time delays When introdu ing time into the basi Petri net model, we have to assign time durations (delays) to ertain a tivities in the net. The literature on timed Petri nets des ribes many `lo ations' in a Petri net whi h may be used to represent time. Zuberek ([133℄) asso iates a ( xed) delay with the ring time of a transition. When a transition res, the enabling tokens are onsumed and withheld for some time before the tokens appear in the output pla es. Sin e the ring of a transition takes some time, this is alled `two-phase' ring. Sifakis and Wong propose models where time is asso iated with pla es, so that tokens arriving in a pla e are unavailable for a spe i ed period ([114℄, [128℄). Most authors propose a model where time is asso iated with the enabling time of a transition (e.g. [41℄, [92℄, [82℄, [81℄). Ea h transition in su h a timed Petri net must remain enabled for a spe i ed time before it an re. In these models, ring is an atomi a tion, i.e. ring takes no time. Some authors use two timing me hanisms (at di erent lo ations). An example of su h mixture is the model proposed by Razouk and Phelps in [109℄, where time is asso iated with the ring of transitions and the enabling of transitions. We use a rather new timing me hanism where time is asso iated with tokens. This timing on ept has been adopted from Van Hee, Somers and Voorhoeve ([53℄). In our ITCPN model we atta h a timestamp to every token. This timestamp indi ates the time a token be omes available. The enabling time of a transition is the maximum timestamp of the tokens to be onsumed. Transitions are eager to re (i.e. they re as soon as possible), therefore the transition with the smallest enabling time will re rst. If, at any time, more than one transition is enabled, then any of these transitions may be `the next' to re. This leads to a non-deterministi hoi e if several transitions have the same enabling time. Firing is an atomi a tion, thereby produ ing tokens with a timestamp of at least the ring time. The di eren e between the ring time and the timestamp of su h a produ ed token is alled the ring delay. Asso iating time with tokens is the logi al hoi e for high-level Petri nets, sin e the

olour is also asso iated with tokens. We will show that our timing on ept is very expressive and allows for elegant semanti s.

The type of the time delays Besides the lo ation of the delay, we also have to de ide on the type of delay. There are three alternatives: xed delays, sto hasti delays or delays spe i ed by an interval. We also have to de ide whether we use a dis rete or ontinuous time domain. Nearly all TPN models use a ontinuous time domain (IR+ ∪ {0}), so do we.

1.3.

TIME AND COLOUR IN PETRI NETS

9

Petri nets with xed (deterministi ) delays have been proposed in [133℄, [108℄, [113℄ and [53℄. They allow for simple analysis methods but are not very expressive. In real dis rete dynami systems the duration of most a tivities is variable, be ause the duration of an a tivity often depends on external in uen es. Consider for example the time it takes to transport goods from a produ tion unit to the entral warehouse, this transportation time depends on traÆ jams, the weather, the mood of the driver, et . Clearly, a xed delay is inappropriate for the modelling of the duration of su h an a tivity. One way to model this variability, is to assume ertain delay distributions, i.e. to use a timed Petri net model with delays des ribed by probability distributions. These nets are alled sto hasti Petri nets. Many sto hasti Petri net models have been developed, most of them are used for the performan e evaluation of proto ols, manufa turing systems, et . Two widespread models of this type are the SPN model by Florin and Natkin ([41℄) and the GSPN model by Ajmone Marsan et al. ([82℄). In nearly all sto hasti TPN models, time is in transitions and the enabling time of su h a transition is spe i ed by some distribution. The hoi e of su h a delay distribution is often diÆ ult and subje t to errors, thus yielding a rude approximation whi h appears to be exa t. Analysis of sto hasti Petri nets is possible (in theory), sin e the rea hability graph

an be regarded, under ertain onditions, as a Markov hain or a semi-Markov pro ess. However, these onditions are severe: all ring delays have to be sampled from an exponential distribution or the topology of the net has to be of a spe ial form (Ajmone Marsan et al. [81℄). Sin e there are no general appli able analysis methods, several authors resorted to using simulation to study the behaviour of the net. Another problem is the fa t that the delays of two a tivities may be dependent. When modelling these a tivities by separate transitions, the delays are assumed to be independent, this may lead to in orre t results. To avoid these problems, we propose delays des ribed by an interval spe ifying an upper and lower bound for the duration of the orresponding a tivity. On the one hand, interval delays allow for the modelling of variable delays, on the other hand, it is not ne essary to determine some arti ial delay distribution (as opposed to sto hasti delays). Instead, we have to spe ify bounds. These bounds an be used to verify time onstraints. This is very important when modelling time- riti al 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 a

eptable behaviour of the system depends not only on the logi al orre tness of the results, but also on the time at whi h the results are produ ed. Examples of su h systems are: real-time omputer systems, pro ess ontrollers, ommuni ation systems, exible manufa turing systems and just-in-time manufa turing systems.

10

CHAPTER 1.

INTRODUCTION

To our knowledge, only one other model has been presented in literature whi h also uses delays spe i ed by an interval. This model was presented by Merlin in [89℄ and [90℄. In this model the enabling time of a transition is spe i ed by a minimal and a maximal time. Another di eren e with our model is the fa t that Merlin's model is not a high-level Petri net model be ause of the absen e of typed ( oloured) tokens. Compared to our model, Merlin's model has a rather omplex formal semanti s, whi h was presented in [16℄ by Berthomieu and Diaz. This is

aused by a redundant state spa e (marking and enabled transitions are represented separately) and the fa t that they use a relative time s ale and allow for multiple enabledness of transitions. An additional advantage of our approa h is the fa t that our semanti s losely orrespond to our intuitive interpretation of the dynami al behaviour of a timed Petri net. We will motivate these statements in due time. 1.4

Analysis of timed oloured Petri nets

In the previous se tion we established the fa t that Petri nets are appropriate for the modelling of dis rete dynami systems, provided that a Petri net model extended with time and olour is used. Based on this observation, we proposed the ITCPN model. In essen e, the modelling pro ess serves two purposes. First of all, the model is used as a `blueprint' of the system under onsideration, e.g. the design of a new system or a plan whi h des ribes improvements. Se ondly, models are used to analyse ertain aspe ts of a system, e.g. the performan e, eÆ ien y or orre tness of a system. Sin e analysis is often the main goal of model building, we have to supply suitable analysis methods. In this se tion we start with a survey of existing analysis methods for timed and/or

oloured Petri nets to illustrate that none of these methods (entirely) suits our purpose. This has been an in entive to develop new analysis methods. Therefore, the ore of this monograph is dire ted towards the analysis of interval timed oloured Petri nets. 1.4.1

Currently used analysis methods

A lot of analysis te hniques have been developed in the area of pure Petri net theory. Most of them are based on the basi Petri net model. Many of these te hniques have been extended to analyse high-level Petri nets, for example rea hability graphs and invariants. Re all that as long as the number of

olours is nite, a high-level net an be `unfolded' into an equivalent, but mu h larger, Petri net without olours. The unfolding of nets has been studied to see how the analysis methods for high-level nets should work. For the moment, however, it is only possible to use these methods for relatively small systems and for sele ted parts of larger systems. An example of su h a method is the reation of a rea hability graph for high-level nets. Be ause of the explosion of the number of states, these graphs tend to be ome

1.4.

ANALYSIS OF TIMED COLOURED PETRI NETS

11

too large to analyse. Several redu tion te hniques have been proposed to deal with this problem. None of them gives a satisfa tory solution (see Jensen [71℄). Another analysis te hnique available for high-level Petri nets is the generation of pla e and transition invariants. These invariants are used to derive and prove properties of the modelled system. A pla e invariant (P-invariant) is a weighted token sum, i.e. a weight is asso iated with every token in the net. This weight is based on the lo ation (pla e) and the value ( olour) of the token. A pla e invariant holds if the weighted token sum of all tokens remains onstant during the exe ution of the net. Transition invariants (T-invariants) are the duals of pla e invariants and the basi idea behind them is to nd ring sequen es with no e e ts, i.e. ring sequen es whi h reprodu e the initial state. Some analysis te hniques have been developed to al ulate these invariants automati ally (see Jensen [71℄). These te hniques have a number of problems. For large nets with a lot of di erent olours, it is hard to ompute these invariants. Usually there are in nitely many invariants (a linear ombination of invariants is also an invariant), therefore it is diÆ ult to distill the interesting ones. However, there is a more promising way to use invariants. If the user supplies a number of invariants, it is easy to verify these invariants totally automati ally. If an invariant does not hold, it is relatively easy to see how the Petri net (or the invariant) should be modi ed. The latter approa h does not solve the problem that applying invariants requires a lot of training. The addition of time to the basi Petri net model resulted in a lot of new and interesting te hniques to analyse the dynami behaviour of a system. Literature on this subje t re e ts the fa t that the study of timed Petri nets developed along two separate lines. The rst line on entrates on the veri ation of dynami properties. Most of the methods developed along this line are based on nets with deterministi delays. There are several methods to al ulate upper and lower bounds for the y le time of a timed Petri net ([113℄, [108℄, [107℄, [93℄). The y le time is a riterion for the performan e of the system. For a spe i lass of deterministi timed Petri nets, the so- alled Timed Event Graphs, the exa t y le time an be omputed quite eÆ iently, see Ramamoorthy and Ho [107℄ and Chretienne [31℄. Other resear hers analyse deterministi timed Petri nets by building the rea hability graph (Zuberek [133℄). Although this requires a lot of omputing e ort, su h a graph an be used to answer a variety of questions. A serious drawba k of these methods is the fa t that in many real systems the a tivity durations are not xed, i.e. they vary be ause of disturban es and other interferen es. Assuming deterministi delays often results in ina

urate results. The se ond line on entrates on the performan e evaluation of timed Petri nets by means of analysis of the underlying sto hasti pro ess. Instead of assuming deterministi a tivity durations, an attempt is made to apture the essen e of a system by probabilisti assumptions. These probabilisti assumptions often in lude

12

CHAPTER 1.

INTRODUCTION

the distribution of the delays in the net. In nearly all sto hasti TPN models a sto hasti variable is asso iated with every transition. This sto hasti variable expresses the delay from the enabling to the ring of a transition, i.e. the enabling time. For analysis reasons, the distribution of these sto hasti variables is assumed to be negatively exponential. Molloy showed that, due to the memoryless property of the exponential distribution, su h a sto hasti TPN is isomorphi to a ontinuous time Markov hain ([92℄). This allows for analyti al methods to analyse the dynami behaviour of a system, this way it is possible to al ulate performan e measures, e.g. the average waiting time or the probability of having more than ve tokens in a spe i pla e. Several other sto hasti TPN models have been suggested ([82℄, [41℄, [80℄, [128℄, [64℄). Consider for example, the Generalized Sto hasti Petri Net (GSPN) model developed by Ajmone Marsan et al. ([82℄, [81℄, [83℄). A GSPN has two types of transitions: `timed' transitions and `immediate' transitions. A timed transition has an exponentially distributed enabling time, an immediate transition has an enabling time of zero, i.e. an immediate transition res the moment it be omes enabled. Many authors give onditions for the topology of the net or the distribution of the delays su h that analysis of the underlying sto hasti pro ess is possible (e.g. Ajmone Marsan et al. [81℄, [80℄). In general these onditions are quite strong. Moreover, for real problems, the state spa e of the orresponding ontinuous time Markov hain tends to be too large to analyse. To our knowledge, only one analysis method has been presented for Petri nets with interval timing. This method was presented by Berthomieu et al. in [17℄ and [16℄ and uses Merlin's timed Petri nets ([89℄) to des ribe the system. The method generates a rea hability graph where nodes represent state lasses instead of states. This approa h is more or less related to one of the analysis methods presented in this monograph. Only a few analysis methods have been developed for timed and oloured Petri nets, this results from the fa t that there are only a limited number of Petri net models having oloured tokens and some expli it time on ept. In Lin and Marines u [76℄ and Zenie [131℄ sto hasti high-level nets are proposed. A high-level Petri net model with deterministi delays was presented by Van Hee et al. in [53℄. A similar extension of the CPN model was proposed by Jensen in [71℄. Note that a deterministi delay depending upon the olour of a token is suÆ ient to approximate any sto hasti delay distribution, sin e oloured tokens allow for the generation of pseudo-random numbers, whi h an be used to sample delays for a spe i distribution, see Shannon [112℄ or [9℄. A straightforward way to analyse the dynami behaviour of su h a net is simulation. 1.4.2

Analysis methods based on the ITCPN model

Although Petri net theory is ri h in analysis methods, only a few of the methods are suitable for the analysis of the temporal behaviour of a timed oloured Petri net.

1.4.

ANALYSIS OF TIMED COLOURED PETRI NETS

13

Moreover, the methods used for the analysis of the dynami behaviour of a system represented by a timed oloured Petri net su er from omputational problems. This is one of the reasons, simulation is the most widely used te hnique to analyse nets whi h represent omplex dis rete dynami systems. The ITCPN model deviates from existing models, be ause delays are spe i ed by an interval rather than deterministi or sto hasti delays. If we hoose a distribution for ea h delay interval (e.g. a uniform or beta distribution), then we are able to simulate an ITCPN. Although simulation is a very powerful tool to analyse dis rete dynami systems, it is ertainly not a pana ea for answering all relevant questions. For example, simulation annot be used to prove ertain properties. This is one of the reasons, we have developed four analysis methods: 1. Modi ed Transition System Redu tion Te hnique (MTSRT) 2. Persistent Net Redu tion Te hnique (PNRT) 3. Arrival Times in Con i t Free Nets (ATCFN) 4. Steady State Performan e Analysis Te hnique (SSPAT) As said, these analysis methods are based on the ITCPN model. The MTSRT method an be applied to any kind of ITCPN. This method generates a redu ed rea hability graph. In an ordinary rea hability graph, a node orresponds to a state. To al ulate su h an ordinary rea hability graph, we start with an initial state, say s. For this state s, we obtain `new states'. These are the states rea hable by ring a transition in state s. New states are onne ted to s by a dire ted ar . For ea h new state, say s′ ,

onne ted to s, we obtain the states rea hable by ring a transition in state s′ , et . Repeating this pro ess results in a graph representation of the rea hable states. Even for simple examples these graphs tend to be very large (generally in nite). The MTSRT method proposes a number of redu tions, resulting in a redu ed rea hability graph. In su h a graph a node orresponds to a set of states, alled a state lass, instead of a single state. To generate a graph representation of these state lasses, we use a modi ed model, where a time-interval is asso iated with a token rather than a timestamp. We already mentioned a more or less related analysis method proposed by Berthomieu, Mena he and Diaz in [17℄ and [16℄. This method is based on Merlin's timed Petri net model. Their analysis method also uses state lasses, whi h are represented by a system of inequalities. Our MTSRT method uses a totally di erent approa h to analyse a Petri net with interval timing and is able to answer other types of questions. We will ompare their method with our MTSRT method in due time. The other methods an only be applied to a restri ted set of interval timed oloured Petri nets.

14

CHAPTER 1.

INTRODUCTION

The PNRT method and the SSPAT method an be applied to ITCPNs whose underlying net stru ture is a marked graph, i.e. the number of input ar s and output ar s of every pla e is smaller than or equal to 1. The PNRT method uses the spe ial stru ture of su h a net to reate an even further redu ed rea hability graph. The SSPAT method al ulates upper and lower bounds for the y le time of a net. This is a generalization of the te hnique des ribed by Ramamoorthy and Ho in [107℄. The ATCFN method an be applied to on i t free nets, i.e. nets where the number of output ar s of every pla e is smaller than or equal to 1. This method produ es upper and lower bounds for the arrival time of the rst token in a pla e using a polynomial-time algorithm. The analysis methods MTSRT, ATCFN and PNRT are outlined (in detail) in this thesis. For a des ription of the SSPAT method, see Van der Aalst [2℄. For omplex pra ti al problems, the MTSRT method is most appropriate, be ause it

an be applied to arbitrary interval timed oloured Petri nets. The onditions made by the other methods are often too restri tive. Furthermore, the MTSRT method is the only method able to answer questions involving the olour of tokens. The PNRT, ATCFN and the SSPAT abstra t from the token olours. However, there are appli ation areas where these limitations are not restri tive. For example: the ATCFN method an be used to analyse proje t plans, and the PNRT method an be used for produ tion planning with repetitive s hedules. A onsequen e of the exibility of the MTSRT method, is the omputational effort required to analyse a omplex system. For pra ti al problems, the `redu ed' rea hability graph generated by the MTSRT method, tends to be ome too large to analyse. In most ases this is aused by a large and omplex net stru ture and/or a large number of possible token olours. To deal with large olour sets, we propose te hniques to translate an ITCPN into an ITCPN with only one kind of tokens, i.e. the ardinality of ea h olour set equals 1. Su h an ITCPN is alled an Interval Timed Petri Net (ITPN). One an think of an ITPN as a spe i kind of ITCPN with only one olour. Our aim, however, is to analyse interval timed oloured Petri nets. Therefore, we investigated suitable pro edures for the translation of an ITCPN into an ITPN. There are two other reasons for having the desire to translate an ITCPN into an ITPN. First of all, ITCPNs with only one kind of tokens allow for several stru tural analysis te hniques developed for un oloured nets (see Murata [93℄). Another reason is the fa t that, at the moment, our analysis software only supports the analysis of un oloured ITCPNs. Sin e we are able to (automati ally) translate an ITCPN into an ITPN, we an analyse ITCPNs indire tly, We distinguish three ways to translate an ITCPN into an ITPN:

unfold The rst way is to translate the ITCPN into an equivalent ITPN is to use

a onstru tion similar to the one presented in Peterson [99℄ and Genri h [44℄.

1.4.

ANALYSIS OF TIMED COLOURED PETRI NETS

15

Su h a onstru tion, often referred to as `unfolding', is only possible if the number of olours is nite. The onstru tion maps ea h pla e (transition) in the ITCPN into a set of pla es (transitions) in the onstru ted ITPN. If there are many di erent olours, the size of the onstru ted ITPN be omes very large. Therefore, this approa h annot be applied to large pra ti al examples.

un olour Another way to redu e the ITCPN into an ITPN is to dis ard the olours,

to a ertain extent. Ea h pla e in the ITCPN orresponds to exa tly one pla e in the ITPN. If a transition in the ITCPN always produ es the same number of tokens for every output pla e, then this transition also orresponds to exa tly one transition in the ITPN. The lower bound (upper bound) of the delay of a token produ ed by a transition for a spe i output pla e in the ITPN,

orresponds to the smallest (largest) lower bound (upper bound) of all possible delays assigned to this pla e by the transition in the ITCPN. If the number of tokens produ ed by a transition in the ITCPN depends on the values of the onsumed tokens, then this transition orresponds to a set of transitions in the ITPN. In pra ti e the ardinality of this set is small. Therefore, this

onstru tion produ es an ITPN of about the same size. Consider for example, a transition t with two output pla es o1 and o2 . Assume that: if t res, it produ es one token, either for pla e o1 or for pla e o2 (depending upon the values of the onsumed tokens). In the orresponding un oloured net t is repla ed by two transitions t1 and t2 . Both transitions onsume tokens from the input pla es of t. Transition t1 produ es a token for pla e o1 and transition t2 produ es a token for pla e o2 . Clearly some information is lost during this onstru tion. However, it is still possible to derive useful properties for the ITCPN. For instan e, if the ITPN is K-bounded (deadlo k free), then the ITCPN is also K-bounded (deadlo k free), and upper and lower bounds for the y le time of the ITPN are also valid upper and lower bounds for the ITCPN. Often it is possible to prove ertain properties for an ITCPN by analysing the orresponding ITPN, for example, it is possible to prove that ertain deadlines are met.

re ne The third way to use an ITPN to analyse an ITCPN is a mixture of the

previous two. This hybrid approa h works in two steps, rst, for ea h pla e, the set of possible olours is partitioned into a number of olours sets, then the net is unfolded into an ITPN. A pla e in the ITCPN is mapped into a set of pla es, the ardinality of this set depends on the partitioning. In other words: rst, we transform the ITCPN into an ITCPN with less olours and more pla es, then we remove the olours. Consider for example an ITCPN with tokens representing ma hine jobs. The servi e time of a job depends on the olour of the token, i.e. its attributes. A job an have a large number of attributes, like weight, size, operations required, et . In this ase it is possible to partition the set of possible jobs into two meaningful lasses: `small' jobs and `large' jobs. Based on this partitioning it is possible to derive upper and lower bounds for the servi e time of small

16

CHAPTER 1.

INTRODUCTION

(large) jobs. When unfolding the ITCPN into an ITPN, ea h pla e ontaining jobs is mapped into two pla es, one for small jobs and one for large jobs. The transitions onne ted to these pla es are also dupli ated. This way it is possible to derive tight bounds for the behaviour of the ITCPN without having an `explosion' in the size of the net. Preferably, this approa h is supported by a tool in an intera tive way. This monograph des ribes the last two approa hes. These approa hes are attra tive, be ause they an be applied to large oloured and timed Petri nets, as opposed to nearly all other analysis methods. Note that this is a dire t onsequen e of the fa t that we use interval delays rather than deterministi or sto hasti delays. 1.5

ExSpe t

The pra ti al use of the ITCPN model and related analysis methods highly depends upon the availability of adequate omputer tools. To fa ilitate the reation, storage and adaptation of these models, we use a spe i ation language to represent these models. We already mentioned that a formal spe i ation is a pre ise and stru tured des ription of a system, expressed in a language having a syntax and semanti s. We use the Petri net based spe i ation language ExSpe t ([53℄, [55℄, [52℄, [56℄, [51℄, [57℄, [8℄, [7℄). This language has been developed at Eindhoven University of Te hnology, and is supported by a software pa kage also alled ExSpe t (see Somers et al. [54℄, [9℄). We use ExSpe t for the formal spe i ation of a restri ted lass of interval timed

oloured Petri nets. There is a straightforward relation between this spe i ation language and the ITCPN model. In fa t, the semanti s of ExSpe t are given in terms of a timed oloured Petri net model (see Van Hee et al. [53℄). The language ExSpe t onsists of two parts: a fun tional part and a dynami part. The fun tional part is used to de ne types and fun tions needed to des ribe the operations on the value of a token. The type system onsists of some primitive types and a few type onstru tors to de ne new types. A `sugared lambda al ulus' is used to de ne new fun tions from a set of primitive fun tions. ExSpe t is a `strongly typed' language sin e it allows all type he king to be done stati ally. A strong point of the language is the on ept of type variables: it provides the possibility of polymorphi fun tions. The dynami part of ExSpe t is used to spe ify a network of transitions and pla es, and therefore, the intera tion stru ture of a system. The behaviour of a transition, i.e. the number of tokens produ ed and their values, is des ribed by fun tions. The language also has a hierar hi al onstru t alled system. A system is a subnet, i.e. an aggregate of pla es and transitions and (perhaps) subsystems. The system on ept supports both top-down and bottom-up design. A system an have a number of parameters. As a result, a system an be ustomized or ne-tuned for a spe i situation. This way it is possible to de ne generi system spe i ations, that are easy to reuse.

1.5.

17

EXSPECT

runtime interfa e

6 ?

'$ '$ &% &%

design  interfa e

type

he ker

interpreter



HHHH Y j sour e * HHjH obje t * les les    

analysis tool (IAT)

- external appl.

Figure 1.2: The toolset ExSpe t

The software pa kage ExSpe t (EXe utable SPECi ation Tool) is a workben h based on the spe i ation language ExSpe t. This workben h is made up of a number of software tools, gure 1.2 shows the set of tools of ExSpe t. These tools are integrated in a shell, from whi h the di erent tools an be started. The design interfa e is a graphi al mouse driven editor, whi h is used to onstru t or to modify an ExSpe t spe i ation. Su h a spe i ation is stored in a sour e le (module). This sour e le is he ked by the type he ker for type orre tness. If the spe i ation is orre t, then the type he ker generates an obje t le, otherwise the errors are reported to the design interfa e. The interpreter uses the obje t le to exe ute a simulation experiment des ribed by the orresponding ExSpe t spe i ation. This interpreter is onne ted to one or more runtime interfa es. These interfa es allow one or more users to intera t with the running simulation. It is also possible to intera t with some external appli ation, for example presentation software. Re ently we added an analysis tool, alled the ITPN Analysis Tool (IAT), to ExSpe t. This tool translates a spe i ation into an ITPN that is analysed using the methods des ribed in this monograph, i.e. the MTSRT, PNRT and ATCFN analysis methods. The tool also allows for more traditional kinds of analysis su h as the generation of P and T-invariants. This way we o er three kinds of analysis: simulation, `stru tural analysis' (invariants) and `interval analysis' (MTSRT, PNRT, ATCFN). This observation reveals an interesting issue: a formal spe i ation an be used as a `blueprint' of the system, whi h allows for various kinds of analysis.

18

CHAPTER 1.

INTRODUCTION

This is very onvenient, sin e it prevents us from having to remodel the system every time we want to use another analysis te hnique. Therefore, we are also interested in supporting other analysis te hniques, e.g. Markovian analysis, queueing networks, linear programming, et . 1.6

Appli ation to logisti s

High-level Petri nets have been used in many appli ation areas: exible manufa turing, omputer ar hite ture, distributed information systems, proto ols, et . In [72℄ there are a number of papers des ribing appli ations of high-level nets. We have used ExSpe t in various appli ation domains, e.g. queueing systems ([3℄) and

exible manufa turing ([7℄). However, our main interest is in the modelling and analysis of logisti systems ([4℄, [5℄, [8℄, [6℄). This interest stems from three reasons: First of all, timed oloured Petri nets are an appropriate way to des ribe logisti pro esses. Note, that a logisti system is omposed of physi ally distributed subsystems with a rather omplex intera tion stru ture, i.e. a typi al example of a dis rete dynami system. Se ondly, re ent developments in the eld of logisti s have ompli ated the management of the logisti pro esses, e.g. the integration of logisti a tivities often results in omplex ontrol problems. Therefore, there is a need for an integrated framework for the modelling and analysis of logisti systems. Thirdly, we parti ipate in a proje t alled TASTE (The Advan ed Studies of Transport in Europe). The goal of this proje t is to develop a tool to enable nonprogrammers to model and analyse strategi problems in the eld of interindustrial logisti s. TASTE uses ExSpe t to model and analyse the ow of goods at an aggregated level in and between, produ tion, assembly, distribution and transport (see [6℄). The TASTE proje t fa ed the fa t that resear h in the eld of logisti s developed along two separate lines. The rst line on entrates on solving mathemati al problems related to logisti s. Investigations in this area are part of a dis ipline alled operations resear h. Often the problem statement is simpli ed to allow for analyti al solutions. This is the reason that many results in this area are not generally appli able and require an expert onsultant. Examples of this line are the appli ation of queueing networks to s heduling problems and the appli ation of linear programming to transport planning. Although these analysis methods help us gain insight in the problem, they an only be applied in rather spe i situations. Moreover, some of the results reported in this area des ribe te hniques for problems that do not even exist in pra ti e. The se ond line of resear h on entrates on pra ti al logisti problems. The results are often qualitative and informal. The approa hes used in this area are mainly dis ipline oriented, i.e. they fo us on a spe i aspe t of logisti s. Examples are the

1.7.

OTHER METHODS

19

resear h on ustomer servi e, storage equipment, ommuni ation fa ilities (EDI), personnel requirements, et . Neither of these lines has lead to an integrated framework to model and analyse logisti systems. This is the reason this monograph outlines on epts and tools to fa ilitate the modelling and analysis of real logisti problems. First, we motivate our hoi e to use timed oloured Petri nets. We will do this by showing that our Petri net model is able to represent typi al logisti a tivities in a very onvenient manner. Se ondly, we present a `systems view of logisti s' to stru ture omplex logisti systems. Based on a taxonomy of the ows in a logisti system, we des ribe a systemati approa h to the modelling of logisti systems. This approa h an be used as a stepping-stone to the development of a omprehensive `referen e model' of logisti s. Su h a referen e model is a representation of an idealized organization, de ning the tasks of the logisti omponents as well as the intera tion between these omponents (see Biemans et al. [19℄, [21℄). Thirdly, based on our `systems view of logisti s' we have developed an ExSpe t library of prede ned system de nitions. These system de nitions are parameterized building blo ks representing typi al logisti a tivities. There are about 20 of these building blo ks in luding a produ tion unit, a distribution entre and a transport system. It is our belief that many pra ti al logisti systems an be modelled using these building blo ks. Modelling in terms of building blo ks is supported by software (ExSpe t) and the modelling pro ess results in a spe i ation that an be analysed using simulation and the analysis methods already mentioned. Our approa h is intentionally abstra t. Therefore, we fo us on the main logisti fun tions (e.g. transport, demand, supply, produ tion and sto k holding) and ignore aspe ts, like administration, safety, personnel, et . Moreover, sometimes we also abstra t from the physi al reality, i.e. we are not interested in the a tual layout of a logisti system, me hani al aspe ts, ommuni ation proto ols, et . 1.7

Other methods

We use a Petri net based approa h, this is only one of the many approa hes whi h have been developed to model and analyse dis rete dynami systems. We distinguish three main dire tions: • simulation te hniques • diagramming te hniques • formal te hniques

Simulation is one of the most powerful te hniques to analyse a omplex system. Advantages of simulation are: easy to use, exible, availability of tools. Another important advantage of simulation is that it helps the analyst to understand and

20

CHAPTER 1.

INTRODUCTION

to gain a feel for the system. In a way, simulation is similar to the debugging of a program, in the sense that it an reveal errors of a (simulation) model. In pra ti e, however, simulation is never suÆ ient to prove the orre tness of the system. There are two kinds of simulation tools: simulation languages and spe i simulation pa kages. Simulation languages, su h as SIMULA (Dahl and Nygaard [33℄) and SIMAN (Pidd [103℄), are exible but la k suÆ ient support of the modelling pro ess, e.g. a graphi al editor, analysis tools, et . Simulation pa kages are often appli ation spe i . Examples in the eld of manufa turing are SIMFACTORY and TAYLOR ([103℄). These pa kages are easy to use and support animation. The fa t that they are tailored towards a spe i appli ation makes them in exible. Note that, although ExSpe t is a spe i ation language, it an be used as a simulation language whi h an be tailored towards a spe i domain by reating reusable systems, i.e. it is possible to use libraries of user-de ned building blo ks. The appli ation of these building blo ks is quite easy, be ause they an be used in a ompletely graphi al manner. There are several frameworks based on diagramming te hniques. These frameworks use a graphi al language to des ribe data ow, ontrol ow, et . The graphi al nature of these frameworks makes them easy to use. Examples are SADT (Mar a and M Gowan [79℄), ISAC (Lundeberg et al. [78℄) and DFD (Ward and Mellor [121℄). Most of these frameworks in orporate te hniques to des ribe the data stru ture, for example the entity-relationship model (Chen [29℄). The result of using su h an approa h is an informal des ription, that does not allow for quantitative analysis. Another drawba k of these te hniques is that they la k a on ept to quantify time whi h makes it very diÆ ult to model real-time onstraints.

Formal methods to model (spe ify) and to analyse dis rete dynami systems are, at this point, mainly under development in the a ademi world. Some of these methods are slowly gaining industrial a

eptan e. We distinguish 6 dire tions: • queueing networks • nite state ma hines • model oriented spe i ations • pro ess algebras • temporal logi • Petri nets

We will review these formal methods, without laiming to give a omplete survey. A queueing network (Ajmone Marsan et al. [83℄) is a system of inter onne ted queues in whi h ustomers ir ulate, arrive or leave. Queueing networks have be ome quite popular in the eld of performan e evaluation. The main reason for this

1.7.

OTHER METHODS

21

popularity is due to the produ t form solution, that holds for a restri ted lass of queueing networks (see Baskett et al. [13℄). This restri ted lass allows for the analyti al solution of all sorts of performan e measures. Nevertheless, several pra ti ally important features, like syn hronization, blo king and the splitting of

ustomers an usually not be modelled in su h a way that the model still has the produ t form solution (see Ajmone Marsan et al. [83℄). For non-produ t form queueing networks there are approximative methods of analysis available, but these are not generally appli able and require an expert onsultant. Therefore, for a more detailed analysis of queueing networks, simulation is pra ti ally unavoidable. The nite state ma hine is a restri tion to the lassi al model of theoreti al omputer s ien e (Hop roft and Ullman [66℄). A nite state ma hine an be modelled using is a state transition diagram (Davis [34℄). At any moment the ma hine is in a

ertain state. In response to an input the ma hine generates an output and hanges state. State harts (Harel [48℄) represents a generalized formalism based on nite state ma hines. In state harts, the normal state transition diagram is enhan ed with hierar hi al and ompositional features. Although a supporting tool, alled `statemate', has been developed, this method annot be used to model large real-time systems be ause of the absen e of fa ilities to model data stru tures and quantitative time.

VDM (Jones [73℄) and Z (Spivey [116℄) are model oriented spe i ation languages. These methods have been found useful for the spe i ation of large ommer ial systems, but are weak in their ability to deal with on urren y and real-time. Furthermore, these languages do not allow for quantitative analysis, the emphasis is on spe i ation rather than analysis. Pro ess algebras, su h as CSP (Hoare [63℄), CCS (Milner [91℄) and ACP (Bergstra and Klop [15℄), are well suited for the modelling of parallel and on urrent behaviour. They are however poor in their apabilities to spe ify data stru tures and operations. There are several algebrai spe i ation languages based on one of these pro ess algebras, e.g. LOTOS (Brinksma [27℄, [26℄) and PSF (Mauw and Veltink [86℄). These languages have onstru ts to handle data stru tures, modularization and parameterization. Moreover, several pro ess algebras have been extended with timing onstraints, for example timed-CSP (Reed and Ros oe [110℄), CCSR (Gerber and Lee [47℄), ACP (Baeten and Bergstra [12℄) and Timed LOTOS (Bolognesi et al. [23℄). Temporal logi (Pnueli [104℄) is a bran h of modal logi . Generally, a number of temporal operators are introdu ed, for example 2 (hen eforth) and 3 (eventually). Various types of semanti s an be given to the temporal operators depending on whether time is linear or bran hing, time is quanti ed, time is impli it or expli it, time is lo al or global, et . A temporal logi is alled a real-time temporal logi if time is quanti ed.

22

CHAPTER 1.

INTRODUCTION

Metri Temporal Logi (Koymans [75℄) is a real-time temporal logi with an impli it time onstru t. For example, the formula A → 3≤3 B means that: if A o

urs, then eventually within 3 time units B must o

ur. Real-Time Temporal Logi (Ostro [95℄) has an expli it time ( lo k) variable t. The previous formula an be expressed as follows: (A ∧ t = T ) → 3(B ∧ t ≤ T + 3). An overview of existing frameworks in temporal logi is given by Ostro in [96℄. Temporal logi is suitable for des ribing (temporal) properties of a system. Disadvantages are the fa t that temporal logi is diÆ ult to learn and spe i ations based on temporal logi are hard to read. The low level nature of these spe i ations makes it diÆ ult to model large and omplex systems. Additional drawba ks are the absen e of data modelling apabilities and limited analysis methods. A promising approa h is the ombination of temporal logi and other frameworks (e.g. Petri nets). Su h an approa h was presented by Ostro in [95℄, where Extended State Ma hines are used to model the system and Real-Time Temporal Logi is used to spe ify the required behaviour of the system. In this monograph we present an approa h based on a timed oloured Petri net model. The Petri net on ept meets the requirements set out by the distributed nature of a logisti system. The addition of olour and time, enables the modelling of data stru tures and a omplex temporal behaviour. A major advantage ompared to other methods mentioned in this se tion, is the availability of various kinds of analysis, e.g. simulation, `stru tural analysis' (invariants) and `interval analysis' (MTSRT, PNRT, ATCFN). From this point of view, this monograph provides an integrated approa h whi h ombines a number of existing formalisms. 1.8

Outline of this monograph

The remainder of this monograph onsists of ve hapters. In Chapter 2 we de ne the ITCPN model. The semanti s of this model is given in terms of a transition system. To do this, we introdu e some basi notations and

on epts. We also dis uss some interesting properties of this model. Chapter 3 des ribes three of the four analysis methods we have developed to analyse interval timed oloured Petri nets. These methods are ompared with existing analysis methods. We also show how these methods an be used to analyse interval timed oloured Petri nets with large olour sets. We use an example to illustrate our approa h. In hapter 4 we dis uss the language ExSpe t and des ribe the tools that have been developed to support this language. The author parti ipated in the development of the design interfa e and the analysis tool of ExSpe t. As an example of an ExSpe t module, we present the QNM library (see Van der Aalst [3℄). This library ontains building blo ks, whi h an be used to model and analyse queueing networks in a graphi al manner. In hapter 5 we stru ture the eld of logisti s and dis uss the appli ation of Petri nets to logisti problems. We also present a library ontaining logisti building

1.8.

OUTLINE OF THIS MONOGRAPH

23

blo ks. Finally, in hapter 6, we dis uss the usefulness of the approa h presented in this monograph.

24

CHAPTER 1.

INTRODUCTION

Chapter 2 A timed oloured Petri net model 2.1

Introdu tion

In this hapter we give a formal de nition of our ITCPN model. This hapter also des ribes some fundamental on epts, su h as behavioural properties and performan e measures. Some of these on epts have been adopted from existing Petri net theory, others have been developed with the rest of this monograph in mind. The

on epts des ribed in this hapter are used throughout this monograph and so they are fundamental to a orre t understanding of our approa h.

p1

        

p2

 R t1

 [0 2℄  ;

 

p3

R 2 t

R

[1; 3℄

p4

Figure 2.1: An interval timed oloured Petri net

In se tion 1.3 we already dis ussed the need for a timed and oloured Petri net model. This is the reason we developed the Interval Timed Coloured Petri Net (ITCPN) model. To illustrate this model we use an example. Figure 2.1 shows an ITCPN whi h

omprises four pla es (p1 , p2 , p3 and p4 ) and two transitions (t1 and t2 ). Transition t1 has two input pla es (p1 and p2 ) and one output pla e (p4 ). Transition t2 also has 25

26

CHAPTER 2.

A TIMED COLOURED PETRI NET MODEL

two input pla es (p2 and p3 ) and one output pla e (p4 ). At any moment, a pla e

ontains zero or more tokens, drawn as bla k dots. In the ITCPN model, a token has four attributes: an identity, a position, a value and a timestamp, i.e. we an use the quartet i; p; v; x to denote a token in pla e p with value v , timestamp x and some identi ation number i. Figure 2.2 shows the ITCPN in a state with one token in p1 , two tokens in p2 and one token in p3 . In this example, the value of any token is a string, e.g. the token ′ ′ . In the state shown in gure 2.2, both transitions t1 in pla e p1 has a value AB and t2 are enabled, be ause ea h of the input pla es of t1 and t2 ontains at least one token. The enabling time of t1 is the maximum timestamp of the tokens to be

onsumed, i.e. 3:0 (the maximum of 3:0 and 2:0). The enabling time of t2 is 4:0 (the maximum of 2:0 and 4:0). Note that tokens on a pla e are onsumed in order of their arrival (i.e. timestamps). Transitions are eager to re, therefore t1 res at time 3:0. ′ ′ ; 3:0 ) and pla e p2 Firing t1 means onsuming a token from pla e p1 (1; p1 ; AB ′ ′ (2; p2 ; C D ; 2:0 ) and produ ing a token for pla e p4 whose value may depend on the values of the tokens onsumed. In this ase the value of the produ ed token is ′ ′ the on atenation of the values of the tokens onsumed (i.e. ABC D ). The delay of this token is between 0 and 2. Figure 2.3 shows a state resulting from the ring of transition t1 in gure 2.2. In this ase the delay of the token equals 1.25, however, any other value between 0 and 2 would have been allowed. The identi ation of the new token is an arbitrary, but unique, number (in this ase 5). In the state shown in gure 2.3 only t2 is enabled. The enabling time of t2 is 5:0 (the maximum of 5:0 and 4:0). Consequently, this transition res at time 5:0. Transition t2 also on atenates two strings, i.e. t2 onsumes a token from pla e p2 (3; p2 ;′E F ′; 5:0 ) and pla e p3 (4; p3 ;′GH ′ ; 4:0 ) and produ es a token for pla e p4 (e.g. 6; p4 ;′E F GH ′; 6:50 ). Note that in this ase the delay of the produ ed token is 1:5. Figure 2.4 shows a state resulting from the ring of transition t2 in gure 2.3. There are no transitions enabled in this state. The above example illustrates the dynami behaviour of an ITCPN. It is, however, nearly impossible to give an informal explanation whi h is omplete and unambiguous. Sin e an informal dis ussion of the meaning of interval timed oloured Petri nets is likely to ause onfusion, we give a formal de nition of the ITCPN model and the orresponding semanti s in se tion 2.4. Be ause our formalisms are based on bag theory and transition systems, we start with some useful notations and a formal de nition of transition systems. 2.2

Notations

IN is the set of natural numbers in luding zero. IR is the set of reals. It is onvenient to adjoin to IR two additional elements, ∞ and −∞ (not belonging to IR) with the order properties −∞ < a < ∞ for any a ∈ IR. We `extend' the addition operator

2.2.

             

NOTATIONS

1; p1 ;′AB ′ ; 3:0 p1

2; p2 ;′C D ′ ; 2:0





p2

 t1

R   [0 2℄  ;

3; p2 ;′E F ′ ; 5:0

• •



p3

4; p3 ;′GH ′ ; 4:0



 R 2 t

[1; 3℄

R

p4

Figure 2.2: An ITCPN,

t1

and t2 are enabled

3; p2 ;′E F ′ ; 5:0

p1



p2

 R t1

 

[0; 2℄



 



R 2

 

R

p4

p3

4; p3 ;′GH ′ ; 4:0

t

[1; 3℄

• 5; p4 ;′ABC D ′ ; 4:25

Figure 2.3: A state resulting from ring transition t1

p1

        

p2

 t1

R   [0 2℄  ;

p3

  R 2 t

 R

p4

[1; 3℄

• 5; p4 ;′ABC D ′ ; 4:25 • 6; p4 ;′E F GH ′ ; 6:50

Figure 2.4: A state resulting from ring transition t2

27

28

CHAPTER 2.

A TIMED COLOURED PETRI NET MODEL

for reals su h that for all a ∈ IR: a + ∞ = ∞ + a = ∞ and ∞ + ∞ = ∞. Similar

onventions hold for −∞. The expressions ∞ − ∞ and −∞ + ∞ are unde ned. The Cartesian produ t of two sets A and B, denoted by A × B, is the set of all ordered pairs a; b with a ∈ A and b ∈ B. If x = a; b ∈ A × B then 1 (x) = a and 2 (x) = b. For n ∈ IN, A1 ; A2 ; ::; A sets, x ∈ A1 × A2 × :: × A and i ∈ {1; ::; n},  (x) denotes the i omponent of x. n

n

th

i

A binary relation R on a set S, is a subset of S × S. If S a set and R ⊆ S × S then: R0 = I = {s; s | s ∈ S }, R = {s1 ; s3 ∈ S × S | ∃ 2 ∈ (s1 ; s2 ∈ R ∧ s2 ; s3 ∈ R −1 )}, for n > 0 and R∗ = {s1 ; s2 | ∃ ∈IN s1 ; s2 ∈ R } = ∪ ∈IN R , the re exive and transitive losure of R. n

s

n

S

n

n

n

n

A partially ordered set, or just poset, is a pair S; R where S is a set and R a binary relation on S, whi h satis es the following onditions: ∀ ∈ s; s ∈ R (re exive) ∀ 1 2 ∈ (s1 ; s2 ∈ R) ∧ (s2 ; s1 ∈ R) ⇒ (s1 = s2 ) (antisymmetri ) ∀ 1 2 3 ∈ (s1 ; s2 ∈ R) ∧ (s2 ; s3 ∈ R) ⇒ (s1 ; s3 ∈ R) (transitive) s

S

s ;s

S

s ;s ;s

S

In general we denote a partial ordering by `≤' and use an in x notation. We will adopt the notations s1 < s2 , s1 ≥ s2 , s1 > s2 for respe tively s1 ≤ s2 ∧ s1 = s2 , s2 ≤ s1 , s2 ≤ s1 ∧ s1 = s2 . A poset S; ≤ is a linear ordering (total ordering), if and only if, for all s1 ; s2 ∈ S: s1 ≤ s2 or s2 ≤ s1 . Set operations are de ned in the usual way. If A is a set, then #A is the number of elements in A and IP(A) is the powerset of A (the set of all subsets of A). For A and B sets, A → B denotes the set of all total fun tions from A to B and A → B denotes the set of all partial fun tions from A to B. If f ∈ A → B then dom(f) is the domain of f and rng(f) = {f(x) | x ∈ dom(f)} is the range of f. If f a fun tion then f is also de ned for X ⊆ dom(f): f(X) = {f(x) | x ∈ X }. f X denotes the restri tion of a fun tion to X ⊆ dom(f), i.e. dom(f X) = X and for all x ∈ X: f X(x) = f(x). We use the lambda notation or the `set notation' to de ne fun tions, i.e. a fun tion f =  ∈ ( ) f(x) = {x; f(x) | x ∈ dom(f)}. Note that the set notation of a fun tion allows for a number of set operations. If f1 , f2 are fun tions, then: #f1 = #dom(f1 ) f1 ⊆ f2 i dom(f1 ) ⊆ dom(f2 ) ∧ ∀ ∈ ( 1 ) f1 (x) = f2 (x) f1 \ f2 = f1 {x ∈ dom(f1 ) | x ∈ dom(f2 ) ⇒ f1 (x) = f2 (x)} x

dom f

x

dom f

2.2.

29

NOTATIONS

Furthermore, if f1 , f2 fun tions with disjoint domains then: f1 ∪ f2 = {x; y | (x ∈ dom(f1 ) ∧ f1 (x) = y) ∨ (x ∈ dom(f2 ) ∧ f2 (x) = y)} For a totally ordered set A and x; y ∈ A: x min y (x max y) is the minimum (maximum) of x and y, i.e. if x ≤ y then x min y = x (x max y = y). If A is a totally ordered nite non-empty set, then min A is the minimal element of A and max A is the maximal element of A. If A = ∅, then min A = ∞ and max A = −∞. If A ⊆ IR ∪ {−∞; ∞} then min A (max A) is the supremum (in mum) of A. If A is not bounded below (above) then min A = −∞ (max A = ∞). Be ause of the ompleteness axiom for reals (see Depree and Swartz [36℄), every subset of IR ∪ {−∞; ∞} has a supremum and in mum. Sometimes we use an alternative notation to denote the minimum (maximum) of the range of a fun tion f on a spe i ed domain A: minx∈A f(x) = min{f(x) | x ∈ A} and maxx∈A f(x) = max{f(x) | x ∈ A}. Intuitively a multiset is the same as a set, ex ept for the fa t that a multiset may

ontain multiple o

urren es of the same element. Another word for multiset is bag. Bag theory is a natural extension of set theory (see Peterson [100℄). A multiset, like a set, is a olle tion of elements over the same subset of some universe. However, unlike a set, a multiset allows multiple o

urren es of the same element. A multiset b over A is de ned by a fun tion from A to IN, i.e. b ∈ A → IN. If a ∈ A then b(a) is the number of o

urren es of a in the multiset b. IB(A) is the set of all multisets over A. We now introdu e some operations on bags. Most of the set operators an be extended to bags in a rather straightforward way. Suppose A a set, b1 ; b2 ∈ IB(A) and q ∈ A. q ∈ b1 i b1 (q) ≥ 1 b1 ⊆ b2 i ∀a∈A b1 (a) ≤ b2 (a) b1 = b2 i b1 ⊆ b2 ∧ b2 ⊆ b1 b1 ∪ b2 = a∈A (b1 (a) max b2 (a)) b1 ∩ b2 = a∈A (b1 (a) min b2 (a)) b1 + b2 = a∈A (b1 (a) + b2 (a)) b1 \ b2 = a∈A ((b1 (a) − b2 (a)) max 0) min(b1 ) = min{a ∈ A | a ∈ b1 } max(b1 ) = max{a ∈ A | a ∈ b1 } #b1 = b1 (a)

X

a∈A

(membership) (in lusion) (equality) (union) (interse tion) (sum) (di eren e) (minimum) (maximum) ( ardinality of a nite bag)

We use square bra kets to denote multisets by enumeration. Suppose A a set, n ∈ IN and q0 ; q1 ; ::; qn ∈ A then [q0 ; q1 ; ::; qn℄ = a∈A #{i ∈ {0; ::; n} | qi = a}. Consider, for example, the following bags over the domain IN: [1; 3℄, [1; 1; 1℄, [1; 2; 1; 2℄. Note that [1; 2; 1; 2℄ and [1; 1; 2; 2℄ indi ate the same bag. We use [ ℄ to denote the empty bag. Although bags are a generalization of sets, we want to be able to represent bags

30

CHAPTER 2.

A TIMED COLOURED PETRI NET MODEL

as sets. This an be done by atta hing a unique label to every element in the bag. An advantage of su h a labelled bag is the fa t that it is possible to identify single elements in a bag. In the rest of this monograph we assume that there is an in nite set of labels alled Id, for example Id = IN. More formally: we represent a nite bag b ∈ IB(A) by a partial fun tion s ∈ Id → A with a nite domain. In order to be able to swit h between the two types of representation, we introdu e two onversion fun tions: SB and BS .

De nition 1

If A is a set then we de ne SB ∈ (Id → A) → IB(A) and a BS ∈ IB(A) → (Id → A) as follows. For any s ∈ Id → A with a nite domain and for any nite bag b ∈ IB(A), we have: SB (s) = a∈A #{i ∈ dom(s) | s(i) = a} SB (BS (b)) = b

Fun tion SB transforms a labelled bag into the onventional representation without labels. Note that several fun tions BS satisfying the ondition ∀b∈IB(A) SB (BS (b)) = b are possible (`Axiom of Choi e'). It is easy to verify that su h a fun tion exists, e.g. take one element from the bag and label it 1, take an arbitrary other one and label it 2, et . For example, if A is a totally ordered set and Id = IN, then we may de ne BS as follows. For any nite b ∈ IB(A): BS (b) = label(Id; b), where for any X ⊆ Id:

label(X; b) =

(

∅ if b = [ ℄ {min X; min b } ∪ label(X \ {min X }; b \ [min b℄) if b = [ ℄

In the remainder of this monograph we assume a given BS , i.e. a xed fun tion.

De nition 2

Two labelled bags over A, say s1 ; s2 ∈ Id → A, are equal if and only if the orresponding bags are equal, i.e. SB (s1 ) = SB (s2 ). If two labelled bags are equal, then there is an obvious bije tion between the elements. This is expressed by the following lemma:

Lemma 1

Let A be a set and s1 ; s2 ∈ Id → A. Then SB (s1 ) = SB (s2 ) if and only if there exists a bije tive fun tion f ∈ dom(s1 ) → dom(s2 ) with: ∀i∈dom(s1 ) s1 (i) = s2 (f (i))

2.3.

' $ '$             & % & %

TRANSITION SYSTEMS

31

4; PPP  43; b ; a1 1 34 PPP     PPPP  3; a PPPP - 76; a    PPPP      2 ; b PqP 32; 1; a  Figure 2.5: Two equivalent labelled bags

Proof.

Let s1; s2 ∈ Id → A. (1) Assume that there exists a bije tive f ∈ dom(s1) → dom(s2) with for all i ∈ dom(s1 ): s1 (i) = s2 (f (i)). Now we have to prove that SB (s1 ) = SB (s2 ). For any a ∈ A: {i ∈ dom(s1 ) | s1 (i) = a} = {i ∈ dom(s1) | s2(f (i)) = a} and #{i ∈ dom(s1) | s2(f (i)) = a} = #{j ∈ dom(s2 ) | s2 (j ) = a} (f is bije tive). Hen e, a∈A#{i ∈ dom(s1) | s1(i) = a} = a∈A#{j ∈ dom(s2) | s2 (j ) = a}, i.e. SB (s1 ) = SB (s2 ). (2) Assume that SB(s1 ) = SB(s2 ). Now we have to prove that there exists a bije tive f ∈ dom(s1 ) → dom(s2 ) with for all i ∈ dom(s1 ): s1 (i) = s2 (f (i)). For any a ∈ A: #{i ∈ dom(s1 ) | s1(i) = a} = #{j ∈ dom(s2) | s2 (j ) = a}, be ause SB (s1 ) = SB (s2 ). If X and Y two arbitrary sets and #X = #Y , then there exists a bije tive g ∈ X → Y . Hen e, for ea h a ∈ A, there exists a bije tive fun tion fa ∈ {i ∈ dom(s1 ) | s1 (i) = a} → {j ∈ dom(s2 ) | s2 (j ) = a}. If a1; a2 ∈ A and a1 = a2 , then dom(fa ) ∩ dom(fa ) = ∅ and rng(fa ) ∩ rng(fa ) = ∅. Consequently, f = ∪a∈A fa is bije tive and for all i ∈ dom(s1): s1 (i) = s2(f (i)). 1

2

1

2

2

Figure 2.5 shows a bije tive fun tion f relating two equivalent labelled bags. In this

ase, dom(f ) = {1; 2; 3; 4}, f (1) = 34, f (2) = 43, f (3) = 76 and f (4) = 32. 2.3

Transition systems

To formalize the ITCPN model we have to atta h a pre ise meaning to interval timed oloured Petri nets, this an be done by giving formal semanti s. There are several ways to do this. In literature three styles of semanti s are distinguished: (1) operational semanti s, (2) axiomati semanti s and (3) denotational semanti s. We

32

CHAPTER 2.

A TIMED COLOURED PETRI NET MODEL

               :   *1 6               1

2

3

4

5

0

Figure 2.6: A graphi al representation of S; R use operational semanti s 1 to des ribe our formalism, be ause this seems to be the most natural way to des ribe the behaviour of an interval timed oloured Petri net. Another advantage of using operational semanti s is that it makes it easy to ompare two models by establishing a relation between the states of the two models. We use this property to prove the orre tness of some of the analysis methods des ribed in

hapter 3. The operational semanti s (of the behaviour) of our model are given by means of a transition system. There are several types of transition systems, alled labelled transition systems, non-deterministi ma hines, pro ess graphs, non-deterministi automata, et . (see Milner [91℄, Hennessy [59℄, Hesselink [60℄, Van Hee and Rambags [49℄, et .). We de ne a transition system as follows:

De nition 3 (Transition System)

A transition system is a pair S; R , where: S is a set , alled the state spa e R ⊆ S ×S , the transition relation

A similar de nition is given by Van Hee and Rambags in [49℄. Note that a tions, i.e. transitions from one state to another, are not labelled as opposed to many existing types of transition systems. Although our de nition deviates from most transition systems des ribed in literature (e.g. Hesselink [60℄), we use de nition 3 for reasons of onvenien e. Furthermore, it is easy to transform our transition systems into any other type of transition systems and vi e versa. Sometimes it is useful to make a graphi al representation of a transition system. Consider for example the transition system S; R , where: S = IN R = {n + 2; n + 1 | n ∈ IN} ∪ {0; n | n ∈ IN \ {0}} The orresponding graph is shown in gure 2.6.

Rea hability is the basis for studying the behaviour of a transition system. 1 In

a sense, our semanti s are also denotational semanti s, sin e we spe ify the meaning of an

ITCPN by mathemati al ob je ts, su h as sets, fun tions and relations.

2.3.

33

TRANSITION SYSTEMS

De nition 4 (Rea hability)

For a transition system S; R and an initial state s ∈ S we de ne: R(s) = {s^ ∈ S | sRs^}, the one step rea hability set of s Rn (s) = {s^ ∈ S | sRn s^}, the n-step rea hability set of s RS (s) = ∪n∈IN Rn (s), the set of all states that are rea hable from s S T = {s^ ∈ S | R(^s) = ∅}, the set of terminal states For the transition system depi ted in gure 2.6, R(0) = IN \ {0}, R(1) = ∅, R(2) = {1}, R(3) = {2}, R2 (0) = IN \ {0}, R2 (1) = ∅, R2 (2) = ∅, R2 (3) = {1}, RS (0) = IN and for n > 0: RS (n) = {k ∈ IN | 1 ≤ k ≤ n}. Note that state 1 is a terminal state. The pro ess of a transition system starting in an initial state s is des ribed by the set of all possible exe ution paths starting in s. These exe ution paths represent all possible `behaviours' of the transition system. An exe ution path is a (maximal) sequen e of states su h that any su

essive pair belongs to the transition relation. A path starts in an initial state and either it is in nite or it ends in a terminal state. De nition 5 (Pro ess)

For a transition system S; R and an initial state s ∈ S we de ne: (s) = { ∈ IN → S | 0 ∈ dom() ∧  = s ∧ ∀i∈dom  \{ } (i − 1) ∈ dom( ) ∧ i− Ri ∧ ∀i∈dom  (∀j ∈dom  j ≤ i) ⇒ i ∈ S T } (s) is the pro ess (or behaviour) of the transition system in state s. 0

( )

0

1

( )

( )

Note that the domain of a ring sequen e  is onse utive subset of IN. Consider the transition system shown in gure 2.6. Examples of paths starting in state 0 are {0; 0 ; 1; 1 }, {0; 0 ; 1; 2 ; 2; 1 } and {0; 0 ; 1; 4 ; 2; 3 ; 3; 2 ; 4; 1 }. (s) is the set of all possible exe ution paths starting in s. For all paths  ∈ (s) and n ∈ IN:  {k ∈ IN | 0 ≤ k < n} is alled a tra e. One of the main reasons for hoosing operational semanti s is the fa t that it allows us to ompare the behaviour of two systems. Therefore, we introdu e some on epts to ompare transition systems. Most of these on epts have been adopted from Hesselink [60℄ and Van Hee and Rambags [49℄. The rst relationship we onsider is the so- alled morphism from one transition system to another. De nition 6 (Morphism)

Let X = Sx; Rx and Y = Sy ; Ry be two transition systems. A fun tion f ∈ Sx → is a morphism from transition system X to transition system Y if and only if: {f (x ); f (x ) | x ; x ∈ Rx } ⊆ Ry

Sy

1

2

1

2

34

CHAPTER 2.

A TIMED COLOURED PETRI NET MODEL

Loosely speaking, a fun tion f is alled a morphism from transition system X to transition system Y if every transition in X orresponds to some transition in Y . The morphism is said to be stri t if: {f (x1 ); f (x2 ) | x1 ; x2 ∈ Rx } = Ry

It is easy to verify that the omposition of morphisms is transitive:

Lemma 2 Let

= S ; R , Y = S ; R and Z = S ; R be transition systems. If f ∈ is a morphism from transition system X to transition system Y and g ∈ S → S is a morphism from transition system Y to transition system Z , then g ◦ f ∈ S → S is a morphism from X to Z .

Sx

X

x



x

y

y

z

z

Sy

y

z

x

z

Proof.

Straightforward.

2

If both morphisms are stri t, then so is the omposition. Sometimes it is not possible to establish a fun tional relationship between two transition systems. Consider for example two transition systems X and Y where one state in X orresponds to two or more states in Y and vi e versa. In this ase we are in need of a weaker relationship. This relationship is alled similarity, it is based on a relation rather than a fun tion.

De nition 7 (Similarity)

Let X = S ; R and Y = S ; R be two transition systems. with respe t to a relation C ⊆ S × S if and only if: x

x

y

y

x

Y

is similar to

X

y

∀ x1 ;x2 ∈Rx ∀y1 ∈Sy (x1 ; y1 ∈ C ) ⇒ ∃y2 ∈Sy (x2 ; y2 ∈ C ∧ y1 ; y2 ∈ Ry )

This de nition is illustrated by gure 2.7. For every transition x1 ; x2 in X and every state y1 in Y related to x1 (i.e. x1 ; y1 ∈ C ), there exists a transition from y1 to a state y2 su h that y2 is related to x2 . To larify this on ept, onsider the following example: X = S ; R and Y = S ; R are two transition systems de ned as follows: x

Sx Rx Sy Ry C

= = = = =

x

IN {n; n + 1 | n ∈ IN} {k; l | k ∈ IN ∧ l ∈ IN ∧ k ≤ l} {k; l ; k + 1; l + 1 | k; l ∈ Sy } {n; k; l ∈ Sx × Sy | k ≤ n ≤ l}

y

y

2.3.

35

TRANSITION SYSTEMS

$ $ ' '    - ? ?  - % & % & Sx ; Rx

Sy ; Ry

x1

y1

x2

y2

Figure 2.7: The `similarity' relationship It is easy to verify that Y is similar to X with respe t to C . The `soundness' and ` ompleteness' properties de ned in hapter 3 are also examples of similarity relations. The omposition of similarity relations is transitive.

Lemma 3

Let X = Sx ; Rx , Y = Sy ; Ry and Z = Sz ; Rz be transition systems. If Y is similar to X with respe t to a relation C1 ∈ Sx × Sy and Z is similar to Y with respe t to a relation C2 ∈ Sy × Sz , then Z is similar to X with respe t to the relation: C

= {x; z ∈ Sx × Sz | ∃y∈Sy x; y ∈ C1 ∧ y; z ∈ C2 }

Proof.

Straightforward.

2

A morphism of two transition systems is a spe ial form of similarity.

Lemma 4

Let X = Sx ; Rx and Y = Sy ; Ry be transition systems. If f ∈ Sx → Sy is a morphism from X to Y , then Y is similar to X with respe t to a relation C = {x; f (x) | x ∈ Sx }. Sometimes a similarity relation is bidire tional. Consider the previous example, Y is similar to X with respe t to C = {n; k; l ∈ Sx × Sy | k ≤ n ≤ l} and X is similar to Y with respe t to C^ = {k; l ; n ∈ Sy × Sx | k ≤ n ≤ l}. Therefore, many authors de ne a on ept alled bisimilarity (e.g. Hesselink [60℄).

De nition 8 (Bisimilarity)

Let X = Sx ; Rx and Y = Sy ; Ry be two transition systems. X and Y are said to be bisimilar with respe t to a relation C ⊆ Sx × Sy , if and only if, Y is similar to X with respe t to C and X is similar to Y with respe t to {y; x | x; y ∈ C }.

36

CHAPTER 2.

A TIMED COLOURED PETRI NET MODEL

It is easy to see that bisimilarity is re exive, symmetri and transitive, i.e. an equivalen e relation. Note that for any transition system X and Y , X and Y are bisimilar with respe t to C = ∅. Therefore, we introdu e a stronger relationship,

alled equivalen e.

De nition 9 (Equivalen e)

Let X = Sx ; Rx and Y = Sy ; Ry be two transition systems. X and Y are said to be equivalent, if and only if, there exists a stri t bije tive morphism f ∈ Sx → Sy from X to Y .

Fun tion f in de nition 9, is alled an isomorphism from X to Y (and vi e versa). If two transition systems X and Y are equivalent there is a one-to-one orresponden e between the states of X and Y . A transition between two states of X is possible if and only if the orresponding transition is possible in Y , i.e x1 Rx x2 ⇒ f (x1 )Ry f (x2 ) and y1 Ry y2 ⇒ f −1 (y1 )Rx f −1 (y2). Using lemma 4 it is easy to verify that the equivalen e of X and Y implies that X and Y are bisimilar with respe t to relation C = {x; f (x) | x ∈ Sx }. This ompletes our introdu tion to transition systems. 2.4

The model

An interval timed oloured Petri net (ITCPN) is a dire ted labelled bipartite graph with two node types alled pla es and transitions. Pla es are represented by ir les and transitions by bars. A dire ted ar (arrow) onne ts a pla e and a transition in only one dire tion. A pla e p is alled an input pla e of a transition t if there exists a dire ted ar from p to t. A pla e p is alled an output pla e of a transition t if there exists a dire ted ar from t to p. Pla es may ontain zero or more tokens, drawn as bla k dots. The number of tokens may hange during the exe ution of the net. The pla e where a token `resides' is alled the position (or lo ation) of a token. Besides a position, a token also has a value, a timestamp and some identi ation. The timestamp indi ates the time the token be omes available. The identi ation is merely used to dis riminate between two tokens having an identi al value and timestamp. A transition is alled enabled if there are `enough' tokens on ea h of its input pla es. In other words, a transition is enabled if all input pla es ontain (at least) the spe i ed number of tokens. An enabled transition an re at time x if all the tokens to be onsumed have a timestamp not later than time x. The enabling time of a transition is the maximum timestamp of the tokens to be onsumed. Be ause transitions are eager to re, a transition with the smallest enabling time will re rst. Firing a transition means onsuming tokens from the input pla es and produ ing tokens on the output pla es. 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-deterministi hoi e if several transitions have the same enabling time.

2.4.

37

THE MODEL

Firing is an atomi a tion, thereby produ ing tokens with a timestamp of at least the ring time. The di eren e between the ring time and the timestamp of su h a produ ed token is alled the ring delay. This delay is spe i 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 orresponding delay interval. Note that the term `sampled' may be onfusing, be ause the modeller does not spe ify a probability distribution, merely an upper and lower bound. Moreover, it is possible that the modeller spe i es a delay interval whi h is too wide, be ause of a la k of detailed information. In this ase, the a tual delays (in the real system) only range over a part of the delay interval. The number of tokens produ ed by the ring of a transition may depend upon the values of the onsumed tokens. Moreover, the values and delays of the produ ed tokens may also depend upon the values of the onsumed tokens. The relation between the values of the onsumed tokens and the bag of produ ed tokens is des ribed by a fun tion. Note that, unlike in CPN, the enabling of a transition does not depend upon the values of the tokens onsumed.

De nition 10 (ITCPN)

An ITCPN is de ned by a seven tuple, ITCPN = (P; V; T ; I ; O; F; T S ) with: •

P



V

= dom(V ), the set of pla es

Vp

is a fun tion with domain P , for all p ∈ P : is the value set or olour set of p (V = ∅)



T

= dom(I ) = dom(O) = dom(F ), the set of transitions



I





O





TS

, the time set



p

T

T

→ IB(P ), the input pla es of a transition and their weights → IP(P ), the output pla es of a transition

= {t1 ; t2 ∈

losed intervals INT



CT



F

TS

= {p; v | p ∈ P ∧

× TS |

t1





t2

t1
y + 1 then t2 will re at time y + 1. Transition t2 represents a timeout, the token in pla e p2 is `lost' if it has been there for 1 time unit (i.e. onsumed by t2 ). It is possible to model priorities and timeouts using our ITCPN. Consider for example gure 2.11, whi h shows an ITCPN orresponding to the net of gure 2.10. Both nets behave in a similar way. This example shows that modelling priorities and timeouts using an ITCPN is quite omplex. There are, however, several reasons for the fa t that we did not extend our ITCPN model with enabling delays. First of all, the on ept of enabling delays allows for several interpretations (multiple enabledness, et .). This makes it diÆ ult to understand and to explain the model. Se ondly, we believe that the number of timing me hanisms in the formal ITCPN model should be restri ted to one. Multiple kinds of delays make the model more

omplex and diÆ ult to use. Another reason for not hoosing enabling delays is

46

CHAPTER 2.

A TIMED COLOURED PETRI NET MODEL

 

 

t1



p1

-

p3

R  PPP   PPP 1  PPP  PqP       - - p5

p2

[1; 1℄

t23

p7

p6

t21

p4

t22

Figure 2.11: The `timeout' modelled by an ITCPN that we want to use the language ExSpe t to spe ify ITCPNs and ExSpe t does not support enabling delays. Nevertheless, it is quite easy to add enabling delays to our ITCPN model. Furthermore, most of the on epts and te hniques des ribed in this monograph an be adapted to nets having enabling delays. This is demonstrated by the fa t that the ITPN Analysis Tool (IAT) also supports the analysis of nets with enabling delays (see hapter 4).

Firing delays The early timed Petri net models (e.g. [108℄, [107℄, [133℄) asso iate a ring duration with ea h transition in the net. In these models the ring of a transition takes some time. Su h a ring me hanism seems to be the most natural interpretation of time in transitions. Suppose that the ring duration of ea h transition is given by: FD

∈ T → TS

A transition with a positive ring duration is alled a timed transition. Suppose a timed transition t be omes enabled at time x, at this moment the ring of t is initiated by removing tokens from the input pla es of t. The ring terminates at time x + F Dt , then the tokens are added to the output pla es of t. Note that ring is no longer atomi , therefore we all the ring of a timed transition a `two-phase' ring. It is possible that a transition be omes enabled while it res. Some authors allow multiple rings, i.e. a transition may be engaged in a number of rings at the same time. We do not allow multiple rings, i.e. a transition an not be enabled while it res. To give the formal semanti s of this ring rule we have to hange the transition system of se tion 2.4.1 radi ally. Therefore, we will give the semanti s of this ring rule in terms of an ITCPN instead of a transition system, i.e. the meaning of this timing me hanism is given by a onstru tion whi h repla es ea h transition by

2.4.

THE MODEL

p1

 

p1

start

t

t

?

busy

d

p2

?    6 ?  ?   [d; d℄

t

?  

   ??

47

end

t



[0; 0℄ p2

free

t

[0; 0℄

Figure 2.12: Constru tion of a timed transition (left) using two ITCPN transitions (right) a small subnet. This onstru tion is shown in gure 2.12. A timed transition t (represented by a small re tangle) is repla ed by two (ITCPN) transitions tstart and end , and two pla es tfree and tbusy . Transition tstart is enabled if the input pla es of t free ontains a token. If tstart res it adds one t ontain enough tokens and pla e t token to tbusy with a value representing the bag of tokens onsumed from the input pla es and a delay d = F Dt . Transition tend represents the termination of a ring. More formally: suppose we have an ITCPN, say (P; V; T ; I ; O; F; T S ), an initial state s and a fun tion F D ∈ T → T S representing the ring delay of ea h transition. To

onstru t the ITCPN, say (P ; V ; T ; I ; O; F ; T S ), orresponding to (P; V; T ; I ; O; F; T S ) with the transitions repla ed by similar timed transitions, we sele t a timed transition t ∈ T and de ne: = P ∪ {tfree; tbusy }, su h that {tfree ; tbusy } ∩ P = ∅



P



V



T



I tstart



O tstart

tfree

= {`signal'}, V tbusy = IB(C T ) and for all p ∈ P :

V

p

= Vp

= (T \ {t}) ∪ {tstart ; tend } , su h that {tstart ; tend } ∩ T = ∅ = It ∪ [tfree ℄,

I tend

= [tbusy ℄ and for all t^ ∈ (T \ {t}):

I t^

= It^

= {tbusy }, Otend = Ot ∪ {tfree } and for all t^ ∈ (T \ {t}):

O t^

= Ot^

• for all t^ ∈ (T \ {t}): F t^ = Ft^ , and for all ∈ dom(F tstart ): F tstart ( ) = [tbusy ; \ [tfree; `signal' ℄ ; F Dt ; F Dt ℄ for all ∈ dom(F tend ): F tend ( ) = Ft (value(q )) ∪ [tfree; `signal' ; 0; 0 ℄ ,

where

q

is the only element in the bag (# = 1)

48

CHAPTER 2.

A TIMED COLOURED PETRI NET MODEL

Repeat this until every timed transition is repla ed by a subnet. The initial state of the onstru ted ITCPN, (P ; V ; T ; I; O; F ; T S ), is the initial state of (P; V; T; I; O; F; T S ) with one token in ea h pla e of {tfree | t ∈ T } with timestamp zero. Note that every transition t ∈ T orresponds to pre isely one unique pla e tfree . Similar statements hold for pla e tbusy and transitions tstart and tend . This onstru tion gives our semanti s of timed transitions. We will show that these semanti s orrespond to our on eption of time in transitions. Suppose we have an ITCPN, (P; V; T; I; O; F; T S ), su h that for all t ∈ T , ∈ dom(Ft ) and q ∈ Ft ( ): time(q ) = 0; 0 , i.e. an ITCPN without delays. If we

onstru t an ITCPN, (P ; V ; T ; I; O; F ; T S ), in the way des ribed above, with the ring durations given by F D ∈ T → T S , then the onstru ted net has a very spe i stru ture. We will use this stru ture to prove a number of properties. In the rest of this se tion we assume that S; R is the transition system of the onstru ted ITCPN. Lemma 5

For any t ∈ T and s1 ; s2 ∈ S su h that s1 Rs2 , we have that if Xt = {tbusy ; tfree} then: #{i ∈ dom(s1 ) | pla e(s1 (i)) ∈ Xt } = #{i ∈ dom(s2 ) | pla e(s2 (i)) ∈ Xt } Proof.

Suppose e ∈ AE (s1 ) su h that e is an event transforming s1 into s2 . There are two possibilities: either there is a t ∈ T su h that 1 (e) = tstart or there is a t ∈ T su h that 1 (e) = tend . If 1 (e) = tstart , then a token is removed from pla e tfree and at the same time a token is added to pla e tbusy . Otherwise (1 (e) = tend ) a token is removed from pla e tbusy and at the same time a token is added to pla e tfree . In both ases the total number of tokens in the pla es tbusy and tfree has not hanged.

2

The initial state of the onstru ted ITCPN is su h that ea h pla e of {tfree | t ∈ T }

ontains one token. This and lemma 5 imply that for any timed transition t there is a token in tbusy or there is a token in tfree but not in both. This property shows that a timed transition is either free or busy. Lemma 6

Let s1 ; s2 ∈ S su h that s1 Rs2 then: ∀i∈dom(s1 ) pla e(s1 (i)) ∈ P ⇒ time(s1 (i)) ≤ tt(s1 ) ⇒ ∀i∈dom(s2 ) pla e(s2 (i)) ∈ P ⇒ time(s2 (i)) ≤ tt(s2 ) Proof.

For every event e ∈ AE (s1 ), whi h transforms s1 into s2 , there are two possibilities:

2.5.

SOME FURTHER CONCEPTS AND PROPERTIES

49

either 1 (e) = tstart or 1 (e) = tend for some t ∈ T . If 1 (e) = tstart , then a token is removed from the pla es of [tfree ℄ ∪ It and at the same time a token is added to pla e tbusy , i.e. tstart only onsumes tokens from pla es in P . If 1 (e) = tend , then a token is removed from pla e tbusy and at the same time tokens are added to some of the pla es in {tfree } ∪ Ot . Every token added to a pla e in P has a delay of zero, be ause for all t ∈ T , ∈ dom(Ft ) and q ∈ Ft ( ): time(q ) = 0; 0 . This and the monotoni ity of time (see theorem 1 in se tion 2.5) imply that the timestamps of the tokens added to P are smaller than or equal to the new transition time (tt(s2 )).

2

This lemma says that if initially ea h token in the pla es of P has a timestamp smaller than or equal to the transition time, then this remains so during the exe ution of any path. In other words, if all tokens in P are available in state s1 then every state s2 rea hable by some sequen e of events is su h that ea h token in s2 is available if it is lo ated in a pla e of P . This lemma shows that the timestamps of the tokens in P do not a e t the dynami behaviour of the net, i.e. tokens in the pla es of P are always `available'. Therefore, all timing aspe ts are restri ted to the pla es added during the onstru tion (in fa t the pla es {tbusy | t ∈ T }). Lemma 5 and lemma 6 illustrate the behaviour of the onstru ted net. We expatiated on this subje t, be ause the onstru tion of gure 2.12 is often used to model a resour e with a nite apa ity. We have shown that our style of semanti s an be used to formalize the meaning of various alternative ring me hanisms in a transparent and ompa t way. In ea h

ase the state spa e of the transition system is S = Id → (CT × (T S \ {∞})). The majority of timed Petri net models proposed in literature represent a state as a pair s = m; d where m is the marking (m ∈ IB(P )) and d is the ring ve tor (d ∈ T → T S or d ∈ T → IB(T S )). The ring ve tor represents the residual enabling (or ring) time of ea h enabled (or ring) transition in the net. If t ∈ dom(d) then transition t ompletes (starts) its ring at time(s) dt . When a transition t res, both the marking and the ring ve tor have to be updated. Updating the ring ve tor involves a number of steps: (1) delete disabled transitions and t, (2) shift the residual enabling ( ring) times and (3) add enabled transitions. The shift operation is ne essary be ause these models use a relative time s ale. For examples of timed Petri net models de ned in su h a manner, see [16℄, [17℄, [133℄, [81℄, [64℄ and [28℄. Clearly, a transition system des ribing the semanti s of a timed Petri net model using states of the form m; d is mu h more omplex than the transition system given in se tion 2.4.1. Therefore, we asso iate time with tokens rather than pla es or transitions. 2.5

Some further on epts and properties

In this se tion we introdu e some of the basi on epts and ommon terms normally used in Petri net theory. Be ause our ITCPN model is a timed high-level Petri

50

CHAPTER 2.

A TIMED COLOURED PETRI NET MODEL

net model, some of these on epts have been extended. We also prove some of the behavioural properties of an ITCPN. We use the following notations for the pre-set and post-set of a pla e p or a transition t: •t = {p^ ∈ P | It (^ p) > 0} (the set of input pla es of t) t• = Ot (the set of output pla es of t) ^ • p = { t ∈ T | p ∈ Ot } (the set of input transitions of p) p• = {t^ ∈ T | It (p) > 0} (the set of output transitions of p) An ITCPN is on i t free, if for ea h pla e p in the net the number of output transitions is smaller than or equal to 1, i.e. #(p•) ≤ 1. A pla e p without any input transition is alled a sour e pla e, i.e. •p = ∅. A sink pla e is a pla e p without any output transition, i.e. p• = ∅. An ITCPN is alled ordinary, if for ea h transition t ∈ T of the net: ∀p∈P It (p) ≤ 1 and X ∀p∈Ot ∀ ∈dom Ft Ft ( )(q) = 1 ^

^

(

)

q∈Ft ( ) pla e(q)=p

In other words, a net is ordinary if all `multipli ities' (weights of input and output ar s) are equal to 1. Note that a transition in an ordinary net always produ es exa tly one token for ea h of its output pla es. A state ma hine is an ordinary ITCPN su h that ea h transition t has exa tly one input pla e and one output pla e, i.e. ∀t∈T #(•t) = #(t•) = 1. A marked graph is an ordinary ITCPN su h that ea h pla e p has one input transition and one output transition at the most, i.e. ∀p∈P #(•p) ≤ 1 ∧ #(p•) ≤ 1. Some authors use the term (timed) event graph instead of marked graph. A free hoi e net is an ordinary ITCPN su h that for ea h pla e p with more than one output transition, this pla e is the only input pla e of ea h of these output transitions, i.e. ∀p∈P #(p•) ≤ 1 or •(p•) = {p}. 3

A non-empty subset of pla es X ⊆ P in an ITCPN, is alled a siphon (also known as deadlo k), if and only if, •X ⊆ X •, i.e. every transition having an output pla e in X has an input pla e in X . A siphon has the behaviour property that, if it is token free in some state s , then it remains token free in any state s rea hable from s . A non-empty subset of pla es X ⊆ P in an ITCPN, is alled a trap if X • ⊆ •X , i.e. every transition having an input pla e in X has an output pla e in X . If, in an ordinary net, a trap ontains tokens, then in any su

essive state the trap ontains tokens. 1

2

1

Sometimes we are only interested in the position of a token and not in its timestamp 3 If

A⊆P

or

A⊆T

, then

•A = ∪a∈A • a

and

A•

=

∪a∈A a•.

2.5.

SOME FURTHER CONCEPTS AND PROPERTIES

'

S \ RS (A)

&

 

RS (A) \ SRS (A)

 %

SRS (A) A

$

51

Figure 2.13: A partitioning of the state spa e S or value. This leads to the de nition of the marking of a state. A marking is denoted as a multiset of pla e indi es. Fun tion M ∈ S → IB(P ) gives the marking of ea h state. If s ∈ S then M (s) = p∈P #{i ∈ dom(s) | pla e(s(i)) = p }. The marking of a state represents the token distribution. For example, if s ∈ S and p ∈ P then M (s)(p) = 3 means that there are three tokens in pla e p. In the remainder of this hapter we assume that S; R is the transition system des ribing the semanti s of an ITCPN (P; V; T; I; O; F; T S ). In se tion 2.3 we de ned

on epts su h as rea hability and pro ess. These on epts are useful in the ontext of the transition system S; R . For an initial state s ∈ S , R(s) is the set of states rea hable by ring one transition in state s (see de nition 4), i.e if s^ ∈ R(s) then there exists an allowed event e with et(e) = tt(s) whi h transforms s into s^. If A ⊆ S is a set of states, then R(A) is the set of all states rea hable by ring one transition in a state in A, i.e. R(A) = {s^ ∈ S | ∃s∈A sRs^}. RS (A) = ∪n∈IN Rn (A) is the set of all states rea hable by ring an arbitrary number of transitions (when starting in a state in A). The pro ess of an ITCPN is des ribed by the set of all possible (exe ution) paths (given a set of initial states A), i.e. (A). A path  ∈ (A) is a sequen e of states su h that any su

essive pair belongs to the transition relation. The rst state in a path is alled the initial state and either the path is in nite or it ends in a terminal state (see de nition 5). For all exe ution paths  ∈ (A) and n ∈ IN,  {k ∈ IN | 0 ≤ k < n} is alled a ring sequen e (or tra e). A ring sequen e of length n des ribes n − 1 su

essive rings. For a lear omprehension of the transition system des ribing the semanti s of an ITCPN, it is useful to realize that there are three kinds of states. Suppose we have a set A ⊆ S of possible initial states. In this ase we partition the state spa e S into three lasses, see gure 2.13. The rst lass, SRS (A) = {s ∈ S | ∀∈(A) ∃i∈dom() i = s}, onsists of states visited by any exe ution path. The se ond lass, RS (A) \ SRS (A), represents the set of states whi h might be rea hed, i.e. these states are rea hable, but they are not visited by every exe ution path stating in a state in A. The remaining states, S \ RS (A), are the states not rea hable when starting in a state in A.

52

CHAPTER 2.

A TIMED COLOURED PETRI NET MODEL

For onvenien e we de ne the operation pla e proje tion ( ), returning the bag of timestamps of tokens in a ertain pla e p given a state s.

De nition 14

For s ∈ S and p ∈ P : sp = x∈T S #{i ∈ dom(s) | pla e(s(i)) = p ∧ time(s(i)) = x} So, min(s p) is the smallest timestamp of the (non-empty) bag of tokens in pla e p. Sometimes it is useful to know the maximum number of tokens in a pla e:

De nition 15

A pla e p ∈ P is K-bounded in s ∈ S, if the number of tokens in p annot ex eed an integer K, i.e. ∀s^∈RS (s) #(^ s p) ≤ K

A net is alled K-bounded in s ∈ S if all pla es are K-bounded in s. Nets that are 1-bounded are alled safe. Pla es are often used to represent bu ers. By verifying that the net is bounded or safe, it is guaranteed that there will be no over ow of any of the bu ers, no matter what ring sequen e is taken.

De nition 16

An ITCPN is alled onservative with respe t to a weighting fun tion W ∈ P → IR, if and only if, for all s1 ; s2 ∈ S su h that s1 Rs2 , the following relation holds:

X

i∈dom(s1 )

W (pla e(s1 (i))) =

X

i∈dom(s2 )

W (pla e(s2 (i)))

All nets are onservative with respe t to W = p∈P 0. If the ITCPN is onservative with respe t to W = p∈P 1, then the ITCPN is said to be stri tly onservative. In this ase, the number of tokens does not hange during any ring sequen e. The

on ept of onservation is losely related to pla e invariants. In hapter 3 we will dis uss how to generate invariants. A path is a sequen e of states. Consider the path s0 ; s1 ; ::si−1 ; si; si+1 ; ::. At time tt(si−1 ) an event o

urred transforming state si−1 into si . At time tt(si ) an event o

urred transforming state si into si+1 . Between tt(si−1 ) and tt(si ) the system was in state si . Sin e we are often interested in the state at a ertain moment in time, we de ne H:

2.5.

53

SOME FURTHER CONCEPTS AND PROPERTIES

state

-

4 3



2

·

1



0 



tt(0 ) tt(1 ) tt(3 ) tt(2 )

time

Figure 2.14: Relation between a path and the orresponding state fun tion De nition 17 (State fun tion)

If A ⊆ S and  ∈ (A) then H () ∈ T S → S with: ∀x∈T S H ( )(x) = min{i∈dom() | x≤tt(i )}

is the state fun tion of path . The state fun tion uses the following interpretation: at time x the ITCPN is in the rst state having a transition time of at least x. Figure 2.14 shows the relation between a path and the orresponding state fun tion. Note that at time x = tt( ) = tt( ) the ITCPN is in state  . However, several interpretations are possible, be ause ring is an atomi a tion. When we de ned the state spa e of the transition system des ribing the semanti s of an ITCPN, we did not allow tokens to have a timestamp ∞. This allows us to formulate lemma 7. 1

2

1

Lemma 7

For a state s ∈ S : s ∈ S T if and only if tt(s) = ∞. Proof.

The de nition of S T (the set of terminal states) shows that s ∈ S T implies that tt(s) = ∞. On the other hand, sin e every token has a timestamp smaller than ∞, the event time of any event is smaller than ∞. Hen e, tt(s) = ∞ implies that there are no allowed events, i.e. s ∈ S T . 2 An important property of the ITCPN model is the monotoni ity of time, i.e. time

an only move forward. We use the following two lemmas to prove this. Lemma 8

If s ; s 1

2

∈S

and s

1

⊆ s2

then tt(s ) ≥ tt(s ). 1

2

54

CHAPTER 2.

A TIMED COLOURED PETRI NET MODEL

Proof.

Observe that s ⊆ s means that state s is state s with zero or more additional tokens. First we show that: 1

2

2

1

∀e1 ∈AE (s1 ) ∃e2 ∈AE (s2 ) et(e2 ) ≤ et(e1 )

Assume e = t; qin; qout and e ∈ AE (s ), then e is su h that the ve onditions (2:4a); ::; (2:4e) on page 39 hold. Now we sele t an event e = t; q^in; q^out su h that e ∈ AE (s ), this is possible be ause adding tokens annot disable a transition. The fa t that e ∈ AE (s ) implies that ondition (2:4 ) holds, therefore the tokens are sele ted from ea h input pla e of t in order of their timestamps. Event e onsumes tokens with timestamps smaller than or equal to the tokens in e , be ause s is state s with zero or more additional tokens. Therefore: et(e ) ≤ et(e ). This implies that: tt(s ) = mine1∈AE s1 et(e ) ≥ mine2∈AE s2 et(e ) = tt(s ) 2 1

1

1

1

2

2

2

2

2

2

1

1

2

(

1

)

2

1

1

(

)

2

2

Lemma 9

Let s ; s ∈ S su h that dom(s ) ∩ dom(s ) = ∅. If for all i ∈ dom(s ): time(s (i)) ≥ tt(s ), then tt(s ∪ s ) = tt(s ). 1

2

1

1

1

2

2

2

2

1

Proof.

For any event e ∈ AE (s1 ∪ s2), either e onsumes tokens from s2 (i.e. dom(2 (e)) ∩ dom(s2 ) = ∅) or not (i.e. dom(2 (e)) ∩ dom(s2 ) = ∅). If e onsumes tokens from s2 then et(e) ≥ tt(s1 ), be ause for all i ∈ dom(s2 ): time(s2 (i)) ≥ tt(s1 ). Otherwise, 2 (e) ⊆ s1 . In this ase e ∈ AE (s1 ) be ause the ve onditions (2:4a); ::; (2:4e) on page 39 hold in state s1 if they hold in state s1 ∪ s2 (2(e) ⊆ s1). This also implies that et(e) ≥ tt(s1 ), i.e. tt(s1 ∪ s2 ) ≥ tt(s1 ). Lemma 8 tells us that tt(s1 ∪ s2 ) ≤ tt(s1 ), therefore tt(s1 ∪ s2) = tt(s1 ).

2

Theorem 1 (Monotoni ity)

Let s ∈ S ,  ∈ (s) and i; j ∈ dom(). If i ≤ j then tt(i ) ≤ tt(j ).

Proof.

First we prove that for all s ; s ∈ S with s Rs : tt(s ) ≤ tt(s ). If s Rs then there exists an event e ∈ AE (s ) su h that et(e) = tt(s ) and s = (s \  (e)) ∪ s ale( (e); tt(s )). Using lemma 8 we see that deleting tokens ( (e)) does not de rease the transition time. The tokens of s ale( (e); tt(s )) have a timestamp of a least tt(s ). Using lemma 9 we dedu e: tt(s ) ≤ tt(s ). Note that i Rj−ij . We use indu tion to prove that for all s ; s ∈ S and n ∈ IN: s Rn s ⇒ tt(s ) ≤ tt(s ). If n = 0 then s Rn s ⇒ s = s and s = s ⇒ tt(s ) ≤ tt(s ). Assume that for all v ∈ S : s Rn− v ⇒ tt(s ) ≤ tt(v ). Be ause s Rn s implies that there is a v ∈ S with s Rn− v and vRs , we dedu e: tt(s ) ≤ tt(v) ≤ tt(s ). 1

2

1

2

1

1

3

2

1

2

1

3

1

2

1

1

2

1

2

1

2

2

1

1

1

2

2

1

1

1

1

1

2

1

2

1

1

2

2

2

1

1

1

2

2

2.5.

'$ '$ y&% &%

55

SOME FURTHER CONCEPTS AND PROPERTIES



p1

-

-

-

[5; 5℄

[x; x℄

t1

p2

t2

Figure 2.15: An ITCPN

2 This theorem shows that the transition times are as ending. Note that this does not imply that `time moves forward' or `time moves past a ertain time'. Consider for example the ITCPN shown in gure 2.15. If the delay of the token produ ed for pla e p1 is always 0 and initially there is a token in p1 with timestamp 0, then t1 will re time after time but the transition time remains 0. In this ase time does not move forward. Next, we de ne the ITCPN shown in gure 2.15 as follows: = { p1 ; p 2 } Vp1 = IN and Vp2 = {`signal'} T = {t1 ; t2 } I = {t1 ; [p1 ℄ ; t2 ; [p2 ℄ } O = {t1 ; {p1 ; p2 } ; t2 ; {} } For all n ∈ IN: n n Ft1 ([p1 ; n ℄) = [p1 ; n + 1 ; (1=2) ; (1=2) ; p2 ; `signal' ; 5; 5 ℄ Ft2 ([p2 ; `signal' ℄) = [ ℄ P

Let it be supposed that initially there is one token in p1 with a value and timestamp equal to 0. Furthermore, assume that there are no tokens in p2 . Every time t1 res, the value of the token onsumed from pla e p1 is in reased by 1 and restored in pla e n p1 . The delay of the produ ed token is (1=2) , where n is the value of the token

onsumed. In this ase time moves forward, but t2 will never re. The transition time of the kth ring of t1 is: 0≤n x A net is dead in state s, if every path ends in a terminal state. Transien e is a

on ept whi h hara terizes nets where time never stops passing by, i.e. a net is transient in s if the time in the net ontinuously in reases. Sometimes this on ept is too strong. Thus, we relax the transien e ondition and de ne livelo k free. A net is livelo k free for an initial state, if the time in the net is in reasing until a terminal state is en ountered. A net is weakly progressive for an initial state, if there is no upper bound for the transition times, i.e. a net an rea h an arbitrarily large time. A net is progressive, if an arbitrary time x ∈ T S \ {∞} an and will be rea hed. The net shown in gure 2.15 (with delay (1=2)n) is a non-progressive transient ITCPN in any state with a token in p1. If there is no token in p1, then the net is dead. Some of these liveness on epts are related. For example, if an ITCPN is dead in s, then it is also progressive in s. These relations are expressed in the following lemma: Lemma 10

For an ITCPN and an initial state s ∈ S : 1. If the net is dead in s, then the net is progressive in s. 2. If the net is dead in s, then the net is not transient in s. 3. If the net is transient in s, then the net is livelo k free in s. 4. If the net is progressive in s, then the net is weakly progressive in s. 5. If the net is progressive in s, then the net is livelo k free in s. Proof.

We only prove the rst and the last property, the rest is easy to verify. (1) Suppose the net is dead, then ∃k∈IN Rk (s) = ∅. This implies that for any  ∈ (s) there exists a k ∈ IN \ {∞} su h that # = k. Note that k−1 is a terminal state, i.e. k−1 ∈ S T . Re all that for every k−1 ∈ S T : tt(k−1 ) = ∞ (see lemma 7). Therefore, the net is progressive in s (see the de nition of progressive). (5) Suppose the ITCPN is progressive in s, i.e ∀x∈T S\{∞} ∀∈(s) ∃i∈dom() tt(i ) > x.

2.5.

57

SOME FURTHER CONCEPTS AND PROPERTIES

dead

?

progressive





weakly progressive

 R

transient



livelo k free

Figure 2.16: Hierar hy of dynami properties Sin e {y ∈ T S \ {∞} | i ∈ dom() implies that:



( ) = y} ⊆ T S \ {∞}, the progressiveness

tt i

( ) Lemma 7 shows that: i ∈ S T if and only if tt(i ) = ∞. Hen e: ∀∈(s) ∀i dom  ∃j ∈dom() tt(i ) < tt(j ) T ∀∈(s) ∀x∈{y∈T S \{∞} | i∈dom()



i ∈S



tt(i )=y}

∃j ∈dom()

tt j > x

( )

That is, the ITCPN is livelo k free in s. 2 The relations between the liveness properties are shown in gure 2.16. In this monograph we often require a net to be progressive in the initial states. Therefore, we give suÆ ient onditions to guarantee that an ITCPN is progressive. Lemma 11

Let an ITCPN be given with the additional properties: there is an m ∈ IN and an  ∈ T S su h that  > 0 and: ∀t∈T ∀ ∈dom(Ft ) (#Ft ( ) ≤ m) and (∀b∈Ft ( ) 1 (time(b)) ≥ ) then the net is progressive for any initial state s ∈ S having a nite number of tokens (∃n∈IN #s = n). Proof.

Let it be supposed that F satis es the onditions mentioned and s ∈ S su h that #s = n (n < ∞). Now we have to prove that for any  ∈ (s): ∀x∈T S \{∞} ∃i∈dom() tt(i ) > x We an prove this by showing that the following property holds for any x ∈ T S \{∞}: {i ∈ dom( ) | tt(i ) ≤ x} is a nite set

58

'$ '$ &% '$ &% &% CHAPTER 2.

p2

PPPP PqP 1    t1

[0; 0℄

'$ &% '$ &%

A TIMED COLOURED PETRI NET MODEL

-

p3

p5

1    - PPPP PqP t2 [0; 0℄ [0; 0℄

p1

p4

Figure 2.17: A (a y li ) progressive ITCPN We prove this property for any k ∈ IN, x = k, using indu tion. For k = 0 the property holds be ause the number of tokens with a timestamp of 0 is nite (≤ n) and all produ ed tokens have a timestamp of at least , therefore the maximum number of rings with a transition time of 0 is n. Assume, the property holds for x = k, then we prove that it also holds for x = (k + 1). The number of produ ed tokens with a timestamp in (k; (k + 1)℄ is nite, be ause (1) there are only nitely many rings possible with a transition time in [0; k℄ (indu tion hypothesis), (2) the number of tokens produ ed by every ring is nite (see onditions) and (3) we started with a nite number of tokens. Theorem 1 shows us that events with transition time later than (k + 1) do not produ e tokens for (k; (k + 1)℄. Events with a transition time in (k; (k + 1)℄ do not produ e tokens with a timestamp in (k; (k +1)℄ be ause of the minimal delay . Sin e the total number of tokens (produ ed and initially present) with a timestamp in (k; (k + 1)℄ is nite the number of rings with a transition time in (k; (k + 1)℄ is also nite. This implies that the number of rings in (0; (k + 1)℄ is nite (indu tion hypothesis). Indu tion shows that this holds for any k and therefore for any x ∈ T S \ {∞} (use k = min{l ∈ IN | l ≥ x}).

2

Lemma 11 gives us suÆ ient onditions to onstru t a progressive net. However, there are many progressive nets that do not satisfy the onditions stated in lemma 11. Consider for example the net shown in gure 2.17. This net ontains delays equal to 0, nevertheless the net is progressive for any ( nite) initial state s. To extend lemma 11 we de ne a dire ted ir uit as follows:

De nition 19 (Cir uit)

For an ITCPN, a (dire ted) ir uit is a mapping  ∈ IN → T su h that there exists an n ∈ IN su h that dom() = {k ∈ IN | k ≤ n}, n • ∩ • 0 = ∅ and for all i ∈ dom() \ {0}: i−1 • ∩ • i = ∅.

2.5.

59

SOME FURTHER CONCEPTS AND PROPERTIES

Informally speaking: a ir uit (or loop) is a sequen e of inter onne ted transitions and pla es su h that the last transition is onne ted to the rst transition via some pla e. Note that the ar s onne ting the pla es and transitions have to point in the proper dire tion. A net without ir uits is alled a y li . It is easy to verify that an a y li ITCPN is dead for any ( nite) initial state: Lemma 12

Let an a y li ITCPN be given su h that there exists an m ∈ IN and: ∀t∈T ∀ ∈dom(Ft ) #Ft ( ) ≤ m

then the net is dead for any initial state (∃n∈IN #s = n).

s



S

having a nite number of tokens

Proof.

Suppose, we have a net satisfying these onditions. For any token in state s the number of tokens produ ed dire tly and indire tly using this token is nite. If a token in a pla e p1 is onsumed during the ring of a transition, then this ring produ es a nite number of dire t su

essors (≤ m). Be ause the net is a y li , these dire t su

essors (i.e. tokens on the output pla es of the transition that red)

annot be used to produ e tokens for pla e p1 . Consider an arbitrary dire t su

essor in some pla e p2 , this su

essor annot be used to produ e tokens for p1 and p2 (the net is a y li ), et . Hen e, the total number of su

essors of a token is smaller than 1 + m + m2 + ::mk with k = #P . Initially, there are n tokens, therefore the maximum number of onse utive rings is n(1 + m + m2 + ::mk ), i.e. the net is dead.

2

This lemma implies that an a y li net is progressive (see lemma 10). The following theorem shows that if every ir uit in a net ontains a transition whi h produ es tokens with a positive delay (≥ ), then the net is progressive (provided that the initial state has a nite number of tokens). Theorem 2

Let an ITCPN be given with the additional properties: ∃m∈IN ∀t∈T ∀ ∈dom(Ft ) #Ft ( ) ≤ m

and there is an

>

0 su h that for every ir uit : ∃i∈dom() ∀ ∈dom(Fi ) ∀b∈Fi ( )

1 (time(b))

then the net is progressive for any initial state tokens (∃n∈IN #s = n). Proof.

s



S

≥

having a nite number of

The proof of this theorem is similar to the proof of lemma 11. We prove progressiveness by showing that the following property holds for any x ∈ T S \ {∞}:

60

CHAPTER 2.

{i ∈ dom( ) |

A TIMED COLOURED PETRI NET MODEL

tt(i )

≤ x} is a nite set

. We prove this property for any k ∈ IN, x = k, using indu tion. For k = 0 the property holds be ause the initial number of tokens with a timestamp of 0 is nite (≤ n) and the number of tokens produ ed with a timestamp 0 is nite. The number of tokens produ ed with a timestamp 0 is nite be ause we an omit at least one transition in every ir uit , without e e ting the behaviour at time 0. Note that in every ir uit  there is a transition i with i ∈ dom() su h that ∀ ∈dom(Fi ) ∀b∈Fi ( ) 1 (time(b)) ≥ , this means that i produ es tokens with a timestamp of at least . If we (temporarily) remove these transitions we have an a y li net. lemma 12 tells us an a y li net is dead. Hen e, the number of rings with a transition time of 0 is nite. Assume that the property holds for x = k, then we have to prove that it also holds for x = (k + 1). The number of produ ed tokens with a timestamp in (k; (k + 1)℄ is nite, be ause (1) there are only nitely many rings possible with a transition time in [0; k℄ (indu tion hypothesis), (2) the number of tokens produ ed by every ring is nite (see onditions), (3) we started with a nite number of tokens and (4) every ir uit ontains a transition with only positive delays. Theorem 1 shows us that events with transition time later than (k + 1) do not produ e tokens for (k; (k + 1)℄. Events with a transition time in (k; (k + 1)℄ produ e a nite number of tokens with a timestamp in (k; (k + 1)℄, be ause of we an disregard at least one transition in every ir uit (delay ≥ ), i.e. for the rings in (k; (k + 1)℄ it suÆ es to onsider an a y li net. Lemma 12 tells us an a y li net is dead. Hen e, the total number of produ ed tokens with a timestamp in (k; (k + 1)℄ is nite. Sin e the total number of tokens with a timestamp in (k; (k + 1)℄ is nite, the number of rings with a transition time in (k; (k + 1)℄ is also nite. This implies that the number of rings in (0; (k + 1)℄ is nite (indu tion hypothesis). Indu tion shows that this holds for any k and therefore for any x.

2

Theorem 2 enables us to re ognise the progressiveness of many nets by observing the de nition of the net only, i.e. we an prove that an ITCPN is progressive without

onsidering the set of rea hable states or possible ring sequen es. Figure 2.18 shows a net having a ir uit and a delay `zero'. Yet, we an prove that this net is progressive (for any nite initial state), by applying theorem 2. 2.6

Interesting performan e measures

It is useful to show that an ITCPN satis es ertain properties, su h as progressiveness and boundedness. However, we are also in need of on epts to al ulate the performan e of the system modelled by an ITCPN. With performan e we mean

hara teristi s, su h as: response times, o

upation rates, transfer rates, throughput times, failure rates, et .

2.6.

61

INTERESTING PERFORMANCE MEASURES

'$ '$ '$ PPPP PPPP 1 1     P  P qP qP &% &% &% '$ PPPP '$ 1iPPPP '$      PqP PP y )  &% &% &% p6

p4

p2

[1; 3℄

[1; 1℄

[0; 0℄

t1

[3; 7℄

t2

p5

p3

p1

Figure 2.18: A progressive ITCPN

   •

k



[2; 2℄

v

 -  -

[0; 0℄

environment

p1

- 

t1

   - -  -   p3



[1; 3℄

p2

[0; 0℄

t2

the queueing system

[0; 0℄

p4

- 

w

-

environment

Figure 2.19: A queueing system whose environment is modelled expli itly

When analysing the performan e of a system, there are three important aspe ts: (1) the behaviour of the system, (2) the initial state of the system and (3) the behaviour of the environment of the system. Clearly, performan e measures su h as o

upation rates and response times also depend upon the initial state of the system (e.g. the initial number of apa ity resour es) and the environment of the system (e.g. the number of requests per hour). The fa t that the performan e of a system depends on the behaviour of environment, stimulated many authors working on (timed) Petri nets to model the environment of the system expli itly. Consider for example the single server queue shown in gure 2.19. Tokens in pla e p1 represent arriving ustomers (e.g. jobs). Every job requires some servi e (servi e time between 1 and 3). There is only one server (e.g. a ma hine) modelled by a token in pla e p2 or p3 (but not in both). Jobs leave the system via pla e p4 . If we want to analyse the performan e of this net (e.g. throughput), then we may de ide to model the environment expli itly. To model the arrival of jobs we add an extra pla e (k) and a transition (v ). If the initial state is su h that there is one token

62

CHAPTER 2.

A TIMED COLOURED PETRI NET MODEL

     -- - - -     p3



••• •• •• p1

t1

[1; 3℄

p2

[0; 0℄

t2

[0; 0℄

p4

Figure 2.20: A queueing system whose environment is simulated by the initial state in pla e k, then the interarrival time of jobs is equal to 2. If we want to analyse the system under various ir umstan es, we have to adapt the net de nition. The ITCPN model allows for an alternative approa h. This approa h uses the initial state to represent the behaviour of the environment of the system. Now it is possible to analyse the system under various ir umstan es without having to hange the net des ription. Figure 2.20 shows the single server queue modelled by an ITCPN with an initial state whi h also spe i es the behaviour of the environment. Initially p1 ontains tokens with timestamps des ribing the time of their arrival. In this approa h, the net is onsidered to be a fun tion or algorithm that an be applied to some initial state, i.e. given an initial state the net ` al ulates' the dynami behaviour of the system. Note that it is not possible to use this approa h to model environments whi h `intera t' with the system, i.e. an environment whi h gives feedba k. However, the ITCPN model also allows for the expli it modelling of omplex rea tive environments, whi h annot be modelled using the initial state. In many ases it is very onvenient to simulate the environment by hoosing a suitable initial state, be ause we often want to analyse a number of alternatives under various ir umstan es. The latter approa h prevents us from having to hange the net des ription every time we vary the load of the system. In a way, this approa h looks upon the net as a `bla k box' whi h responds to inputs generated by the environment. Another advantage of this approa h is that it allows for a stepwise analysis of large nets. Consider for example gure 2.21, where the re tangles A, B , C and D represent subnets. In this example, we are able to analyse subnet A in isolation, be ause A is not in uen ed by the rest of the net. A thorough analysis of subnet A gives us all possible `inputs' for subnets B and C . If we have analysed B and C , then we an analyse D . Now we are able to tell something about the `overall' performan e of the system. There are two reasons why most authors model the environment expli itly. The rst reason for this is that they use models with time in transitions or time in pla es instead of time in tokens. Consequently, they are unable to express events

2.6.

63

INTERESTING PERFORMANCE MEASURES

 Æ

 Æ A



 R

 Æ -

C

-

 Æ B

-

-

 Æ   Æ

R - D 

-

 Æ

Figure 2.21: Stepwise analysis of a large net and onditions in the future using the initial state only. Consider for example the queueing system shown in gure 2.20, to spe ify the arrival of an extra job at time x, they need to add an extra transition. The se ond reason is that they are interested in the steady-state behaviour of a system. A steady-state fun tioning of the net is only possible if the environment has some `regular' behaviour. In this ase, it suÆ es to model the environment by a simple subnet. What are the typi al performan e measures de ned in Petri net literature? People working on deterministi timed Petri nets are mainly interested in the minimal y le time of a periodi ally operated Petri net. The y le time is the time it takes to omplete a ring sequen e leading to a state having a marking equal to the initial state. See [62℄, [107℄, [28℄ and [113℄ for further information. Resear hers using sto hasti timed Petri nets are interested in the steady-state distribution, i.e. the probability of being in a spe i marking. It is possible to derive several interesting performan e measures from su h a steady-state distribution, see for example Ajmone Marsan et al. [83℄ or [80℄. Many of systems we are interested in, are not stable, i.e. we also onsider pro esses having an initial transient period and pro esses whi h never stabilize. Consider for example a produ tion unit, at the beginning and ending of a working-day there are all kinds of disturban es and the load of the produ tion unit may vary during the day. The fa t that we use interval timing and our interest in the analysis of non-stationary pro esses for es us to develop new performan e measures. These are de ned in the remainder of this se tion. If one models systems where time aspe ts are important, one is often interested in

hara teristi s, su h as throughput times and response times. This is the reason we developed the measures earliest and latest rst arrival time for a pla e in the net. The earliest (latest) rst arrival time of a pla e p is the largest (smallest) lower (upper) bound for the timestamp of the ` rst' token in pla e p (given some initial state).

64

CHAPTER 2.

A TIMED COLOURED PETRI NET MODEL

De nition 20 (EAT ; LAT )

Given an ITCPN, a state s ∈ S and a pla e p ∈ P we de ne: EAT (s; p) = LAT (s; p) =

min

min

min(i p)

max

min

min(i p)

∈(s) i∈dom() ∈(s) i∈dom()

for the earliest rst arrival time and the latest rst arrival time respe tively. To larify these on epts we give a small example. Let the ITCPN shown in gure 2.20 be de ned by:

P = {p1 ; p2 ; p3 ; p4 } Vp1 = Vp4 = {`job'} Vp2 = {`busy'} Vp3 = {`free'} T = {t1 ; t2 } I = {t1 ; [p1 ; p3 ℄ ; t2 ; [p2 ℄ } O = {t1 ; {p2 } ; t2; {p3 ; p4 } } Ft1 ([p1 ; `job' ; p3 ; `free' ℄) = [p2 ; `busy' ; 1; 3 ℄ Ft2 ([p2 ; `busy' ℄) = [p3; `free' ; 0; 0 ; p4; `job' ; 0; 0 ℄ Let it be supposed that we have an initial state s with one token in pla e p1 and one token in pla e p3 , and both tokens have a timestamp 0. It is easy to see that: EAT (s; p1 ) = LAT (s; p1 ) = 0 and EAT (s; p3 ) = LAT (s; p3 ) = 0. In this ase, t1 res at time 0 followed by a ring of t2 at some time between 1 and 3. This implies that: EAT (s; p2 ) = 1, LAT (s; p2 ) = 3, EAT (s; p4 ) = 1 and LAT (s; p4 ) = 3. Note that EAT (s; p) and LAT (s; p) are only de ned for the rst token to `arrive' in p. However, it is possible to generalize these on epts for a set of initial states A ⊆ S and n tokens:

De nition 21 (EAT n ; LAT n )

For an ITCPN, a set of states A ⊆ S , a pla e p ∈ P and n ∈ IN \ {0} we de ne: EAT n (A; p) = LAT n (A; p) =

where bminn b = min^b⊆b

min

min

bminn (i p)

max

min

bminn (i p)

∈(A) i∈dom() ∈(A) i∈dom() ∧

^ #^b=n (max b).

If a bag b ∈ IB(T S ) ontains at least n elements, then bminn b is the nth timestamp in the bag (sele ted in as ending order), otherwise bminn b is in nite. If EAT n (A; p) = x, then x is the smallest value su h that there exists a path starting in a state s ∈ A that visits a state with at least n tokens in p ea h with a timestamp

2.6.

INTERESTING PERFORMANCE MEASURES

65

less or equal to x. If LAT n(A; p) = x, then x is the largest value su h that there exists a path su h that all the states visited by this path do not have n tokens in p ea h with a timestamp smaller than x. Note that EAT n({s}; p) = EAT (s; p) and LAT n ({s}; p) = LAT (s; p). If p is a sink pla e (i.e. p• = ∅), then EAT n(A; p) an be interpreted as a lower bound for the arrival time of the nth token, that is earliest nth arrival time. In this

ase, LAT n(A; p) an be interpreted as the latest nth arrival time. Again, we use the net shown in gure 2.20 to illustrate these performan e measures. Suppose we have an initial state s = {−1; p3; `free' ; 0 } ∪ {i; p1; `job' ; 2i | i ∈ IN}, i.e. a state with one token in p3 (timestamp 0) and an in nite number of tokens in p1 (timestamp 2i). Note that the interarrival time between two jobs is 2 time units. If n ∈ IN \ {0} then EAT n(s; p1) = LAT n(s; p1) = 2(n − 1), EAT n (s; p4 ) = 2n − 1 and LAT n (s; p4 ) = 3n. The throughput time of the nth job, i.e. waiting time and servi e time, is between EAT n(s; p4) − LAT n(s; p1) = 1 and LAT n (s; p4 ) − EAT n (s; p1 ) = n + 2. The following lemma tells us that it is also possible to de ne the earliest and latest nth arrival time (i.e. EAT n and LAT n ) re ursively. Lemma 13

EAT n (s; p) = bminn (s p)

min mins^∈R(s) EAT n(^s; p) LAT n (s; p) = bminn (s p) min maxs^∈R(s) LAT n (^ s; p) Proof.

We derive the rst equation in a number of steps: bminn(s p) min mins^∈R(s) EAT n(^s; p) = | bminn(s p) min mins^∈R(s) (min^∈(^s)mini∈dom(^) bminn(^i p)) = < real;

ommit from bool;

onditions from real; age from real; material from prod -> real; task from operation >< apa ity; route from (num -> (lo ation >< $task)) >< num;

Table 5.1: Some basi type de nitions of other building blo ks. ExSpe t supports the user of this library in making his own building blo ks from already existing ones. This way the user is enabled to make omplex hierar hi al models with a lot of levels. Therefore, we provide some guidelines: (1) the number of levels in the hierar hy (visible to the user) should be smaller than 6, (2) the number of di erent building blo ks at the same level (in a subsystem) should be smaller than 10. In other words: avoid a shallow or extremely deep hierar hy. Note that these gures are only guidelines, they depend on the system to be modelled.

5.5.1 The type de nitions In se tion 5.4 we presented a taxonomy of the ows inside a logisti system. We will use this to lassify the type de nitions used by the logisti building blo ks. A list of basi type de nitions is given in table 5.1. The type material is a mapping from produ ts (prod) to reals representing the quantity of ea h produ t. The type timewindow is used to denote an interval of time. Another interesting type is the type route. A route is a list of pairs and a pointer pointing to a pair in the list. Ea h pair is formed of a lo ation and a set of tasks. The pointer is used to identify the urrent lo ation and the tasks to be exe uted at this lo ation. Note that the list is implemented as a mapping from num to lo ation >< $task. Table 5.2 shows a value of type route. We have de ned some standard fun tions for this type:

5.5.

A LOGISTIC LIBRARY

num

lo ation

1

'EindhovenDC'

2

'ParisPU8'

3

'LyonPU9'

4

'MadridDC'

213

route

$ task operation

apa ity

'drillingFA8'

2.55

'grindingDR7'

1.08

'grindingRT6'

1.29

'paintHG9'

4.93

'polishIR7'

0.08

Table 5.2: A value of type

route

num

2

214

CHAPTER 5.

MODELLING LOGISTIC SYSTEMS

{ 1.1

type goods from id >< route >< material; { 1.2

type means from id >< (operation -> apa ity) >< age; { 2.1.1

type realtimeprod ommand from material >< means >< task >< material; type realtimeprodsignal from material >< $means; { 2.1.2

type aggprod ommand from prod -> ((timewindow -> real) >< onditions); type aggprodsignal from (prod >< timewindow) -> real; { 2.1.3

type type type type type type type type

deliver ommand from goods; re eivesignal from goods; sto klevel from material; a

eptedorder from goods >< timewindow; replenish ommand from (prod >< timewindow) -> real; replenishsignal from material; ordervolume from ((prod >< timewindow) -> real) >< (material); orderlimit from prod ->((timewindow -> real) >< onditions);

{ 2.1.4

type replenishmentstrategy from prod -> (str >< real >< real >< real); type inventorylevels from prod -> (real >< real >< real); { 2.1.5

type route ommand from (num -> (lo ation >< $goods >< $goods)) >< means; type routesignal from means >< lo ation; type availabletrans ap from timewindow -> (operation -> ( apa ity >< onditions)); type a

eptedtransorder from goods; { 2.1.6

type transportstrategy from str >< real >< real >< real; type transportperforman e from real >< real >< real; { 2.2

type request from id >< route >< material >< timewindow >
< ommit; type response from id >< route >< material >< timewindow >
< ommit; { 2.3

type report from str; { 2.4

type admin from str; { internal types

type billofmaterial from prod -> (material >< task);

Table 5.3: Some logisti type de nitions

5.5.

A LOGISTIC LIBRARY

215

export urrent[ x : route ℄ := pi1(x).pi2(x) : lo ation >< $task; export atend[ x : route ℄ := all([i : dom(pi1(x)) | i = pi2(x) ℄) : bool; export next[ x : route ℄ := pi1(x).min(set([i : dom(pi1(x)) | i > pi2(x)℄)) : lo ation >< $task; export prev[ x : route ℄ := pi1(x).max(set([i : dom(pi1(x)) | i < pi2(x)℄)) : lo ation >< $task;

All other types de nition in table 5.1 are self-explanatory. Table 5.3 shows some other type de nitions, ea h orresponding to a spe i kind of

ow in a logisti system. The ow of goods is represented by the type goods. Goods

owing through the network have an identi ation, some routing information and some materials asso iated with it. Examples of obje ts of type goods are: a tru k load, a pallet, a par el or a single produ t. Table 5.4 shows a value of type goods representing a set of parts, needed to produ e a ar with identi ation 897654. Note that urrently the parts are lo ated in Paris, where they have to be assembled. Obje ts of type means have an identi ation, an age and a apa ity for ea h kind of operation the obje t an perform. This type is used to spe ify apa ity resour es, su h as ma hines, tru ks, et . Client/server intera tions are represented by obje ts of the type request and response. A request has an identi ation, a route, a ontents (material), a time

window, a ondition and a ommit eld. The usual interpretation of a request is: ` an you deliver me some materials within a time window, given some onditions'. If the ommit eld is `true', then the request is automati ally satis ed if possible. The

onditions eld is used to spe ify the requested onditions, for example maximal pri e or minimal quality. In all ases a request is followed by a response having the same identi ation. The other types (mainly master/slave intera tions) will be dis ussed when we des ribe the orresponding building blo ks. Note that we hose `the easy way out' to model reports and administrative information.

216

id

897654

CHAPTER 5.

num

lo ation

1 2

'EindhovenDC' 'ParisPU8'

3

'LyonPU9'

4

'MadridDC'

route

MODELLING LOGISTIC SYSTEMS

goods

$ task num operation

apa ity

'drillingFA8' 'grindingDR7' 'assembleRT6' 'paintHG9' 'polishIR7'

2.55 1.08 1.29 4.93 0.08

2

material prod real

' hassisX19' 'wheelT45' 'engineFM11'

1 4 1

Table 5.4: A value of type goods 5.5.2

The supply system

The rst building blo k we are going to des ribe is the supply system. The supply system is used to represent one or more suppliers taking are of the input of raw material and omponents into the logisti hain. Note that a supply system (partly) de nes the s ope of the logisti hain we want to onsider (i.e. the system boundary), be ause in our library a supply system is the `sour e' of materials. The header of the supply system is shown below: sys supply[in request:request, out response:response, outgoods:goods, val lo ation:lo ation, expe tedhandlingtime:real, a

eptrule:(prod->((real>< onditions)), averagesupplydelay:(real>(real>((lo ation->num)>< onditions)), expe tedorderleadtime:real, demand:(prod->((real>real, maxprodlevel:(prod>real, inpro essinv:material, freemeans:$means, busymeans:(means->(real>< $replenish ommand) ℄

224

CHAPTER 5.

prod

' nished arMB2' ' arMB2' 'bikeFX3'

MODELLING LOGISTIC SYSTEMS

billofmaterial material task prod real operation apa ity

' arMB2' 'wheelF3' ' hassisG1' 'wheelH2' ' hassisP1'

1. 4. 1. 2. 1.

'paintCS3' 'assemble'

0.2345 7.6435

'assemble'

5.3645

Table 5.5: A value of type billofmaterial

The ontroller re eives ommands via the input pin in ommand of type: type aggprod ommand from prod -> ((timewindow -> real) >< onditions);

This ommand spe i es the maximum produ tion levels for ea h period. The value parameter reporttime spe i es the time between two su

essive reports. The behaviour of the realtime ontroller system is mainly spe i ed by the fun tion parameter produ efun tion. The demand parameter of this fun tion represents the a tual demand for ea h period, maxprodlevel gives the (maximum) produ tion levels set by some higher authority, inpro essinv is the inpro ess inventory, freemeans are the means ready to perform a task. The parameter busymeans represents the means that are performing a task, their expe ted termination time and the expe ted yield (material). The parameter bom spe i es all produ tion steps and is of type: type billofmaterial from prod -> (material >< task);

Table 5.5 shows an example of su h parameter. If a produ t is not in the domain of the mapping, then it has to be ordered, i.e. the realtime ontroller system sends a `replenishment ommand' to the pro urement system. Note that the produ efun tion returns zero or more ommands for both the transformer system and the pro urement system. Using this fun tion parameter it is possible to implement many produ tion ontrol methods (for example MRP). The realtime ontroller also ontrols the a

eptorders system, it spe i es the maximum ordervolume that an be a

epted for ea h period. The building blo k pu distinguishes between aggregate produ tion planning and detailed (real-time) produ tion ontrol. Inside the produ tion unit jobs are s heduled for a spe i ma hine (means), the outside world is not aware of the existen e of

5.5.

A LOGISTIC LIBRARY

225

ma hines. The same holds for the intermediate produ ts needed to produ e an endprodu t, for example sub-assemblies. The produ ts ontrolled by the outside world are the so- alled goods ow ontrolled items (see Bertrand et al. [18℄). Typi al produ ts to be ontrolled outside the pu system (i.e. via in ommand and outstatus) are the MPS-items. 5.5.5

The sto k point

In this se tion we des ribe a number of building blo ks to model inventories. We start with the sp system, where sp stands for sto k point. Examples of sto k points are a regional warehouse, a distribution entre or a storage area ontaining supplies and raw materials. The main hara teristi of our sto k point is that it has a more or less autonomous behaviour. The header of the sp system is: sys sp[in in ommand:replenishmentstrategy, responsein:response, ingoods:goods, requestin:request, out outstatus:inventorylevels, requestout:request, outgoods:goods, responseout:response, val reporttime:real, lo ation:lo ation, suppliertable:(prod->((lo ation->num)>< onditions)), expe tedorderleadtime:real, expe tedhandlingtime:real, fun replenish[s:replenishmentstrategy,physi alsto k:material, demand:((prod>real), ordered:((prod>real) ℄:replenish ommand, orderlimit[s:replenishmentstrategy,physi alsto k:material, demand:((prod>real), ordered:((prod>real) ℄:orderlimit, handleintime[x:material℄:real, handleouttime[x:material℄:real ℄

There are four input pins and four output pins. The pins ingoods and outgoods represent the ow of goods in and out of the sto k point. If some external party needs some produ ts, it sends a request to the sto k point via the hannel onne ted to requestin. The sto k point responds via responseout. The main obje tive of a sto k point is to keep inventories of ertain produ ts, if the inventory level of a produ t falls below a ertain level or we want to anti ipate on future developments, then a replenishment is needed. To order the produ ts ne essary for su h a replenishment, we have the pins requestout and responsein. The replenishment strategy an be altered by some `higher' authority via the in ommand and outstatus pins. The

226

CHAPTER 5.

MODELLING LOGISTIC SYSTEMS

meaning of the value and fun tion parameters will be dis ussed when we des ribe the subsystems of sp shown in gure 5.31. i incommand

o outstatus

stockcontrol

rc

rs

ol

ov

o requestout

i requestin

i responsein

o responseout

i ingoods

replenish

distribute g

o outgoods

Figure 5.31: The sto k point The system sto k ontrol ontrols the other two logisti subsystems replenish and distribute: sys sto k ontrol[in in ommand:replenishmentstrategy, rs:replenishsignal, ov:ordervolume, out outstatus:inventorylevels, r :replenish ommand, ol:orderlimit, val reporttime:real, fun replenish[s:replenishmentstrategy, physi alsto k:material, demand:((prod>real), ordered:((prod>real) ℄:replenish ommand, orderlimit[s:replenishmentstrategy, physi alsto k:material, demand:((prod>real), ordered:((prod>real)

5.5.

227

A LOGISTIC LIBRARY

℄;

℄:orderlimit

This system has an interfa e with some higher authority whi h tells the system to hange its replenishment strategy. This strategy is de ned for ea h produ t, see table 5.3. A strategy has a name and a number of parameters. Based on this strategy and the fun tion parameter replenish the system issues replenishment ommands via output pin r . The parameters of the fun tion replenish are the strategy (s), the urrent sto k (physi alsto k), the ba korders and expe ted demand (demand) and the produ ts already ordered (ordered). The input pin rs keeps the sto k ontrol system informed about the (physi al) replenishments. The output pin ol of type orderlimit is used to pass the upper bounds for the quantity of distributed goods in ea h period to the distribute system. Note that these maximum order quantities are al ulated using the fun tion parameter orderlimit. The parameters of this fun tion are identi al to the parameters of the replenish fun tion. The input pin ov keeps the sto k ontrol system informed about the physi al sto k (material) and the a tual demand for produ ts ((prod>real). From time to time the system reports the physi al sto k level, the demand level and the amount of ordered produ ts using the output pin outstatus. The time between two su

essive reports is set using the reporttime parameter. The system replenish takes are of the ordering of goods to replenish the sto k: sys replenish[in in ommand:replenish ommand, response:response, ingoods:goods, out outsignal:replenishsignal, request:request, outgoods:goods, val reporttime:real, lo ation:lo ation, suppliertable:(prod->((lo ation->num)>< onditions)), expe tedorderleadtime:real ℄

The meaning of the input and output pins follows dire tly from gure 5.31. The

replenish system a

epts all goods addressed to the lo ation parameter and sends them to the hannel onne ted to outgoods. Periodi ally, the total quantity of

a

epted goods is reported. The time between two su

essive reports is spe i ed by the value parameter reporttime. The value parameters suppliertable and expe tedorderleadtime are used to order the produ ts. The system distribute a

epts orders, stores produ ts and distributes them:

228

CHAPTER 5.

MODELLING LOGISTIC SYSTEMS

sys distribute[in in ommand:orderlimit, request:request, ingoods:goods, out outstatus:ordervolume, response:response, outgoods:goods, val lo ation:lo ation, reporttime:real, expe tedhandlingtime:real, fun handleintime[x:material℄:real, handleouttime[x:material℄:real ℄

The meaning of the pins is straightforward given gure 5.31. The distribute system reports the urrent inventory level and the a

epted orders from time to time (as spe i ed by reporttime) via the output pin outstatus. The value parameter expe tedhandlingtime is used to determine whether it is possible to deliver within the requested time window. An upper bound for the number of produ ts that an be supplied in ea h period is given via the input pin in ommand. The two fun tion parameters represent the time it takes to store and the time to pi k some material. i incommand

o outsignal

replenishcontrol

rc

rs

o request procurement i response

i ingoods

o outgoods acceptgoods

Figure 5.32: The replenish subsystem Now it is time to take a loser look at the logisti subsystems replenish and

5.5.

A LOGISTIC LIBRARY

229

distribute. Figure 5.32 shows the internal stru ture of the replenish system. It ontains three subsystems: replenish ontrol, pro urement and a

eptgoods. The replenish ontrol system passes the replenishment ommands to the pro urement system and reports the total amount of re eived goods for ea h period. sys replenish ontrol[in in ommand:replenish ommand, rs:re eivesignal, out outsignal:replenishsignal, r :replenish ommand, val reporttime:real ℄

The value parameter reporttime is used to spe ify the time between two su

essive reports via outsignal. Every re eipt of goods is reported by the a

eptgoods system via the pin rs. The header of the a

eptgoods system is: sys a

eptgoods[in ingoods:goods, out rs:re eivesignal, outgoods:goods, val lo ation:lo ation ℄

Note that the pro urement system is also subsystem of demand and pu. The internal stru ture of the distribute system is shown in gure 5.33. The subsystem a

eptorders handles the in oming requests for goods and reports all a

epted orders to the distribution ontrol system. Note that a

eptorders was also used in the supply and pu system. The ontrol system distribution ontrol passes the maximum order quantity for ea h period to the a

eptorders system. It also ontrols the sto kholding system by issuing ommands via the output pin d of type deliver ommand. sys distribution ontrol[in in ommand:orderlimit, ss:sto klevel, ao:a

eptedorder, out outstatus:ordervolume, d :deliver ommand, ol:orderlimit, val reporttime:real, expe tedhandlingtime:real ℄

The parameter reporttime represents the time between two su

essive reports issued via the output pin outstatus. The parameter expe tedhandlingtime is used to time the deliver ommands to the sto kholding system. The sto kholding system sends updates of the a tual sto k level to the distribution ontrol system.

230

CHAPTER 5.

i incommand

MODELLING LOGISTIC SYSTEMS

o outstatus

distributioncontrol

ol

dc

ao

ss

i request

o response acceptorders

stockholding o outgoods

i ingoods

Figure 5.33: The distribute subsystem The header of the sto kholding system is: sys sto kholding[in d :deliver ommand, ingoods:goods, out ss:sto klevel, outgoods:goods, val lo ation:lo ation, fun handleintime[x:material℄:real, handleouttime[x:material℄:real ℄

This system represents the physi al warehousing pro ess. The main a tivities are: a

ept goods, store goods and orderpi king. The time to store some material is given by the fun tion parameter handleintime. The time it takes to fet h something is given by handleouttime. 5.5.6

The transport system

Finally, we dis uss the building blo ks asso iated with transport. In many ases it is suÆ ient to model transport by a `delay'. For example, add the transport time to the handleouttime in the sp system. If we want to model transport in more detail, we an use the transport system. A typi al example that an be modelled using

5.5.

A LOGISTIC LIBRARY

231

this system is a transporter with a number of tru ks. The header of the transport system is: sys transport[in in ommand:transportstrategy, response:response, ingoods:goods, out outstatus:transportperforman e, request:request, outgoods:goods, val lo ation:lo ation, produ t hara teristi s:(prod->(operation>< apa ity)), transtable:((lo ation>(real>lo ation), fun routes heduling[ s:transportstrategy,work:$a

eptedtransorder, free:(means->lo ation), busy:(means->(real>(operation>< apa ity)), transtable:((lo ation>(real>(operation>< apa ity)), transtable:((lo ation>(real>lo ation), busy:(means->(real>(operation>< apa ity)), transtable:((lo ation>(real>< availabletrans ap)

5.5.

A LOGISTIC LIBRARY

233



This system ommuni ates about the aggregate ontrol of the transport system with some higher authority using the pins in ommand and outstatus. The pins at and ato are used to intera t with the a

epttransorders system. The output pin at is of type availabletrans ap (see table 5.3), whi h spe i es the remaining apa ity for ea h operation and the onditions (for example pri e). In this ontext the term `operation' refers to the spe i kind of transport required. For example, liquid petrol gas and prefabri ated halets need di erent types of tru ks. But it is possible for a tru k to support di erent kinds of transport, see the de nition of means. If a transport is a

epted, then this is reported to the trans ontrol system. The pins r and rs are used to ommuni ate with the routing system. The type of r is: type route ommand from (num -> (lo ation >< $goods >< $goods)) >< means;

Su h a ommand spe i es a list of lo ations (represented by a mapping) and the transport means involved. For ea h lo ation the goods to olle t and the goods to deliver are given. If a route is ompleted, then the routing system signals the lo ation of the means (rs). The s hedules for routing (route ommand) and the remaining transport apa ity (availabletrans ap) are al ulated using the fun tion parameter routes heduling. The parameters of this fun tion are the strategy (s), the remaining set of a

epted orders (work), the free and busy transport means (free and busy), the hara teristi s of every produ t (produ t hara teristi s) and the average and varian e of the transporttime (transtable). Note that for all busy means the expe ted ompletion time and lo ation of the orresponding route are given. The a

epttransorders system behaves similar to the a

eptorders system. An order is a

epted if there is suÆ ient apa ity and the requested onditions are satis able. sys a

epttransorders[in at :availabletrans ap, response:response, out ato:a

eptedtransorder, request:request, val lo ation:lo ation, produ t hara teristi s: (prod->(operation>< apa ity)) ℄

The routing system takes are of the physi al transport of goods. The a tual transporttime is al ulated on the basis of the parameters transtable and transtime.

234

CHAPTER 5.

MODELLING LOGISTIC SYSTEMS

sys routing[in ingoods:goods, r :route ommand, out outgoods:goods, rs:routesignal, val lo ation:lo ation, initmeans:(means->lo ation), transtable:((lo ation>(real>