and that leads mk to perform Oj on Pi . The arrows with no label have the identity (associated with) as incidence function. The functions pri are the ith projections (pri«x I,x2, .. . xi ... xn> = Xi)· An example of ~2(t3) : ~2(t3) = M(BS) x M(BS).no x M(IM) where M(p) is the set of tokens currently in the place p and K.a is the set of the values of of the objects elements of set K (eg. the elements of M(IS).no are the values of the attribute Pi.no (next operations to be performed on Pi) for every part Pi in place SE); such that t is the such that any ti, i=1,2, ...n, is an input transition of p. We call free-choice poly- transition structure any poly-transition structure such that: Pre(ti,p)(u) -:;:. Pre(tj,p)(u ') 't;j i,j = such that : - 11l*(t)1 < I or - Pre(t,p)(u) -:;:. Pre(t,p)(u') 't;j u,u' E J.1 *(t), U i=I ,2, ... n , i=I,2, . .. n , is called maximal if the set {tl ,t2 , ... ,tn} is max imal for the propriety (conflict structure ). Let SI= < pi, TI > and S2 =< p2, T2 > be two maximal CS . S I and S2 are said adjacent if TI ® T2;f. 0. S = {S I, S2, ... , Sn} is called a co mposed S C (maximal) if - every structure Si i=1.2 , ... n, is a maximal CS. - VS, E S,:3 Sj E S such that S, and Si are adjacent - VSi e S a maximal CS, V SJ E S. Si and SI are not adjacent has a maximal CS adjacent (all in a composed CS) , then some elements of A(p,Tc,U,T) could also belong to another A(p' ,Tc'.U',T) . In such case, one should solve a unique linear program . The constraints are those of both n(p.TC ,U,T) and n(p',TC'.U',T). The objective function is X~v) . ftv) -
t6
Fig. 3. Example of PNOM
2.1. Definitions
two complementary models (data structuring and dynamics modelling). OPCO interacts with physical entities of the system to be controlled (events. physical operations). It is not autonomous. We first define the corresponding autonomous model called : Petri Net with Object-oriented Marking.
2. Petri Net with Marking (PNOl\1).
A PNOM is a IO-uple
< D, P. T.1l1. Pre, Post, 112, pI. (DI , mO >. - D is a set of classes and objects. D is the domain or the data part of PNOM (and of OPCO) and models the entities of a system (physical, information and software entities) to be controlled (fig . I) : - P is a finite set of places: - T is a finite set of transitions: - III defines the types of tokens associated to places and to transitions. III is a function on T © P such that Ill(t) (resp. Ill(p» is a Cartesian product of classes of D . The tokens that will, at a time 'to be associated to t (resp. p) are elements of 1l1(t) (resp. III (p». We note such product as a n-uple of
Object-oriented
For next formal definitions. we consider a class as a set and its instances (objects, created or not yet) as elements of the set. Then we can write that an object belongs to a class, use Cartesian product of classes, etc... The reader not familiar with Petri nets (resp. object-oriented) concepts may refer to (David. 1991) (resp. (Meyer. 1988»
74
classes. For example . ~ I (t7) = < p. o. m > where the classes p. 0 et m mean respectively part. operation and machine ; - Pre and Post are the forward-incidence and feedback-incidence functions. Denoting by to the input places of t and by °t the output places of t, we have:
- a transition t is firahle with respect to an instance u of ~(t) if (t,u) is m-enabled ie. m(p) ~ Pre(t,p)(u) for every p element of °t ; - firing t with respect to u consists to : 1- calculate a new marking m' such that: m'(p)=m(p)-Pre(t,p)(u) for every p element of °t. m'(p)=m(p)+Post(t.p)(u) for every p element of to, 2- execute col(t)(u) .
VtET. VpEP. Pre(t.p): f.11(t)-7 N.f.1pifpE °t.
Pre(t.p )=0 else ; 'i tET, 'iPEP, Post(t ,p):
~I(t)
-7
N '~r
if pE to,
Pre(t,p)=O else ; N is the set of integers and Pre(t.p)(u)=a.u' means that, for t to be fired with respect to u. there must be a number a of u' in p. Post(t ,p)(u)=a .u' means that firing t with respect to u leads to put a number a of u' in p ; - ~2 is a function on T. ~2(t) is a subset of ~ I (t) . generated dynamically . that includes the set of tokens with respect to which t is firable at the current time. ~2(t) depends on the state of the model and its environment (ie . instances of D and marking of °t). The expression of ~2(t) is given by the designer. Some rules are available for that purpose (Ait-Hssain . 1993) ; - p I aim is to put restrictions, as conditions, on the elements of ~2(t) letting PNOM autonomous . For this, expression of p I does not include attributes nor methods of physical objects that outputs the states of these objects . p I is a function on T such that pl(t) is a function on ~I(t) (and then on ~2(t» having its values in {O, I} . Hence, at a time t, the tokens considered for probable firing of a transition tare n-uples of elements of ~(t) such that:
/l(t)={ U
E
2.3. Example Suppose that we have 3 machines (mi, i= I , 2, 3) and 5 operations (ai , i= I. 2, .. , 5) and that all the parts Pi follow the same manufacturing routing gfl (precedence constraints). Figure 2 shows gfl (d and f are begin and end operations). The domain D is composed, for example, by the classes machine , timer , part , manufacturing routing, operation. operations sequence (ordered sequence of operation / assigned machine). The remaining of PNOM is shown in figure 3 . The places IS, OM , BS, IM, MM, SS and OS respectively mean Input Stock, Occupied Machine, Buffer Stock , Idle Machine, Machine in Maintenance , Scrapping Stock and Output Stock. We respectively denote by m, 0 , p the classes machine, operation and part. The values of ~ I (Cartesian products) are written by places and transitions (n-uples of classes) . For example, firing t 1 would be with respect to a token < Pi , oj. mk > element of ~ I (t I) =
/l2(t) / pI (t)(u) = I}
- col aim is to define updating actions to be performed on objects of D when firing transitions. Let 0 I be a set of updating actions on the objects of D (not physical because PNOM is autonomous). An element of 0 I is an assignment of a value to an attribute or an activation of a method that updates the states of some objects (not a physical task) . The elements of 01 are called updating operatioflS . Then. CO I is a function on T such that:
V tET, wl(t) : /ll(t) ~ 01 * U
(A},
02
01~
where 0 I * is the set of sequences of elements of 01 and A the NULL action. - mO is the initial marking. Let m be the marking at a given time . m(p) is a linear combination of instances of ~(p) in p at that time .
I
VpE P, m(p)=
au.u
ou
~
04
03
05 Fig. 2. the routing gfl
then at a time when M(BS) = {p2, p5}. M(IM ) = {m3}. p2 .no = {05. ol} (ie . p2 has finished only 04, cL fig . 2) and p5 .no = {f} (ie . p5 has finish ed its routing), wc have: ~2(t3) = M(BS) x M (BS).no x M(IM)
auE N
UE~
2.2. Working rules
75
= {p2, pS} x {oS , 0 I} U {f} x {m3} = {
where e the event always occurring. R is the set of reals, A is the NULL action and 02* is the set of sequences of elements of 02. \jI aim is to synchronise transitions firing on events coming from physical entities. Indeed, \jI(t)(u) = (o .a=v)i means that for tto be fired with respect to u the value of the attribute o.a must change to v, and that the corresponding physical entity to the physical object 0 that makes this change (fig. I). 002 aim is to define physical actions to be executed on physical entities when firing transitions. 002(t)(u) = o.m( ... ), executed when firing t with respect to u makes control signals go from physical object 0 to the corresponding physical entity (fig . I).
f is a cost function associated to transitions . The cost of firing t with respect to u is f(t)(u). X is the external control allowing conflicts solving. Linear programs where f(t)(u) are the parameters of objective functions generate X (t)(u) (cf. §5).
3. THE OPCO MODEL 3. 1. Definitions
3.2. Working rules An OPCO is a 5-uple We consider OPCO at discrete times t . Let Et be the set of events, elements of E, output by D at a time t (the physical system is transparent) : - a transition t is firable at t with respect to an element u of ~ *(t) if - (t,u) is m-enabled, - \jI(t)(u) is currently in Et ; - t is fired with respect to u if (t,u) is x-allowed ie. (u)= I. Et may contain the event e only. We denote by Ft the set of couples (t,u) such that t is firable at time t with respect to u. Firing a transition t with respect to an instance u consists to : - update the marking m in the same way as for PNOM, - execute the operations oo(t)(u) .
< R, p2, \jI, 002, f >. R is a PNOM. p2 aim is to put restrictions as conditions on ~2(t). These restrictions depend on the sates of physical objects, and then on physical entities. p2 is a function on T such that p2(t) is a function on ~ I (t) (and then on ~2(t) and ~(t» having its values in {O,I}. The set of tokens associated with t are then ~ *(t) such that:
~*(t)={u
E
f..l2(t) I pl(t)(u) = 1 and p2(t)(u) =
xt
I}
To define the remaining elements of the 5-uple let us consider the following sets: - E is a set of events occurring in the system to be controlled . The occurrence of such an event is modelled by the fact that an attribute a of an object o corresponding to a physical entity has just been given a value v. This is denoted (o.a=v)i. - 02 is a set of operations on the physical objects of D . An element of 02 is the activation of a method the execution of which makes control signals go to physical entities (eg. leading to a manufacturing task). We call the elements of 02
3.3 Examples p2(t6)«m» = (m .maintenanceO =1)? m .maintenance() is a method of class m; m.maintenance()=1 tells that m should be maintained. \jI(t2)«p.o.m» = (m .state =I)i The event (m.state = I)i occurs when the attribute m.state changes (from 0, M , ... ) to the value I (idle). 002(tl )«p,o,m» = m.perform(o,p) m.perform(o,p) is a method of class m; it leads m to perform 0 on p; X is generated by solving the linear programs (cf. §5).
physical operations or methods . We then have : f and 002 are functions on T such that
- \jI.
V tET, VpEP, \!I(t) : ~l(t) ~ Eu{e},
f(t) : ~ I (t) ~ R,
ro2(t) : ~1(t)~02*u(A}
76
Note . p I and p2 eliminate flon-real conflicts. These conflicts are avoided merely by reading the states of the objects instances of D (simple access to 3ltri hutes).
Il *(t) then makes possi ble to separate the system to be controlled , modelled with OPCO, from control X generated externally . The real conflicts are solved according to values of X .
u an in stance of Il(p) currently in p, ie . n(p.u.T ) >
O. A(p ,Tc .U.T) is the set of couples transition-token in the maximal CS that all request u.
A(p.Tc ,U.T)
4, CONFLICT
I(t ,v) / t E Tc, v E Il*(t) , (t,v) E Pt \,
=\
and Pre(t,p)(v)
STRUCTURES
ANALYSIS
L (t,V) E
Free-choice Stru ctures. We call mono-transition structure any couple
Pre(t,p)(v)
>
n(p , u:r).u
A(p.Tc,u:t)
5.2. optimal alternatives
-:;:.
We call poly-transition structure any couple
o. E N*
A(p.Tc,U.T) is called a set of conflict alternatives (CA) with respect to (p,u) at time r if
The analysis is off-line, just after modelling . Its aim is to prepare on-line conflict situations analysi s (§ 5).
only input transition of p. We call free-choi ce mono-transition structure any mono-transition structure
= o. .u ,
Case I: a maximal CS . In case A(p,Tc,u:rJ is a set . of CA, the best alternauve(s) should be chosen. A u'. cost f(t)(v) is attached to firing t with respect to v. A subset B(p,Tc,u ;t) of A(p,Tc,u;t) should be chosen that minimises the sum of the costs. We propose that B(p ,Tc,U ,T) is the solution of the linear program n(p,TC ,U,T) : Min (t,V) E
1,2 ... n,
A(p,Tc,u:r)
I.
't;j u E J.1*(ti), 't;j u' E J.1*(tj)
( t.v
Xt(v).Pre(t,Pi)(V) ~ n(Pi,u;r).u
lE A(p,.T .. u:n
i=l ,2, .. q,\i
Conflict Structures (CS ). We call conflict structure (CS) any structure
U
such that A(pi,Ti, u;t) is set
which is not : - a free-choice mono-transition structure, - nor a free-choice pol y- transition structure . Then , a real conflict (conflict situation) could occur only in a CS. A CS
of CA .
5. CONFLICT SITUATIONS ANALYSIS
In ge ne ral. Let S be a composed CS, including maximal CS
Then B(p,Tc,u,'t) = {(t,v) / Xt(v)=l} Case 2: a composed CS. If a maximal CS
(t.v)e A(p,Tc.u."CJ-..;A(p'.Tc '.u ';r)
I
Xt(v) .ft(v)
(l.v)e A(p.Tc.u."ChA(p',Tc ',u'."C )
5. 1. conflict alternatives determination n(p ,u ,T) denotes the number of in stances u in p a t time T. Let T be a time when the environment D outputs a set of events ET . Let < p , Tc > maximal CS , and
77
REFERENCES
Min (t.V)E U(s:n
(t.V)EQ(S .'t) Ait Hssain, A (1993). Conduite hierarchisee integree des ateliers manufacturiers tlexibles : une approchc mixte objets / reseaux de Petri . These de l'INP Grenoble (France). Baldassari. M and G. Bruno (1991) . PROTOB : An Object Oriented Methodology for Developing Event Dynamic Systems. In High-level Pelri Nels : Theorv and Applicalion. Jenson : Rozenberg (Eds). Spring- Verlag. David, Rand H. Deneux (1983) . Deterministic Safe Intrtpreted Petri Nets. Relations with the Grafcet Model. 41h European Workshop on Petri Nels . Toulouse. Seplember. 1983. David. R (1991). Modelling of dynamic Systems by Petri Nets . European conlrol Conference. Grenoble (France). Fabian. M. and B. Lennartson (1992). Objct Oriented Structuring of Real Time Systemes . Proceedings of Ihe 31 sI Conference on Decision and Control. Tucson. Ari ~o,w. December 1992. Lakos. CA. and CD. Keen (1994). LOOPN++: A New Language for objct-oriented Petri Nets. European Simularion Multiconference . Barcelona. June 1994}. Long,] and B. Descotes-Genon (1993). Flow Optimization Method for control Synthesis of Flexible Manufacturing Systems Modeled by Controlled Timed Petri Nets. IEEE Robolics and Automation. Atlanta. May 1993. Mcyer. B. (1988). Objecl-oriented Software Construction. Prentice Hall Ed. 1988. Moalla. M (1985). Reseaux de Petri et Grafcel. Technique el Science Informatique. Vol. 4, No. 1. Sibertin-Blanc (1985). High Level Petri Net with Data Structure. 6th European Workshop on Pelri Nel and Applicalions. Espoo (Finland). June 85. Villaroel . J.L.. J.A. Banares and P.R. Muro-Medrano (1994) . KRON: An approach for the Integration of Petri Nets in Object Oriented Models of Discrete Event Systems. Departemenlo de Ingeniera University of ZaraRo:a Eleclrica e Informalica. (Spain) .
where U(S.'t) (resp. Q(S ,'t» is the union (resp. intersection) of A(pi ,Ti,u,'t) with n(pi ,u,'t) > 0 and A(pi,Ti,u,'t) is a set of CA . - the constraints system L(S,'t) is
I.
Xr(v) .Pre(t,pi)(v) ~ n(pi'u,'t).u
(t. v)EA(p,. T" u.t)
i=I,2, .. q,V usuch that A(pi,T.,u,'t) is a set of CA.
6. IMPLEMENT A TION ASPECTS The interpretation algorithm is the engine of apca, looked at it as a knowledge base. It also makes possible generation of linear programs n(S,'t) that outputs the X(t)(v) to solve conflict situations . The problems n(S,'t) are NP-complete but of small sIzes. The modelling process using apco follows the steps: - specify PNOM, - specify OPCO, - determine composed CS, - give costs f(t). - evaluate complexity of the linear programs (not mandatory and could be automated). These aspects are presented in more detail in (AitHssain, 1993).
7. CONCLUSION
apco
is a class of Petri nets that captures object oriented data structures . It controls messages sending among the objects that model a system to be controlled, including physical, information and software entities . Control of such entities is then homogenous. apco offers a best manipulation of tokens associated to transitions. apco running outputs independent groups of conflict situations and associates to them independent linear programs . Solutions of these programs are external controls separated from the model of the system. An interpretation algorithm and a modelling process using apca are available.
78