**4.2. Algorithmically generated Petri net models and schedules**

In contrast to academic investigation of static scheduling problems the real manufacturing environment is far more dynamic. Planned work orders are often changing, priority orders are inserted, planned resources may become unavailable. A fast derivation of models that adequately represent the current situation in the process is therefore of extreme importance for a usable scheduling system. The above described automatic generation of Petri net models can be effectively used for these purposes.

The proposed algorithm also allows for specific process sequence structures typical for batch processes. E.g., the scheduling literature typically addresses a type of problems where a resource required by an operation is released as soon as the operation is finished. This is typical in the discrete industry, where intermediate products are stored in buffer zones in between machines. In batch processes the situation is different in the sense that a resource, e.g. a reactor is used both for processing and intermediate storage. The resource can be occupied by a number of successive operations, which can be easily modelled by Petri nets. Furthermore, the use of timestamped tokens provides a convenient representation of the time status of the processed work orders.

#### **4.3. Evaluation of schedules**

14 Will-be-set-by-IN-TECH

which makes the obtained solution very sensitive to decisions taken at initial levels of the tree

Recent reports in scheduling literature show an increased interest in the use of meta-heuristics, such as genetic algorithms (GA), simulated annealing (SA), and tabu search (TS). Meta-heuristics have also been combined with Petri net modelling framework to solve complex scheduling problems [19]. With such an approach, the modelling power of Petri nets can be employed, and relatively good solutions of scheduling problems can be found with a reasonable computational effort, although the convergence to the optimum can not be guaranteed. Compared to reachability tree based search methods, meta-heuristics require less

The problem is that these methods require a sort of neghbouring solution generation strategy. This is easily accomplished for well structured problems, e.g. standard scheduling problems, but may be problematic for general models. In contrast, reachability tree methods as well as priority rule based methods can be used with any type of Petri net model. This motivates the investigation of combined methods, such as the combination of dispatching rules and local

Dispatching rules, however, do not always enable to reach the optimum even if combined with optimization methods. Using the rule based conflict resolution strategy the solution space is explored in a time driven manner where a transition is fired whenever at least one transition is enabled. In contrast, the reachability tree based methods enable to explore the solution space in an event driven manner. It is possible that a chosen firing sequence imposes one or more intervals of idle time between transitions, i.e. some transitions are enabled but do not fire due to waiting for enablement of another transition in accordance to the chosen sequence. The difference is important in cases when the optimal solution can be missed unless some idle time is included in the schedule as shown in [15]. In other words, the optimal solution generally belongs to the class of semi-active schedules [16]. The schedules generated by an

In contrast to academic investigation of static scheduling problems the real manufacturing environment is far more dynamic. Planned work orders are often changing, priority orders are inserted, planned resources may become unavailable. A fast derivation of models that adequately represent the current situation in the process is therefore of extreme importance for a usable scheduling system. The above described automatic generation of Petri net models

The proposed algorithm also allows for specific process sequence structures typical for batch processes. E.g., the scheduling literature typically addresses a type of problems where a resource required by an operation is released as soon as the operation is finished. This is typical in the discrete industry, where intermediate products are stored in buffer zones in between machines. In batch processes the situation is different in the sense that a resource, e.g. a reactor is used both for processing and intermediate storage. The resource can be occupied by a number of successive operations, which can be easily modelled by Petri nets. Furthermore, the use of timestamped tokens provides a convenient representation of the time

and in many cases the quality of the obtained solutions is rather low.

event-driven reachability tree search are semi-active schedules.

can be effectively used for these purposes.

status of the processed work orders.

**4.2. Algorithmically generated Petri net models and schedules**

memory.

search [13].

As the majority of commonly used scheduling objective functions are based on completion times of the jobs or work orders and due dates, the timed Petri net modelling framework yields a possibility to use the same kind of model with an objective function tailored to the needs of the particular production scenario.

In the field of deterministic scheduling the objective to be minimised is always a function of the completion times of the jobs or work orders [16]. This fits well in the timed Petri net scheduling framework where the time evolution of the net marking depends on timestamps associated with the tokens. If the schedule is modelled properly, the work order completion times can be read from the timestamps of tokens in the final marking obtained by timed Petri net simulation.

