Petri nets and Linear Logic as an aid for scheduling batch processes

contraintes continues sont ensuites dщduites de ces dates. ..... 4.1. Principle of the approach. We have seen in section 2 that scheduling a batch process is ...
104KB taille 1 téléchargements 274 vues
Journal Européen des systèmes automatisés

Petri nets and Linear Logic as an aid for scheduling batch processes Ronan Champagnat* — Brigitte Pradin-Chézalviel**,*** — Robert Valette** * L3i, Université de La Rochelle F-17042 La Rochelle Cedex 1

[email protected] ** LAAS-CNRS, F-31077 Toulouse Cedex 4

{chezalvi,robert}@laas.fr *** IUT A, Univ. Paul Sabatier

Toulouse, France ABSTRACT. This paper presents a new approach for scheduling batch processes. This issue is seen as a hybrid constraint satisfaction problem: it is proposed to find one partial order relation among events being consistent with the set of the discrete constraints before considering that of continuous constraints. Discrete constraints are represented by a Petri net and the consistent partial order relation is derived by means of a canonical proof tree of a Linear logic sequent. This requires a series of decisions. Algebraic expressions of dates and durations are obtained. They are symbolic and allow the derivation of sets of continuous constraints.

Cet article présente une nouvelle approche pour l’ordonnancement des procédés discontinus. Elle est vue comme un problème de satisfaction de contraintes hybrides et nous proposons de chercher un ordre partiel qui soit une solution des contraintes discrètes avant de prendre en compte les contraintes continues (numériques). Les contraintes discrètes sont modélisées par un réseau de Petri et l’ordre partiel est déduit de la construction d’un arbre de preuve en logique linéaire. Cela nécessite la prise d’un ensemble de décisions. Des expressions algébriques symboliques des dates et des durées sont alors déduites. Des ensembles de contraintes continues sont ensuites déduites de ces dates.

RÉSUMÉ.

KEYWORDS:

Petri nets, linear logic, batch processes, scheduling

MOTS-CLÉS :

réseaux de Petri, logique linéaire, procédés discontinus, ordonnancement

Signature de l’article : nom de la revue. Volume X - n X/1999, pages 1 à X

2

Signature de l’article : nom de la revue. Volume X - n X/1999

1. Introduction In a batch process, the material is operated by finite quantities (the batches). It looks like a discrete manufacturing system, i.e., a batch of fluid in a vessel can be considered as a part. But the complete characterization of a batch implies real numbers referring to the amount of material and its operating conditions (temperature, pressure, quality, etc). During the transport of material between two equipments, the discrete nature of the product temporarily disappears. The fluid is continuously transferred through a pipe network from an upstream vessel to a downstream one, naturally by gravity or using energy given by special devices (pumps, compressors etc). Production management implies scheduling the operations in the reactors and the transfers between the reactors and the storage tanks and vice versa. In a first approximation, the issue is similar to that of purely discrete systems. However the respective importance of the involved types of constraints are different. For example, storing a batch of product between two operations requires a tank, this means that it is always necessary to obtain the next resource (the storage tank, for instance) before releasing the preceding one (the reactor). Resources are kept during transfer operations. As, in addition, zero delay constraints between two operations are common (if the yoghurt is not immediately cooled at the end of the fermentation it will become acid), the importance of resource management constraints is greater for batch processes than for discrete manufacturing systems. An other important characteristic of batch processes is that operation durations are imprecise. They may depend on observable parameters (the batch volume, for instance, for transfer operations) but also on the quality of the raw material which is not always measurable. As a consequence, scheduling batch processes is a complex issue involving two kinds of constraints: discrete constraints (partial order relations between operations resulting from recipes and resource management) and continuous constraints (operation durations, maximal waits, due dates etc). It is a complex hybrid issue with a close combination of discrete and continuous variables. The discrete variables are order relations ( precedes or precedes ). The continuous variables are the starting dates of the operations. They take their numerical values over a dense time.









