<figure><img src="image_1.png" /></figure>

HAL
open science

# Mathematical Model for Production Plan Optimization-A Case Study of Discrete Event Systems †

Sadok Rezig, Wajih Ezzeddine, Sadok Turki, Nidhal Rezg

► To cite this version:

Sadok Rezig, Wajih Ezzeddine, Sadok Turki, Nidhal Rezg. Mathematical Model for Production Plan Optimization-A Case Study of Discrete Event Systems †. Mathematics, 2020, 8 (6), pp.955-10.3390/math8060955. [https://doi.org/10.3390/math8060955](https://doi.org/10.3390/math8060955)

HAL Id: hal-02968026

https://hal.univ-lorraine.fr/hal-02968026

Submitted on 15 Oct 2020

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.
<figure><img src="image_2.png" /></figure>

Article

# Mathematical Model for Production Plan Optimization—A Case Study of Discrete Event Systems †

Sadok Rezig* , Wajih Ezzeddine , Sadok Turki and Nidhal Rezg

Laboratoire de Génie Informatique, de Production et de Maintenance (LGIPM), UFR MIM, University of Lorraine, 57000 Metz, France; wajih.ezzeddine@univ-lorraine.fr (W.E.); sadok.turki@univ-lorraine.fr (S.T.); nidhal.rezg@univ-lorraine.fr (N.R.)

* Correspondence: sadok.rezig@univ-lorraine.fr; Tel.: +33-372-748-045

† Featured application: This work deals with a flexible manufacturing system located in LGIPM Laboratory in FRANCE-Metz. The Petri net Controller is programmed with SCHNEIDER Unity Pro XL and SIMATIC STEP 7 Software.

Received: 20 May 2020; Accepted: 9 June 2020; Published: 11 June 2020

<figure><img src="image_3.png" /></figure>

check for
updates

**Abstract:** This paper proposes an optimal scheduling model under production and maintenance constraints for a real case of a discrete event system. The intent was to use the rich mathematical theory and algorithms of optimization in the study of this important class of systems. The current study detailed firstly a new approach for mapping a simulation event relationship graph into a mixed-integer program, with a flexible workshop real case. Several other potential applications of the mathematical model are examined, thanks to the model constraints flexibility characteristics, including a general case of a manufacturing system for optimal resource scheduling, an application on the case of hospital beds' management. The model extension could be also interesting for other applications like museum systems or the case of big data in complex and social networks.

**Keywords:** optimization; mathematical theory; algorithms; scheduling discrete event systems; production; theory of regions

## 1. Introduction

For most companies, maintenance represents a very significant function within the overall production environment. The developments in automation, and the resulting complexity of the systems involved, have made the reliability of the machines even more important. This is especially true in the process industry, characterized by expensive, specialized equipment and stringent environmental considerations. Nowadays, with profit margins decreasing, there is need for a good maintenance planning and control, especially for discrete event systems (DES). The evolution of DES is defined by the instantaneous occurrence of events at possibly unknown and/or irregular time intervals (e.g., communication and transport systems, computer systems, and manufacturing systems). Today, these systems are so complex that intuitive methods are no longer enough to ensure efficient and operational supervision and scheduling. The theory of supervision of DES was developed by Wonham and Ramadge [1,2]. Thanks to formal languages and automata, these authors have introduced concepts like those used in the theory of automatic control of continuous systems. Thus, the synthesized supervisor ensures the desired legal behavior. Indeed, Petri nets (PNs) are shown to be more powerful than automata for modeling DES with synchronization and parallelism. In addition, the PNs are more advantageous for dealing with the control problems defined by specifications on the states of the system [3,4]. They represent a very suitable tool for studying manufacturing systems thanks to their modeling power and mathematical properties. In our previous work [5–7] we focused on the development of methods of control and production optimization
of the computation time to calculate controllers that satisfy control specifications and constraints related to manufacturing systems.

The production and maintenance management using new strategies differs greatly from management policies in traditional manufacturing. These strategies are more deterministic and more flexible since they could consider different parameters impacting production and control activities' performances. Production scheduling is considered as a determinant functionality in the production management. Since production activities depend on several parameters, production scheduling may need to consider the manufacturing system status and operational conditions in the production layer.

In a more general context, decision support systems continue to be very popular in industrial engineering thanks to their ability to help decision makers managing their resources in function of several manufacturing constraints. However, manufacturing systems are complex since they are connecting many technical and human resources. These systems are often looking for more efficiency and, so, new strategies are developed, especially in production planning.

The importance of considering production management components linked to manufacturing execution systems (MES) has hugely increased during the last years. The Figure 1 [8] illustrates the MES growth between 2006 and 2016. In literature, many proposals deal with manufacturing system allocation and production planning.

<figure><img src="image_4.png" /><figcaption>**Figure 1.** Major decisions in production planning decisions [8].</figcaption></figure>

Several research works [9–11] focused on mathematical modeling to express the production scheduling problem in terms of variables and constraints. In [9], a set of algorithms to minimize the length of production planning was proposed. The proposed algorithms are used to generate all possible optimal schedules grouped into subsets. The authors propose computational algorithms in order to evaluate these performances and select the best ones in function of given performances' parameters. In [10], a hybrid policy to deal with the optimal production scheduling complexity due to various kinds of uncertain factors, such as breakdowns, maintenance actions, and production parameters, was developed. The authors used the genetic algorithm as a resolution tool to minimize the total completion time. In [11], the production planning computation complexity for various types of cost functions, maintenance costs, and production capacity limits was summarized. Many research works
deal with several industrial constraints such as subcontracting, warranty, and quality in manufacturing and logistic fields [12].

For more details about determination of production and maintenance control policies under different types of constraints, the reader may refer to the work of Rezg et al. [13].

An application example of our methodology such as hospital beds' management is presented in this paper to show the effectiveness of our mathematical model. Then, two illustrative examples are given to highlight, firstly, the importance of the model in a real production issue for a discrete event system and, secondly, to demonstrate the mathematical model efficiency for a typical case of an industrial production unit. The main goal was to find a schedule that satisfies all resource constraints while minimizing the total cost. Other proposals integrate different parameters as subject of optimization conducive to get the best decisions from which we cite tasks' selection and sizing, assignment of tasks to manufacturing systems, and jobs' sequencing.

In other proposals [14], simulation and meta-heuristics tools are used to highlight operating issues and evaluate different decisions of resources' management. In [15], the authors proposed an algorithm dealing with beds' management issues in hospital centers. Maintenance strategies currently used by decision makers are generally classified into two main classes: The corrective maintenance and the preventive one. Corrective maintenance actions are realized when a machine breaks down. The main task of such maintenance activities is to restore the machine to a desired condition. Preventive actions are performed regularly to increase the machine availability and to avoid, as possible, its breaking down. In this paper, we studied preventive maintenance actions that are already planned in the initial production planning.

The junction of maintenance and production scheduling [16] was the subject of many proposals in the literature. In particular, [17] discusses the optimal joint production and maintenance plan in the case of a system consisting of several identical machines. In [18], a new approach for joint production and maintenance scheduling in the case of multiple machines was developed. Machines are subject to failures and an age-dependent preventive maintenance policy was used. The main improvement of this work was to implement a PN supervisor on a flexible manufacturing system (FMS) under production and control constraints using a developed JAVA application. Therefore, we considered merging an efficient mathematical model in order to provide an optimal production planning. This paper is organized thusly: Section 2 presents briefly the Petri nets and the theory of regions concepts and describes the FMS in our laboratory. Then, Section 3 develops the production planning mathematical model. Next, Section 4 provides a numerical example on a real experimental environment. Finally, the Section 5 shows the mathematical model efficiency on a given industrial production unit.

## 2. Mathematical Model Description

In this part, a planning for manufacturing systems production is presented. Our proposition was to develop a production plan under production constraints. The mathematical model was based on [15]'s proposal.

The proposed model was based on the following assumptions:

* The production duration was considered as known in advance.

* Batches could not be operated on more than one manufacturing system.

* Each batch was associated to two dates: Earliest manufacturing date and latest manufacturing date. Real manufacturing date must be included between these two dates.

* Two type of workshops: Workshops with two manufacturing systems and ones with only one manufacturing system.

* Manufacturing of different types of batches in the same workshop at the same time was forbidden.

Hence, the essential objective consisted of assigning the maximum number of batches. Assignment must have respected constraints and did not disturb current planning. Availability (empty and occupied manufacturing systems) was determined and updated after each assignment.
Algorithm for Production Scheduling

The objective function is expressed as following:

$$ \sum_{i=1}^{NP} (F_i \cdot MD_i). \qquad (1) $$

It aims to minimize the non-operated (rejected) batches.

The model constraints are given as following:

$$ \sum_{l=1}^{NMS} X_{l,t,i} \leq 1. \qquad (2) $$

Equation (2), a batch cannot be operated by more than one manufacturing system in a time unit t.

$$ \sum_{l=1}^{NP} X_{l,t,i} \leq 1 \qquad (3) $$

Equation (3), a manufacturing system operates at most one batch in a time unit t.

$$ \sum_{l=1}^{NMS} \sum_{t=EM_i}^{H} F_i \cdot MD_i + X_{i,l,t} = MD_i \qquad (4) $$

Equation (4), non-interrupted manufacturing. The model assumes that manufacturing operation is continuous. The length of stay of the batch in the workshop is strictly equal to its manufacturing duration.

$$ \sum_{l=1}^{NMS} A_{i,l} \leq 1 \qquad (5) $$

$$ MD_i \cdot A_{i,l} = \sum_{t=EM_i}^{H} X_{t,l,i} \qquad (6) $$

Equations (5) and (6), a batch can occupy at most one manufacturing system.

$$ J_i \geq EM_i \qquad (7) $$

$$ J_i \leq LM_i \qquad (8) $$

Equations (7) and (8), upper and lower bounds for manufacturing date.

$$ \sum_{t=EM_i}^{H} X_{t,l,i} \cdot B_{l,t} = A_{i,l} \cdot MD_i \qquad (9) $$

Equation (9), availability of the manufacturing system to operate the batch i.

$$ Work_i \cdot M_{j,k,l} \left( \sum_{i=1}^{NP} T_i \cdot (X_{i,j,t} - X_{i,k,t}) \right) \leq 1 \qquad (10) $$

$$ Work_i \cdot M_{j,k,l} \left( \sum_{i=1}^{NP} T_i \cdot (X_{i,j,t} - X_{i,k,t}) \right) \geq -1 \qquad (11) $$

$$ Work_i \cdot M_{j,k,l} \left( SP_{j,t} - \sum_{i=1}^{NP} (X_{i,j,t} \cdot T_i) \right) \geq -1 \qquad (12) $$
Equations (10)–(12), batches of different types cannot be operated in the same workshop at a given unit of time.

$$ \sum_{t=EM_i}^{H} X_{t,l,i} \cdot B_{l,t} \cdot (1 - Main_{l,t}) = A_{i,l} \cdot MD_i \quad (13) $$

Equation (13) expresses the preventive maintenance constraints. Constraint (18) expresses the preventive maintenance constraints. Related to the maintenance planning, we considered the fact that manufacturing systems must be maintained after a given number of operated products. Preventive maintenance is not linked to duration but to a given quantity produced, after which the system must be inspected and maintained. This quantity is mostly fixed based on system characteristics such as the equipment life duration, its mechanic characteristics, and the environmental and operational conditions in which the system operates. It is interpreted to mean that a maintenance action can not interrupt the manufacturing operation, which has to be continuous. This constraint is an extension for the constraint (9) for system availability.

$$ i \le NP, l \le L, t \le T \quad (14) $$

Equation (14) expresses the integration constraints.

### 3. Algorithm Application for a Real Case: Petri Net Modeling

#### 3.1. Petri Net and Theory of Regions' Concepts

A Petri net (PN) is a graphical modeling and mathematical tool for divers' systems, especially for discrete event systems. From an informal standpoint, a PN is a directed graph with two types of nodes (transitions and places) and has a dynamic behavior. The transitions and places are connected by oriented arcs. An arc links either a transition to a place/a place to a transition but never links a place to a place/a transition to a transition.

Regularly, a PN is a bipartite graph: $PN = \langle P, T, Pre, Post \rangle$ where: [19]

* $P$ is a set of places.

* $T$ is a set of controllable and uncontrollable transitions: $T = T_c \cup T_u$.

* Pre: $P \times T$ in $N$ represent a pre-incidence function that specifies weighted arcs from $P$ to $T$. $N$ is a set of non-negative integers.

* Post: $P \times T$ in $N$ is the post-incidence function that specifies weighted arcs from $T$ to $P$.

Let the set $p^{(t)}$ (respectively, $^{(t)}p$) be the output transitions (respectively, input transitions) of a place $p$. Naturally, a PN can be formalized by an indexed matrix $C$ as: $C(p_i, t_j) = w(t_j, p_i)$ if $t_j \in ^{(t)}p_i$, $C(p_i, t_j) = -w(t_j, p_i)$ if $t_j \in p_i^{(t)}$, and 0 elsewhere. The $w: F \to N$ is a valuation function of arcs (the finite set of arcs $F \subseteq (P \ast T) \cup (T \ast P)$). Moreover, let $t^{(p)}$ (respectively, $^{(p)}t$) be the set of output places (respectively, input places) of a transition $t$. The reachability graph constructed from the initial marking $M_0$ is denoted by $G(N, M_0)$. The set of generated markings in $G(N, M_0)$ is denoted by $M$. A transition enabled from a marking $M \in [?]$ (denoted by $M[t>$) if and only if $M \ge Pre(\cdot, t)$. An enabled transition may fire yield a new marking $M'$ such that $M_0 = M + C(\cdot, t)$. This expression can be defined by $M[t > M_0$. A new marking $M_0$ is reachable from a marking $M$ if a firing sequence $\sigma = t_1, t_2...t_n$ exists by firing $\sigma$. Any marking $M_0$ reachable from the initial marking $M_0$ satisfies the following PN state equation: $M_0 = M_0 + C * \vec{\sigma}$, where $\vec{\sigma}: T \to N$ is a vector of non-negative integers called the occurrence of $t_i$ in $\sigma$. A Petri net is said to be k-bounded if the number of tokens in each place $p_i \in P$ does not exceed k. A PN is said live if every transition is live. A Petri net is reversible, if from any reachable state, $M$, an enabled sequence exists, transforming $M$ into $M_0$.

The theory of regions in control synthesis was proposed by [19–22] using the properties of PN tools for adding a PN controller $P_c$ to the initial Petri net model with initial marking $M_0(P_c)$ and its incidence vectors $C(P_c, \cdot)$. This theory is represented by a linear system composed of three types of
equations: The reachability equations, the marking/transition separation instance (MTSI) equations, and the cycle equations. Its resolution leads to the design of PN supervisor. This control place $P_c$ has to fulfill the reachability conditions, i.e.,

$$M_0(P_c) + C(P_c, \cdot) \vec{\Gamma}_M \geq 0 \qquad (15)$$

where $\vec{\Gamma}_M$ is the path between $M_0$ and $M$. In addition, each PN controller to add has to solve at least one prohibited event $(M, t)$ in the set $\Omega$ of prohibited state transitions. The MTSI condition relative to the couple $(M^*, t)$ is:

$$M_0(P_c) + C(P_c, \cdot) \vec{\Gamma}_{M^*} < 0 \qquad (16)$$

where $M^*$ is a forbidden state.

Finally, $P_c$ must satisfy cycle equations:

$$\sum_{t \in T} C(P_c, t) \cdot \vec{\sigma}[t] = 0 \qquad (17)$$

where $\vec{\sigma}[t]$ is the algebraic sum of occurrences of $t$ in $\sigma$. Considerably, many MTSI conditions may obtain the same solutions by resolving the linear system composed of Equations (15)–(17). Afterwards, the number of Petri net controllers will be much smaller than the set of MTSI conditions. The following example of Figure 2 is an application of the theory of regions for control synthesis.

<figure><img src="image_5.png" /><figcaption>Figure 2. Theory of regions’ example. (a) PN model, (b) the reachability graph, (c) The controlled PN model.</figcaption></figure>

For this prohibited state problem, we want to forbid the following event separation instance $(M_5 \to M_7)$ (i.e., see Figure 2b). Based on the theory of regions, there are seven reachability equations:

1. $M_0(P_c) \geq 0$;

2. $M_1(P_c) = M_0(P_c) + C(P_c, t_1) \geq 0$;

3. $M_2(P_c) = M_0(P_c) + C(P_c, t_1) + C(P_c, t_2) \geq 0$;

4. $M_3(P_c) = M_0(P_c) + C(P_c, t_1) + C(P_c, t_2) + C(P_c, t_3) \geq 0$;

5. $M_4(P_c) = M_0(P_c) + 2C(P_c, t_1) + 2C(P_c, t_2) + C(P_c, t_3) \geq 0$;

6. $M_5(P_c) = M_0(P_c) + 2C(P_c, t_1) + 2C(P_c, t_2) \geq 0$; and

7. $M_6(P_c) = M_0(P_c) + 2C(P_c, t_1) + C(P_c, t_2) \geq 0$;

one cycle equation:

$$C(P_c, t_1) + C(P_c, t_2) + C(P_c, t_3) + C(P_c, t_4) = 0;$$
and one MTSI equation:

$$M_7(P_c) = M_0(P_c) + 2C(P_c, t_1) + 2C(P_c, t_2) + C(P_c, t_1) < 0.$$

The (LS) linear system of the theory of regions contains nine equations. Its resolution succeeds to the controlled Petri net (i.e., see Figure 2c):

$$PN \ Controller: \ M_0(P_c) = 2; \ C(P_c, \cdot) = (-1, 0, 0, 1). \qquad (18)$$

## 3.2. Real Case Presentation

A flexible manufacturing system (FMS), composed of two production stations installed in the university UFR_MIM in Metz-FRANCE and its Petri net model, are presented in Figures 3 and 4. These stations, modeled by the places P2 and P3, pack engraved blue and red pieces in black boxes. The capacity of each station is modeled by P4 and P5. The transitions ($t_1, t_2$) and ($t_4, t_5$) represent, respectively, the events of entry and exit of the pallets through their annex's conveyors. Otherwise, the pallets can continue their way to the main conveyor by crossing $t_3$. Note that only the transitions $t_1$ and $t_2$ are controllable.

<figure><img src="image_6.png" /><figcaption>Figure 3. The Petri net model.</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>Figure 4. The experimental environment.</figcaption></figure>

The control part of the system makes it imperative not to pack two pieces of different colors for the same unit of time. Our objective in this example was to sort a number N of blue and red engraved pieces in order to package them in black boxes and ship them to customers. In fact, in our previous works, the control constraint was feasible on a number N of pieces in order to dispatch the engraved parts, but the sorting according to the color of the piece remains an insoluble problem in our field.
The application of the theory of regions to design the controller was not suitable until now for colored Petri nets. In addition, this work shed new light on the integration of the scheduling in our previous work. In the next section, we develop a mathematical model that will be used to define the optimal production and maintenance planning for the described FMS.

In this section, the algorithm was simulated to highlight its importance in some modeling complex cases. Related to the maintenance planning, we considered the fact that the system must be maintained after a given number of operated batches. Preventive maintenance is not linked to duration but to a given quantity produced, after which the system must be inspected and maintained. This quantity is mostly fixed based on system characteristics such as the equipment life duration, its mechanic characteristics, and the environmental and operational conditions in which the system operates.

The data that will be used in the numerical example are expressed as following:

* The number of machines is two, as mentioned in the previous subsection.

* The two machines are installed in the same workshop.

* Two types of batches are considered: Blue and red.

* The number of production batches is 8 (N = 8).

* The time horizon is expressed in hours and is equal to seven.

* Production time of a simple piece is 10 min (1/6 h).

* Each production batch has an execution time proportional to its size, which must be a multiple of 6. For example, a batch having 12 pieces, takes 12*10min = 2 h of production.

* The batches' characteristics (type, earliest and latest manufacturing dates) are given in the Table 1.

<table><caption>Table 1. Data for operated batches.</caption><thead><tr><td>Batch i</td><td>EM (i)</td><td>LM (i)</td><td>T (i)</td><td>Batch Size (i)</td><td>Production Time</td></tr></thead><tbody><tr><td>1</td><td>6</td><td>8</td><td>R</td><td>12</td><td>2</td></tr><tr><td>2</td><td>3</td><td>4</td><td>B</td><td>12</td><td>2</td></tr><tr><td>3</td><td>2</td><td>3</td><td>B</td><td>12</td><td>2</td></tr><tr><td>4</td><td>5</td><td>5</td><td>R</td><td>24</td><td>4</td></tr><tr><td>5</td><td>1</td><td>2</td><td>B</td><td>6</td><td>1</td></tr><tr><td>6</td><td>5</td><td>7</td><td>B</td><td>18</td><td>3</td></tr><tr><td>7</td><td>2</td><td>2</td><td>B</td><td>6</td><td>1</td></tr></tbody></table>

Based on this data, the production program given by the mathematical model application is illustrated as following: The simulation results show a deterministic optimal solution for production and maintenance scheduling. Machines' unavailability is expressed by three letters: B (respectively, R) for pre-programmed production for a blue batch (respectively, red batch) and M for preventive maintenance.

The results shown in the Table 2 led us to conclude that the model constraints were respected (machines' unavailability and non-mixed batches in each time unit. For example, batch 2 was operated in the station 2, during the third and fourth time units. From a total of 11 batches, one batch was not scheduled for operation. The batch number 6 was rejected. This rejection was due to the production constraints (batch size, earliest and latest manufacturing dates, etc.).

Conforming to our new control methodology, 2 PN monitors, Pc1 and Pc2, can then be located by eliminating redundant PN monitors when the linear system composed of reachability MTSI conditions and cycle equations is solved. The controlled system net is obtained by applying the theory of regions presented in the previous section and shown in the Table 3 and the Figure 5.
<table><caption>**Table 2.** Production planning for the flexible manufacturing system.</caption><thead><tr><th rowspan="2">System</th><th rowspan="2"></th><th colspan="8">Planning Horizon</th></tr><tr><th>1</th><th>2</th><th>3</th><th>4</th><th>5</th><th>6</th><th>7</th><th>8</th></tr></thead><tbody><tr><td rowspan="2">1</td><td>S2</td><td>B</td><td>7</td><td>2</td><td>2</td><td>4</td><td>4</td><td>4</td><td>4</td></tr><tr><td>S3</td><td>5</td><td>B</td><td>3</td><td>3</td><td>M</td><td>R</td><td>1</td><td>1</td></tr></tbody></table>

<table><caption>**Table 3.** The controlled Petri net model of FMS.</caption><thead><tr><th>PN Controllers</th><th>The Initial Marking</th><th>The Incidence Vector</th></tr></thead><tbody><tr><td>P<sub>c1</sub></td><td>3</td><td>(-1, -2, 0, 1, 2)</td></tr><tr><td>P<sub>c2</sub></td><td>2</td><td>(0, -1, 0, 0, 1)</td></tr></tbody></table>

<figure><img src="image_8.png" /><figcaption>**Figure 5.** The controlled Petri net model of FMS.</figcaption></figure>

The proposed policy was implemented in the flexible manufacturing system installed in our laboratory in France and the computation of PN controllers was done by using CPLEX software. The results analysis showed that our control approach using PN was more effective than previous methodologies based on the theory of regions. Indeed, for the same number of controllers, one can supervise the system under less computational burden. Our proposed control approach was merged with mathematical modeling tools to face one of the real constraints in the industrial world.

The proposed control policy was implemented in the FMS through a JAVA application (Figure 6), (Rezig et al. 2018) [23], wherein the controlled PN model was edited and then transformed into a comprehensible code supported by the Programmable Logic Controller (PLC). Once the internal input/output signals of the PLC are detected, one can transform the PN model into a language supported by the PLC. The LIST language of IEC norm 61131-3 was chosen.

In fact, the JAVA application was developed to model any PN controller and then generate the corresponding LIST code that will be sent to the target in a second time. The interface is functional from the creation of the project until the code generation. It is possible to save a project, to model the controlled PN as in any editor, and to associate the inputs to their addresses in the PLC. Then, the generated code (Figure 7) will be tested using the SIEMENS STEP7 compiler (Figure 8).
<figure><img src="image_9.png" /><figcaption>Figure 6. A screenshot of the application interface.</figcaption></figure>

<figure><img src="image_10.png" /><figcaption>Figure 7. A screenshot of the generated code.</figcaption></figure>
<figure><img src="image_11.png" /><figcaption>Figure 8. The testing code using STEP 7.</figcaption></figure>

# 4. Mathematical Model Extensions

The main advantage of the current proposed model is its mathematical flexibility that permits adapting it to many production applications by modifying the model constraints.

In this section, we present some different applications where the model has shown its efficiency to validate the flexibility characteristic.

## 4.1. Case of Manufacturing System

This application was discussed in an existing work in the literature [24] with an algorithm for manufacturing planning under unavailability constraints. In this section, we extended the database used for the numerical example to show the model efficiency dealing with a bigger size problem.

Table 4 gives the initial unavailability dates of a manufacturing system in the time horizon that will be the subject of scheduling. As mentioned before, the unavailability, in this paper, corresponds to preprogrammed production activities: Based on Table 4, as an example, preprogrammed production actions in the studied time horizon for the system 1 are the manufacturing of batch type B for fifth and sixth time units.

For the numerical example, we considered five workshops having eight manufacturing systems (three double workshops and two single). The following database was considered (Table 5):

* The horizon time was fixed at 14 units of time.

* The manufacturing duration (MD) was fixed at three units of time for batch type A and two units of time for batch type B.

* Initial unavailability was expressed by the preventive maintenance action plan by the letter M in the Tables 4 and 6 and preprogrammed production actions expressed by Letter B for batch type B and Letter A for batch type A.
<table><caption>**Table 4.** Manufacturing systems' initial unavailability.</caption><thead><tr><th rowspan="2">Manufacturing Systems</th><th colspan="14">Planning Horizon</th></tr><tr><th>1</th><th>2</th><th>3</th><th>4</th><th>5</th><th>6</th><th>7</th><th>8</th><th>9</th><th>10</th><th>11</th><th>12</th><th>13</th><th>14</th></tr></thead><tbody><tr><td>Workshop 1</td><td>1</td><td></td><td></td><td></td><td>B</td><td>B</td><td>A</td><td>A</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Workshop 2</td><td>2</td><td></td><td></td><td></td><td>M</td><td>M</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Workshop 3</td><td>3</td><td></td><td></td><td></td><td></td><td></td><td>A</td><td>B</td><td>B</td><td></td><td></td><td></td><td>A</td><td>A</td></tr><tr><td></td><td>4</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>B</td><td></td><td></td><td></td></tr><tr><td>Workshop 4</td><td>5</td><td>A</td><td>A</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>B</td></tr><tr><td></td><td>6</td><td>A</td><td>A</td><td></td><td>B</td><td>B</td><td>B</td><td>B</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Workshop 5</td><td>7</td><td>A</td><td>A</td><td>A</td><td>A</td><td>B</td><td>B</td><td>B</td><td></td><td></td><td></td><td></td><td>B</td><td>A</td></tr><tr><td></td><td>8</td><td>A</td><td>A</td><td>A</td><td>A</td><td>B</td><td>B</td><td>B</td><td>A</td><td>A</td><td>A</td><td></td><td></td><td>A</td></tr></tbody></table>

<table><caption>**Table 5.** Data for operated batches.</caption><thead><tr><th>Product (i)</th><th>EM (i)</th><th>LM (i)</th><th>T (i)</th></tr></thead><tbody><tr><td>1</td><td>1</td><td>2</td><td>B</td></tr><tr><td>2</td><td>2</td><td>3</td><td>A</td></tr><tr><td>3</td><td>3</td><td>4</td><td>A</td></tr><tr><td>4</td><td>3</td><td>6</td><td>B</td></tr><tr><td>5</td><td>9</td><td>10</td><td>A</td></tr><tr><td>6</td><td>8</td><td>12</td><td>A</td></tr><tr><td>7</td><td>12</td><td>12</td><td>A</td></tr><tr><td>8</td><td>9</td><td>9</td><td>B</td></tr><tr><td>9</td><td>12</td><td>13</td><td>A</td></tr><tr><td>10</td><td>13</td><td>13</td><td>B</td></tr><tr><td>11</td><td>13</td><td>13</td><td>A</td></tr><tr><td>12</td><td>8</td><td>11</td><td>A</td></tr><tr><td>13</td><td>3</td><td>9</td><td>B</td></tr><tr><td>14</td><td>8</td><td>11</td><td>A</td></tr><tr><td>15</td><td>10</td><td>10</td><td>A</td></tr></tbody></table>

<table><caption>**Table 6.** Optimal manufacturing planning.</caption><thead><tr><th rowspan="2">Manufacturing Systems</th><th colspan="14">Planning Horizon</th></tr><tr><th>1</th><th>2</th><th>3</th><th>4</th><th>5</th><th>6</th><th>7</th><th>8</th><th>9</th><th>10</th><th>11</th><th>12</th><th>13</th><th>14</th></tr></thead><tbody><tr><td>Workshop 1</td><td>1</td><td>2</td><td>2</td><td>2</td><td>B</td><td>B</td><td>A</td><td>A</td><td></td><td></td><td></td><td>7</td><td>7</td><td>7</td></tr><tr><td>Workshop 2</td><td>2</td><td></td><td>4</td><td>4</td><td>M</td><td>M</td><td></td><td></td><td>8</td><td>8</td><td></td><td></td><td>10</td><td>10</td></tr><tr><td>Workshop 3</td><td>3</td><td>1</td><td>1</td><td></td><td></td><td></td><td>A</td><td>B</td><td>B</td><td>5</td><td>5</td><td>5</td><td>A</td><td>A</td></tr><tr><td></td><td>4</td><td></td><td></td><td>3</td><td>3</td><td>3</td><td></td><td>6</td><td>6</td><td>6</td><td>B</td><td>9</td><td>9</td><td>9</td></tr><tr><td>Workshop 4</td><td>5</td><td>A</td><td>A</td><td>13</td><td>13</td><td>13</td><td>14</td><td>14</td><td></td><td></td><td></td><td></td><td></td><td>B</td></tr><tr><td></td><td>6</td><td>A</td><td>A</td><td></td><td>B</td><td>B</td><td>B</td><td>B</td><td></td><td>10</td><td>10</td><td></td><td></td><td></td></tr><tr><td>Workshop 5</td><td>7</td><td>A</td><td>A</td><td>A</td><td>A</td><td>B</td><td>B</td><td>B</td><td>12</td><td>12</td><td></td><td></td><td>B</td><td>A</td></tr><tr><td></td><td>8</td><td>A</td><td>A</td><td>A</td><td>A</td><td>B</td><td>B</td><td>B</td><td>A</td><td>A</td><td>A</td><td></td><td></td><td>A</td></tr></tbody></table>

Table 6 illustrates the obtained results. The simulation results highlight the optimal production scheduling in the given time horizon and in function of model constraints. Results led us to conclude that production constraints, that two batches of different types could not be in the same workshop at a given time t, were respected. For instance, batch 2 was operated in the first workshop, on the first machine during the second, third, and the fourth time units. Batch 5 was operated on the third machine of the Workshop 3 on the 10th, the 11th, and 12th time units.

The optimal solution was obtained with the solver CPLEX, after 2 min and 50 s of calculation, which corresponds to 190,134 iterations. From a total of 11 batches, one batch was not scheduled for operation. The batch was rejected due to the earliest and latest manufacturing dates' constraint.

We proposed a performance comparison between the solvers used, which were, in this case, CPLEX and Xpress. We considered five experiments to schedule 15, 20, 25, 30, and 50 products. The results obtained are illustrated in Table 7.

<footnote>* The colored cell means the availability dates of the manufacturing system.</footnote>
<table><caption>Table 7. Results of resolution.</caption><thead><tr><td>Products Number</td><td>Computation Time in s (CPLEX)</td><td>Computation Time in s (Xpress)</td></tr></thead><tbody><tr><td>15</td><td>170</td><td>190</td></tr><tr><td>20</td><td>2800</td><td>1800</td></tr><tr><td>25</td><td>2700</td><td>1800</td></tr><tr><td>30</td><td>3600</td><td>3800</td></tr><tr><td>50</td><td>46</td><td>3800</td></tr></tbody></table>

We note that the results obtained with CPLEX and Xpress were nearly the same for the case of 15 products. For the case of 20 and 25 products, we note that CPLEX was faster with the same given optimal solution. Moreover, in the case of 50 products, CPLEX reached the optimal solution within a few seconds, whereas Xpress spent much more time before getting a solution, which was not the optimal one. We can conclude then that, in the case of this algorithm resolution, it would be better to use the CPLEX solver.

## 4.2. Case of Hospital Beds' Management

The proposed mathematical model was also used for beds' management planning and management in healthcare establishments [15].

Beds' management is a complex problem that lots of hospital centers decide to integrate, to well manage the financial impact on the budget and to maximize the acceptance rate of patients.

Many proposed models are based on reducing hospitalization cost and optimizing the use of resources. In our proposal [15], the model considered the capacity of beds for two types of patients: Scheduled and non-scheduled patients. Otherwise, the model managed also preventive maintenance actions during the planning horizon.

The idea of our work was to apply the proposed mathematical algorithm with some modifications to be in good agreement with real specific constraints of this application from which we can cite:

* The need of considering some cases where some patients need to be isolated, so assigned to a room with a single bed.

* The need of replanning the refused patients given from the first planning proposal, by modifying, if possible, the earliest and latest acceptance dates.

The model was used in an analogical way with the example presented for manufacturing system. The workshops designed the rooms, the manufacturing systems designed the beds, and the products were assimilated to patients. For more details and numerical illustrations, the reader may refer to our previous work [15].

The actual proposed mathematical model could also be extended to several other applications with adaptations on constraints, objective function, and parameters characteristics such as museum system or the study of big data in complex and social networks [25-28].

For instance, the problem of visitors' museum touring could be addressed, while considering physical parameters, as well as visitors' interests and social interactions, towards maximizing their perceived quality of experience (QoE). In this case, it would be interesting to develop this proposal by establishing an analogy between hospital environment (hospital, patients, beds, and characteristics) and museum case (museum, visitors, resources, and exhibits' characteristics).

## 5. Conclusions

This work aimed to propose a new approach in mathematical modeling optimization. The contribution of this paper was, firstly, to propose a linear optimization model for a joint production and maintenance planning and, secondly, to show the importance of such models in different industrial issues and particularly in the case of flexible manufacturing system where the Petri net modeling is more commonly used. Furthermore, an application example of our methodology, such as hospital beds management, was presented in this paper to show the effectiveness of our mathematical model. Thus, we backed up our
proposals by another illustrative example and a real case of study. Therefore, the algorithm for solving an
optimal production planning under production and unavailability constraints was discussed.

Thanks to the modeling tools, decision makers could optimize the production planning which
depends on several constraints. The mathematical model was then applied on a discrete event system
installed in our laboratory (University of Lorraine, Metz, France). Even though the main used tool for
the flexible manufacturing system was the PN modeling, we showed in this article that it could be
controlled with mathematical modeling, in the case of complex production issues and, so, there is no
need for more complex tools in PN, such as colored PN tool. Therefore, thanks to the mathematical
model solution output, the PN supervisor was implemented via STEP7 software.

Future works aim to integrate other production constraints in the manufacturing planning
algorithm to more generalize the model usefulness for other industrial applications.

**Author Contributions:** The authors of this paper are specialists in the industrial engineering field and more precisely in production and maintenance planning for optimizing for FMS scheduling. Our teamwork tested the control model on a (FMS) flexible manufacturing system installed in our laboratory (LGIPM) by using all the appropriate software (SCHNEIDER Unity Pro XL and Siemens STEP7) for control software, simulation, and modeling software, CPN Tools, and, finally, supervision software, WINCC FLEXIBLE. Conceptualization, S.R., S.T., and W.E.; methodology, W.E.; software, S.R.; validation, S.T., W.E., and N.R.; formal analysis, W.E.; investigation, S.R.; resources, N.R.; data curation, N.R.; writing—original draft preparation, R.S.; writing—review & editing, R.S. and W.E.; visualization, S.T.; supervision, N.R.; project administration, N.R.; funding acquisition, N.R. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research received no external funding.

**Acknowledgments:** The team is grateful to the entire MDPI team and the reviewers for assessing our article titled: *Mathematical Model for Production Plan Optimization- A Case Study of Discrete Event Systems*. We also acknowledge everyone in our research laboratory (Laboratoire de Génie Informatique, de Production et de Maintenance in Metz) who contributed in this research with their continued support and efforts.

**Conflicts of Interest:** The authors declare no conflict of interest.

**Abbreviations**

TR: Theory of regions

DES: Discrete event systems

FMS: Flexible manufacturing system

GMEC: Generalized mutual exclusion constraint

PN: Petri net

RG: Reachability graph

MTSI: Marking/transition separation instance

NP: The total number of batches

H: Time horizon

NMS: The total number of manufacturing systems

EMᵢ: Earliest manufacturing date for batch *i*

LMᵢ: Latest manufacturing date for batch *i*

Tᵢ: Batch type *i*

MDᵢ: Manufacturing duration of batch *i*

M: Positive constant

NW: Number of workshops

t: Time elementary period

Bᵢ,ₜ: 1 if manufacturing system *i* is free in the time *t*, 0 otherwise

Mainᵢ,ₜ: 1 if there is a preventive maintenance action on the manufacturing system *i* in the time *t*, 0 otherwise

Mᵢ,ₖ,ₜ: 1 if manufacturing system *j* and *k* are in the same workshop *l*, 0 otherwise

Tᵢ = -1 if batch type is A, 1 if its type is B

SPᵢ,ₜ = -1 if the manufacturing system *i* is occupied by a batch type A during *t*, 1 if it is occupied by B

Workᵢ: 0 if the workshop *l* has one manufacturing system, 1 if it has two

The decision variables of this model are as follows:

Xᵢ,ₜ: 1 if batch *i* is assigned in manufacturing system *l* during the period *t*, 0 otherwise.

Fᵢ: 0 if batch *i* is operated, 0 otherwise.

Aᵢ,ₜ: 1 if batch *i* is assigned in manufacturing system *l*, 0 otherwise.

Jᵢ: Indicates the real manufacturing date

Endᵢ: Indicates the end manufacturing date

Variables *i*, *l*, and *t* have to be included respectively in [1, NP], [1, L], and [1, T].
References

1. Ramadge, P.J.; Wonham, W.M. Supervisory control of a class of discrete event processes. *SIAM J. Control Optim.* **1987**, *25*, 206–230. [CrossRef]

2. Jiao, T.; Chang, R.; Nan, X. On the invariance property of reduced supervisors from the perspective of vector discrete-event systems. *Int. J. Control* **2020**, *1–19*. [CrossRef]

3. Golnaraghi, F.; Kuo, B.C. Automatic control systems. *Complex Var.* **2010**, *2*, 1.

4. Jiang, S.; Kumar, R. Failure diagnosis of discrete-event systems with linear-time temporal logic specifications. *IEEE Trans. Autom. Control* **2004**, *49*, 934–945. [CrossRef]

5. Wada, A.; Takai, S. Verification of Codiagnosability for Decentralized Diagnosis of Discrete Event Systems Subject to Permanent Sensor Failures. In Proceedings of the 18th European Control Conference (ECC) IEEE, Naples, Italy, 25–28 June 2019; pp. 1726–1731.

6. Rezig, S.; Achour, Z.; Rezg, N.; Kammoun, M.A. Supervisory control based on minimal cuts and Petri net sub-controllers coordination. *Int. J. Syst. Sci.* **2016**, *47*, 3425–3435. [CrossRef]

7. Rezig, S.; Achour, Z.; Rezg, N. Control Synthesis Based on Theory of Regions with Minimal Reachability Graph Knowledge. *IFAC 2016*, *49*, 1383–1388. [CrossRef]

8. Rezig, S.; Achour, Z.; Rezg, N. Theory of Regions for Control Synthesis without Computing Reachability Graph. *Appl. Sci.* **2017**, *7*, 270. [CrossRef]

9. Frost & Sullivan. *World Manufacturing Execution Systems (MES) Market*; N668-10; Frost & Sullivan: Mountain View, CA, USA, 2010.

10. Giffler, B.; Thompson, G.L. Algorithms for solving production-scheduling problems. *Oper. Res.* **1960**, *8*, 487–503. [CrossRef]

11. Florian, M.; Lenstra, J.K.; Rinnooy Kan, A.H.G. Deterministic production planning: Algorithms and complexity. *Manag. Sci.* **1980**, *26*, 669–679. [CrossRef]

12. Yan, H.; Zhang, Q.A. Numerical method in optimal production and setup scheduling of stochastic manufacturing systems. *IEEE Trans. Autom. Control* **1997**, *42*, 1452–1455. [CrossRef]

13. Rezg, N.; Hajej, Z.; Boschian-Campaner, V. *Production and Maintenance Optimization Problems: Logistic Constraints and Leasing Warranty Services*; John Wiley & Sons: Hoboken, NJ, USA, 2016.

14. Harjunkoski, I.; Maravelias, C.T.; Bongers, P.; Castro, P.M.; Engell, S.; Grossmann, I.E.; Wassick, J. Scope for industrial applications of production scheduling models and solution methods. *Comput. Chem. Eng.* **2014**, *62*, 161–193. [CrossRef]

15. Jeong, S.J.; Lim, S.J.; Kim, K.S. Hybrid approach to production scheduling using genetic algorithm and simulation. *Int. J. Adv. Manuf. Technol.* **2006**, *28*, 129–136. [CrossRef]

16. Ezzeddine, W.; Schutz, J.; Rezg, N. Modeling of a Management and Maintenance Plan for Hospital Beds. In *Modelling, Computation and Optimization in Information Systems and Management Sciences*; Springer International Publishing: Cham, Switzerland, 2015; pp. 295–306.

17. Liu, Q.; Dong, M.; Chen, F.F.; Lv, W.; Ye, C. Single-machine-based joint optimization of predictive maintenance planning and production scheduling. *Robot. Comput. Integr. Manuf.* **2019**, *55*, 173–182. [CrossRef]

18. Gharbi, A.; Kenne, J.P. Production and Corrective Maintenance Planning of FMS Through Simulation Optimization. In Proceedings of the 4th International Conference on Engineering Design and Automation, Orlando, FL, USA, 24–28 April 2000.

19. Rezg, N.; Xie, X.; Mati, Y. Joint optimization of preventive maintenance and inventory control in a production line using simulation. *Int. J. Prod. Res.* **2004**, *42*, 2029–2046. [CrossRef]

20. Murata, T. Petri nets: Properties, analysis and applications. *Proc. IEEE* **1989**, *77*, 541–580. [CrossRef]

21. Ghaffari, A.; Rezg, N.; Xie, X. Algebraic and Geometric Characterization of Petri Net Controllers Using the Theory of Regions. In Proceedings of the Sixth International Workshop on Discrete Event Systems, Zaragoza, Spain, 4 October 2002; pp. 219–224.

22. Ghaffari, A.; Rezg, N.; Xie, X. Live and Maximally Permissive Controller Synthesis Using Theory of Regions. In *Synthesis and Control of Discrete Event Systems*; Springer: Boston, MA, USA, 2002; pp. 155–166.

23. Ghaffari, A.; Rezg, N.; Xie, X. Design of a live and maximally permissive Petri net controller using the theory of regions. *IEEE Trans. Robot. Autom.* **2003**, *19*, 137–141. [CrossRef]

24. Rezig, S.; Ghorbel, C.; Achour, Z.; Rezg, N. PLC-Based implementation of Supervisory Control for Flexible Manufacturing Systems using Theory of Regions. *Int. J. Autom. Control* **2019**, *13*, 5. [CrossRef]
25. Ezzeddine, W.; Schutz, J.; Rezg, N. Algorithm for Manufacturing Planning Under Unavailability Constraints. In Proceedings of the International Conference on Communication, Management and Information Technology (ICCMIT 2017), Warsaw, Poland, 3–5 April 2017.

26. Tsiropoulou, E.E.; Thanou, A.; Papavassiliou, S. Quality of Experience-based museum touring: A human in the loop approach. *Soc. Netw. Anal. Min.* **2017**, *7*, 33. [CrossRef]

27. Singhal, C.; De, S. (Eds.) *Resource Allocation in Next-Generation Broadband Wireless Access Networks*; IGI Global: Hershey, PA, USA, 2017.

28. Thai, M.T.; Wu, W.; Xiong, H. (Eds.) *Big Data in Complex and Social Networks*; CRC Press: Boca Raton, FL, USA, 2016.

<figure><img src="image_12.png" /></figure>

© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).