# FMS Scheduling under Availability Constraint with Supervisor Based on Timed Petri Nets
## 6 Mathematical Model
### Model Description  
A set of machines and jobs is considered. The processing duration of a job \(i\) on a machine \(j\) is given by \(h\big{(}t_{i,j}\big{)}\). The formulation is developed to be in good agreement with the defined parameters of TPN modeling. In addition, a preventive maintenance scheduling constraint will be integrated to get a jointly optimal production and maintenance plan.  
The objective function is defined as follows:  
\[min\left(\max_{i=1..n}H(t_{i,m})\right) \tag{13}\]  
subject to:  
\[H\big{(}t_{i,j+1}\big{)}-H\big{(}t_{i,j}\big{)}\geq h\big{(}t_{i,j+1}\big{)},\; \forall\;i=1,\ldots n,\;\forall\;j=0,\ldots m \tag{14}\]  
\[H\big{(}t_{i^{*},j}\big{)}-H\big{(}t_{i,j}\big{)}+\alpha\cdot\big{(}1-A\big{(} t_{i,j},t_{i^{*},j-1}\big{)}\big{)}\geq h\big{(}t_{i^{*},j}\big{)},\;\forall\;i,i^{*}=1, \ldots n,\;i\
eq i^{*}\;\forall\;j=1,\ldots m \tag{15}\]  
\[H\big{(}t_{i,j}\big{)}-H\big{(}t_{i^{*},j}\big{)}+\alpha\cdot A\big{(}t_{i,j}, t_{i^{*},j-1}\big{)}\geq h\big{(}t_{i,j}\big{)},\;\forall\;i,i^{*}=1,\ldots n,\;i \
eq i^{*}\;\forall\;j=1,\ldots m \tag{16}\]  
\[H\big{(}t_{i,j}\big{)}-Z_{i,j}\cdot E_{j}\geq h\big{(}t_{i,j}\big{)},\;\forall \;i=1,\ldots,n,\;\forall\;j=1,2,\ldots,m \tag{17}\]  
\[H\big{(}t_{i,j}\big{)}-\alpha\cdot Z_{i,j}\leq B_{j},\;\forall\;i=1,\ldots n, \;\forall\;j=1,2,\ldots,m \tag{18}\]  
\[A\big{(}t_{i,j},t_{i^{*},j-1}\big{)}=A\big{(}t_{i,j+1},t_{i^{*},j}\big{)},\; \forall\;i,i^{*}=1,\ldots,n,\;\forall\;j=1,\ldots,m-1 \tag{19}\]  
\[A\big{(}t_{i,j},t_{i^{*},j-1}\big{)}=0\;\forall\;1\;\forall\;i,i^{*}=1, \ldots,n,\;\forall\;j=1,2,\ldots,m \tag{20}\]  
\[Z_{i,j}=0\;\text{or}\;1,\;\forall\;i,i^{*}=1,\ldots,n,\;\forall\;j=1,2, \ldots,m \tag{21}\]  
The objective function (13) aims to minimize the firing global clock of last transitions corresponding to the last machine \(m\). The constraint (14) states that a job is processed, on each machine at once, without preemption. The constraints, (15) and (16) ensure that only one job can be performed on the machine at a time. In addition, the firing sequence of transitions (production sequence) has to respect the preventive maintenance period \([B_{j},E_{j}]\) modeled with (17) and (18). Constraint (19) ensures  
Figure 4: The decomposed TPN model.  
that the order of jobs remains the same on all machines. Constraints (20) and (21) define the restrictions for the decision variables.  
The linear programming (13)-(21) is a Mixed-Integer Linear Programming (MILP) because the decision variables are constrained to be binary.  
**Remark 2**.: _In the current study, the end point of interest is the determination of \(A(t_{i,1},t_{i^{*},0})\), \((i,i^{*}=1,...,n)\); our proposed \(TPN\) model assumes that the order of jobs on the machines is the same as the order defined in the first one (Section 4 assumptions)._  
As mentioned, our contribution is to provide the optimal firing sequence that will be used to synthetize the scheduling supervisor. Because of large-scale scheduling problems' NP-hardness [39; 40], we propose an efficient metaheuristic approach based on the genetic algorithm model.