2. Scheduling batch processes Various approaches have been developed for scheduling batch processes. When they are based on linear programming, they exploit quantitative data (numerical values). At a fine grained level, resource management constraints are taken into account with difficulty. They result in a combinatorial explosion of the number of decision variables and of the search space. It is also possible to build an abstract model of a batch process by means of a time Petri net and to use the reachable marking class graph (characterization of the

Petri nets for scheduling

3

reachable states taking all the timing restrictions into consideration) to derive feasible schedules. Due to the state space combinatorial explosion, this approach is only possible for real-time scheduling on a very short time horizon [JUL 98]. Recently, it has been stated that hybrid simulation [PAL 99] is the only way to check the consistency of a set of management decisions with respect to all the constraints at a fine grained level. However, a simulation represents the behavior of the system for a set of predefined numerical values of the parameters and of the operation starting dates. It is then difficult to know if a small variation of these values would entail a constraint violation or not. The idea developed in this paper, is to replace this hybrid simulation by a kind of symbolic one. This symbolic simulation is a proof in linear logic. It allows to derive the partial order between the operations which is a consequence of the discrete constraints complemented by the management decisions. Hybrid simulation will remain necessary for a detailed validation of the plan, but the symbolic one will be more efficient during the interaction with decision makers because a symbolic simulation run encapsulates a whole family of possible behaviors as all dates are parametrized by operation durations. Our approach is based on the following observations. Scheduling batch processes is a hybrid constraint satisfaction problem. Mathematically, it is difficult to simultaneously deal with discrete constraints and with continuous ones and so it is better to alternately work with each of them. If the discrete constraints are important and if the continuous ones involve imprecise numerical values, it is better to start with the discrete ones. It may allow a rapid initial diminution of the search space size. We start with a representation of the batch process by means of a t-time Petri net [MEN 85, MER 76]. In such a model, the representation of the continuous aspect is poor but it can be seen as an abstraction of a Differential Predicate Transition net [CHA 99] and we will show, in section 5, how the information provided by the t-time Petri net approach can be enriched in order to be closer to that which could be provided by a discrete event simulation of a Differential Predicate Transition net. The t-time Petri net is then translated into a set of Linear logic [GIR 87] formulas and the required production over the considered time horizon is expressed by a Linear logic sequent which is made up of the initial marking, the operations to be done (a multiset of transitions to be fired) and the final marking. Proving this sequent (a syntactical proof in the framework of Linear logic sequent calculus) allows the derivaand operators) for all the dates and time tion of algebraic expressions (with intervals which are involved in the continuous constraints [PRA 99].





In a Petri net model the representation of the discrete constraints are compact because, in a sequence, each transition may be fired several times although it is represented by a unique element. With an activity-on arc graph, it would not be the case and its size would be much larger than that of the Petri net. During the construction of the sequent proof, the partial order remain implicit and only one proof for one partial order is necessary. It is not necessary to enumerate all the pairs of transition firings and to state if they are ordered or not. Instead of dealing

4

Signature de l’article : nom de la revue. Volume X - n X/1999

with partial order realtions, we use dates: the consequences of the partial order on the firing dates are directly derived from the proof. Consequently this approach decreases the number of discrete decision variables which have to be explicitly considered.

3. Linear logic for reasoning on a Petri net model 3.1. Basic concepts We will just give here the main points in order to understand the approach. For more detail about Linear logic the reader can refer to [GIR 87] and for more detail about Petri nets and Linear logic to [GEH 92] and [PRA 99]. Linear logic has been defined in the framework of sequent calculus. A sequent is proved if and only if it is syntactically correct, that is if it can be proved that each connective can be introduced by using a set of rules. Linear logic can be seen as a restriction of classical logic because its main specificity is the suppression of the contraction and weakening rules in order to deal with resources as logical propositions. Atoms corresponding to logical propositions may be counted, produced and consumed exactly like tokens in Petri net places. It is the reason why there is an equivalence between reachability in a Petri net and the provability of some Linear logic sequents.



In this paper we will just use two Linear logic connectives. The connective represents the simultaneous availability of some resources, the connective corresponds to the linear implication. It represents causality because the atoms on the left side of have to be consumed in order to produce those on the right part. It consequently expresses a precedence relation. Formula expresses that atom has to be produced before because it has to be consumed in order to produce .





        corresponds to a marking A marking   is a monomial in (for instance for which place contains two tokens and place  one token). A transition  is a formula of the form   where  and  are partial markings. The monomial  is another notation for the column of matrix  corresponding to  (denoting the input places of  ) and   for the corresponding column of  (denoting the output places of  ). The firing of a transition is denoted by a sequent. For example, the sequent

 "!# [1] denotes the firing of  from marking  . If  is   $  , this implies that &%'  ( *),+-#.%'   ( [2] The context ( describes the tokens which are not concerned by the firing. The sequent /0! # , where /1%2436575894: is a list of non ordered transitions (a transition may be repeated several times), represents a scenario in which the transitions of / are fired as many times as they are present. The firings are not necessarily done in

Petri nets for scheduling

5

sequence, but they have to be consistent with the partial order relations resulting from the structure of the Petri net (the formulas describing the transitions) and the initial marking of the scenario. So, each proved Linear logic sequent represents a set of valid sequences. In a sequence all the transition firings are ordered. In our approach only the necessary partial order relations are taken into account and we avoid the combinatorial explosion due to interleaving semantics. The traditional token player algorithm checks reachability by firing transitions in sequence, one after the other. The marking vector denotes a collection of tokens at a given time point, between two transition firings. On the contrary, the canonical proof tree of Linear logic sequent calculus as defined in [PRA 99] does not add spurious precedence constraints. In fact, at each step of the proof tree, the considered list of atoms (denoting a collection of time labeled tokens) are not connected by the connective. It is a list of logical propositions which are not necessarily considered at the same time point. A symbolic production date is attached to each atom. This date keeps track of all the transitions which have been fired to produce it. It encapsulates all the causal relations and therefore all the past order relations involving the transition firing which has produced the token corresponding to the atom.



However, a scenario is not necessarily completely specified. In [PRA 99] it has been shown that the canonical proof tree has to be split into two, each time conflicting transitions are encountered. Conflicting transitions are transitions which have to be fired in the scenario and share a common input place (they compete to consume the same atoms). The same problem occurs when a transition can be fired by consuming various tuples of tokens and when, from the symbolic information, it is not possible to decide which tuple is the oldest one (the first produced). Consequently, during the construction of a proof tree, it is necessary to make decisions in order to solve conflicts between transitions and conflicts between tokens. This approach is possible for any ordinary (arc weighted) Petri net, with no restriction. The algorithm of the proof tree contruction is presented in [PRA 99].

3.2. An example Let us consider the Petri net in figure 1. Transitions are represented by the following formulas ( is the enabling durations of ):

;3

3

 < ; =?>@<  BA  < ; 6=?>@<  A 4E < ;$E =?>@@ ;   G< Fa b  ;   F "E `;$E = > ;$JŸ G< Fa b  ;   F "E `;$E =

[21]

Naturally the sets of inequations 20 and 21 have to be associated with the other continuous constraints of the problem such as due dates etc. 4.3.2. Example 2 The preceding example has illustrated the fact that from a completely specified scenario, a set of continuous constraints involving continuous decision variables could be derived. However it is clear that for complex industrial problems the number of possible scenarios will be too large and their enumeration not tractable. During the construction of a proof tree, steps with conflicts are met [PRA 99], the set of constraints generated at this step associated with some heuristics can be used to make a decision and continue the proof tree construction in such a way that the resulting final scenario will be a “good” one. Let us consider the net in figure 3 to illustrate this approach. Each operations is denoted by two transitions. Decisions (possibly no decision, that is firing as soon as possible) are attached to , and , and , and denote ends of operation. Operation durations are attached to , and and , and are the durations of the instances of the corresponding operations ( firing of the transition). Decision variables are attached to the firings of the transitions (enabling and firing dates are identical because no duration is attached). Variables are instances of decision variables and , and are the dates of the first, the second and the third firing of transition respectively.

ƒ i  € ;   € ;   ; €3 ¡¥_; [¢ ¤;$3

¡£¢G¤

F ƒ F ƒ ƒ

;  63

F ƒ$3

F ƒ$E

ƒ

At the first proof step transition is fired without any conflict and therefore as soon as possible. If the initial dates of all the tokens are zero, then . Transitions

F ƒ  %'¦

12

Signature de l’article : nom de la revue. Volume X - n X/1999

€ , i i , and ; are fired with no conflict (the first firing of i is fired as soon as possible): F §%;_€‰ (;€6 is the enabling duration attached to the first firing of € ). The current step is then  < ¦ =   < ¦ =  Hl< ;_€‰ \;;] = AI < ¦ = A < ;_€‰ =  ›  < ¦ = [22] Transitions ƒ (second time) and  may be fired and they are not in conflict because we have two instances of A . Sequence $eK  is fired on date F   %¨;€  ;_;  (the  of the token dates in H and AI ) and sequence ƒ†e€ is fired on date F ƒ  %¦ :  < ¦ = K( < ;€ = ~ < ;€  bh ;;  \;   C=  [23] A < ;€  b;;  \;   K=   < ;€  \;; K=  ›  < ;_€  \;; 4= Transitions are fired in such a manner that causality is respected, but not within a global notion of time as in the case of a discrete event simulation. We have no calendar and although is greater than for non zero durations, the second firing of may be considered before the first firing of .

F 

F ƒ

ƒ

i e;



Then is fired, as soon as possible, on date current step is:

F i ©%21* < ;€;€6 \;_;] = . The

 < ¦ =  Hl< ;;cb < ;_€DK;€6 \;;] =m=  ~ < ;€6 ;_;] \;  $ =  ›  < ;€6 \;;, =  A < ;_€‰ \;;] `;  $ = AI <  < ;_€DK;€6 \;;] =4= F ƒE

