**4.2. Syntactic integration based in SPNOZ formalism**

## *4.2.1. The case of the IMC organisation*

In order to illustrate syntactic integration of our approach, we specify a part of our Industrial Maintenance Company (IMC-Part). We have limited our work to the specification of the Mobile Maintenance Teams Organization which is a part of the holonic structure of the system studied with two MMT. We assume that the choice of the intervening teams depends on the following information: the availability of the MMT, the distance at which the MMT is from the production site and spare parts stock level of MMT. We suppose that our system can be in three different states: Mobile Team(i) Available (MTA(i)), Mobile Team(i) on Production Site (MTPS(i)) and Mobile Team(i) with Critical Level of Stock (MTCLS(i)). For this reason, we use a free or built type to describe the system state:

**Figure 12.** Specification SPN based on OZ class syntax

The system to be specified is described by its state and following average times, estimated by the Maintenance Policies organization, such as: *tDMMTi* the average time Displacement of Mobile Maintenance Team(i) to reach Production site, associated to transition T(i); *tRepMMTi* the average time for intervention of Mobile Maintenance Team(i), associated to transition T'(i); *tSD* the time limit to which Maintenance Team must arrive on a production site; *tRepCMT* the average time for Repairing the defective parts by Central Maintenance Team, associated to transition T"(i). Other parameters are introduced to supplement the specification such as: Ci the level stock of Mobile Maintenance Team(i); Cmin(i) the minimum level stock of Mobile Maintenance Team(i) (below this value, MMT(i) must re-enters to the IMC); *m* and *n* the initial state of stocks. Syntactically, SPNOZ specification IMC-Part is like OZ class, with the addition

43

Specifying and Verifying Holonic Multi-Agent Systems

Using Stochastic Petri Net and Object-Z: Application to Industrial Maintenance Organizations

STATE\_IMC-Part ::= MTA|MTPS|MTCLS.


**Figure 12.** Specification SPN based on OZ class syntax

16 Will-be-set-by-IN-TECH

chain is associated with every reachable marking and the transition rates of the Markov chain are obtained from the previous property. Note that there is no actual conflict in a SPN. For example, the probability that firing transition *Ti* occurs simultaneously with transition *Tj* is zero since continuous time is considered. One approach may be used to analyze a SPN consists of analyzing a continuous time, discrete state space Markov process (bounded PN). Let *T*(*m*), denote the set of transitions enabled by *m*. If *Tk* ∈ *T*(*m*), the conditional firing probability of *Tk* from *<sup>m</sup>* is: *Pr*[*Tk* will be fired <sup>|</sup>*m*] = *<sup>λ</sup>k*(*m*)/ <sup>∑</sup>*j*:*Tj*∈*T*(*m*) *<sup>λ</sup>j*(*m*); the dwelling time *<sup>λ</sup>*(*m*) follows an exponential law, and the mean dwelling time in marking *m* is 1/*λ*(*m*) with *λ*(*m*) =

This section discusses aspects of SPN expressed in OZ. These aspects can be obtained by successive refinements starting from formal definition of ordinary PN. Figure 12 shows the specification of a SPN expressed by the OZ syntax. The class schema SPN includes, from top to bottom, an abbreviation declaration and two free types [1] places and transitions. After that, comes an unnamed schema generally called the state schema, including the declaration of all class attributes. Next schema INIT includes a predicate that characterize the initial state of the class. The last schema defines specific operation of the SPN class. The first two lines in the predicates determine the input and output places of a transition. The third and fourth predicate verifies if the transition is firable (enable): input places contain enough tokens and output places have not reached their maximum capacity. The fifth verifies inhibitor arc between *P* and *T* authorizes the firing. Finally, the last two predicates express the marking change after firing timed transition. At the end, we specify the invariants of the SPN model. Now that we have expressed aspects of SPN in OZ, we must have rules for translating any PN of syntactic elements. For this we inspired from [11] using a function like relationship between PN and the types and patterns of the OZ domain. This function transforms any PN into OZ specification written with the schemas defined in the previous section. The function we call ℵ is the basis of the mechanism of syntactic integration of our multi-formalisms. This function is defined inductively ℵ as follows: (a) If *ψ* is an ordinary Petri Nets then ℵ(*ψ*) is a

In order to illustrate syntactic integration of our approach, we specify a part of our Industrial Maintenance Company (IMC-Part). We have limited our work to the specification of the Mobile Maintenance Teams Organization which is a part of the holonic structure of the system studied with two MMT. We assume that the choice of the intervening teams depends on the following information: the availability of the MMT, the distance at which the MMT is from the production site and spare parts stock level of MMT. We suppose that our system can be in three different states: Mobile Team(i) Available (MTA(i)), Mobile Team(i) on Production Site (MTPS(i)) and Mobile Team(i) with Critical Level of Stock (MTCLS(i)). For this reason, we use

PN scheme, (b) If *ψ* is a Stochastic Petri Nets then ℵ(*ψ*) is a SPN scheme.

**4.2. Syntactic integration based in SPNOZ formalism**

*4.2.1. The case of the IMC organisation*

a free or built type to describe the system state: STATE\_IMC-Part ::= MTA|MTPS|MTCLS.

<sup>∑</sup>*j*:*Tj*∈*T*(*m*) *<sup>λ</sup>j*(*m*).

*4.1.2. SPN expressed in OZ*

The system to be specified is described by its state and following average times, estimated by the Maintenance Policies organization, such as: *tDMMTi* the average time Displacement of Mobile Maintenance Team(i) to reach Production site, associated to transition T(i); *tRepMMTi* the average time for intervention of Mobile Maintenance Team(i), associated to transition T'(i); *tSD* the time limit to which Maintenance Team must arrive on a production site; *tRepCMT* the average time for Repairing the defective parts by Central Maintenance Team, associated to transition T"(i). Other parameters are introduced to supplement the specification such as: Ci the level stock of Mobile Maintenance Team(i); Cmin(i) the minimum level stock of Mobile Maintenance Team(i) (below this value, MMT(i) must re-enters to the IMC); *m* and *n* the initial state of stocks. Syntactically, SPNOZ specification IMC-Part is like OZ class, with the addition

#### 18 Will-be-set-by-IN-TECH 44 Petri Nets – Manufacturing and Computer Science Specifying and Verifying Holonic Multi-Agent Systems Using Stochastic Petri Net and Object-Z: Application to Industrial Maintenance Organizations <sup>19</sup>

of a behaviour schema, which includes a SPN. The IMC-Part class on Figure 13 specifies a part of the IMC system. The class IMC-Part includes an abbreviation declaration and the behaviour schema which containing SPN. The state system is presented with class schema IMC-Part. In the initial state, all the MMT are available and the spare parts stock level is at its maximum (*m* and *n*). The initial state is presented with Init\_IMC-Part schema.

In Figure 13, transitions in dotted lines (T1, T2, T"1 and T"2) are transition that interact with MMT forwarding and Tasks Planning organizations.