Let *oji* denote the *i*-th operation of work order *j*. Let *Cji* denote the completion time of the operation *oji*. The completion time of the work order, i.e. the completion of the last operation of the work order is denoted by *Cj*.

During the timed Petri net marking evolution, start of *oji* corresponds to triggering of a related transition *tji*. Associated delay *f*(*tji*) corresponds to duration of *oji*. Following the firing rule, the transition output places are marked with tokens whose time attribute is set to @(*ρji* + *f*(*tji*)) if *ρji* denotes the moment of transition firing, i.e., the release time of *oji*. The generated timestamp equals the completion time of *oji*: *Cji* = *ρji* + *f*(*tji*).

Assuming the timed Petri net model of scheduling problem as described above, let *pWO*\_*j*\_*end* ⊂ *P* denote the *j*-th work order end place, i.e. the place that holds a token representing finished status of the work order. Let *Mf* denote the final marking reached after all the operations had been finished. If a token in *pWO*\_*j*\_*end* corresponds to finishing the last operation of work order *WOj* then *Mf*(*pWO*\_*j*\_*end*) = 1@*Cj*. Therefore the completion times can be read from *Mf*(*pWO*\_*j*\_*end*): *Cj* = *Mf*(*pWO*\_*j*\_*end*) ⊂ *TSMS*.

#### *4.3.1. Makespan*

Makespan *Cmax* is equivalent to the completion time of the last finished work order: *Cmax* = *max*(*C*1,..., *Cn*). Considering the above notation

$$\mathbb{C}\_{\max} = \max(M\_f(p\_{WO\_=l\_- \text{end}})), j = 1 \dots n \tag{1}$$

#### *4.3.2. Total weighted completion time*

The sum of weighted completion times gives an indication of the inventory costs related to a schedule [16]. Given a final marking *Mf* the cost can be calculated as

$$\sum w\_{\vec{j}} \mathbb{C}\_{\vec{j}} = \sum\_{j=1}^{n} w\_{\vec{j}} \mathbf{M}\_{f}(p\_{\text{WO\\_j\\_end}}) \tag{2}$$

#### *4.3.3. Tardiness*

If a set of due dates *dj* is adjoined to the work orders, the tardiness of a work order is defined as the difference *Cj* − *dj* if positive, and 0 otherwise:

$$T\_j = \max(M\_f(p\_{WO\_-j\_- \varepsilon ud}) - d\_{j'}0) \tag{3}$$

**B11**

V113 V111 V112

V211

**Figure 11.** Multiproduct batch plant.

**Table 3.** Processing times.

V131

P1 P2 P3

V132

V212

**R22**

**R21 R23**

V221 V222

P4

Process Time(s) Pumping 1 batch "Yellow" into B11 12 Pumping 1 batch "Red" into B12 12 Pumping 1 batch "White" into B13 12 Draining 1 batch "Yellow" into R21 15 Draining 1 batch "Red" into R21 11 Draining 1 batch "White" into R21 10 Draining 1 batch "Yellow" into R22 12 Draining 1 batch "Red" into R22 13 Draining 1 batch "White" into R22 9 Draining 1 batch "Yellow" into R23 12 Draining 1 batch "Red" into R23 14 Draining 1 batch "White" into R23 13 Draining 1 batch "Blue" from R21 into B31 12 Draining 1 batch "Green" from R21 into B32 13 Draining 1 batch "Blue" from R22 into B31 12 Draining 1 batch "Green" from R22 into B32 12 Draining 1 batch "Blue" from R23 into B31 12 Draining 1 batch "Green" from R23 into B32 12 Pumping 3 batches "Red" out of B31 30 Pumping 3 batches "Green" out of B32 30

Work orders, given in table 4, illustrate the problem, where six batches of "Blue" (PB) and six batches of "Green" (PG) products have to be produced. It follows that we need six batches of

"Yellow" and "Red" raw materials and twelve batches of "White" raw material.

V121 V123

V122

**B32 B31**

V232

P5

V231

V311 V312

**B12 B13**

V133

Automated Petri-Net Modelling for Batch Production Scheduling 19

In contrast to objective measures, which are related to final marking, the initial marking can be used to specify release dates of work orders. If a token in *pWO*\_*j*\_*st* corresponds to the initial request of work order *WOj*, and *rj* is a corresponding release date then *M*0(*pWO*\_*j*\_*st*) should contain a token 1@*rj*.