ƒ

[24]

F Z



Now transitions (third firing on date ) and (second firing on date ) can be fired and a decision has to be made because, although there are two tokens in , they are not ordered ([PRA 99]). We have two conflicting transitions and the two alternatives are:

A

F Yƒ E% F  %

;€  \;_;  \;    ;;ªŸ1* < ;€  ;€  \;_; 4=

[25]

or

F ƒ E % 1 * < ;€;€6 b;;] = F 6% 1 * < ;€6 \;;, \;  $Z;;_c«1 < ;€Y;€6¬\;;] =4=

[26]

Alternatives 25 and 26 will entail two different partial orders and therefore two sets of continuous constraints. The decision can be based on heuristics and only one of these two sets generated. For example with alternative 25, each reactor is alternatively used for the first reaction (place ) and the second one ( ). In contrast, with alternative 26 one reactor is allocated to the first reaction, and the other one, after one allocation to the first reaction, is allocated to the second reaction.

L



;€3 ;;Y3

;  63

If the order of magnitude of all the parameters ( , and ) are known, those of decision variables and can be derived. For example if are small with

F ƒ$E

F 

;;$3

Petri nets for scheduling

;€ 3 ;   3 € F Z $ª €

13

respect to reaction durations and and if these durations can be approximated by , then for 25 can be approximated by and by and for 26 can be approximated by and by . Consequently, alternative 25 favors short makespans (priority to batches being processed) and alternative 26 favors equipment utilization (priority to the introduction of new batches).

F ƒE

€

ªY€

F 6

F ƒE

€

5. Abstracting and enriching the hybrid aspect The approach, introduced in this paper, is purely symbolic. Parameters such as or can be eventually replaced by numerical values in order to associate the generated constraints with other ones (for example due dates) and compute a solution. If the model is a t-time Petri net, possibly derived from a Differential Predicate Transition net as shown in [CHA 99], these numerical values will be delimited by time intervals. For instance, if is associated with transition then . Predicates such as possibly before or necessarily after as defined in [DUB 89] can be used in the constraints. If the numerical values are fuzzy and delimited by trapezoidal sets, the approach can be easily extended after a definition of the operator “ ” in this context.

;€3 , ;_;$3

;  63

² ¡ ;_€ 3c³ ­´®D¯ 38: ®¯ …°*±

­ ®D¯ 37: K®D¯ …C°±

€

1

But, as our approach is based on a symbolic computation, the hybrid aspect of batch processes can be better taken into account. If the operation durations can be expressed as explicit analytical expressions of some parameters attached to the batches and/or to the equipments (the parameters have to be attached to the tokens enabling the transitions, they cannot be global variables), these expressions can replace the corresponding variables in all the derived constraints. For example, if the first reaction durations depend on the batch volumes ( is the volume of batch ), then and the date of atom in 24 will be:

H

›3

Hl< ;;  1* < µ¶5 ›  ,µ 5 ›  ;_; K=

¡

;€3c%'µ 5 › 3

[27]

The set of equations describing the continuous constraints in the framework of a completely specified scenario will be more complex, but also more accurate. Limited storage capacity constraints play an important role in batch process scheduling. It is necessary to prevent any overflow for all the intermediate storage tanks. This kind of constraints can be taken into account in our approach if each configuration of the considered storage tank (being filled, emptied or isolated, for example) is explicitly represented by a place in the Petri net model and if the continuous dynamic can be approximated by a linear function of time. The formulation of the limited capacity constraint is then based on the formal expression giving the sojourn time of the token in the corresponding places as defined in [PRA 00]. In this paper it has been shown that, as the computation was a formal one, the imprecision resulting from the past behavior was eliminated and the delimitation of the sojourn time was the evolution of the tank volume is : accurate. If in place

·,‚638¸´¸

› <  = % › W bµ¶5 

[28]

14

Signature de l’article : nom de la revue. Volume X - n X/1999

· ‚Z38¸´¸ is Fº¹ and its consuming date is F» , µ¶5