## 4 Case Study
### DES Results  
After determining the best ML algorithm and dataset case to predict the machine's RUL and failure time, the PdM time slots will be incorporated in the schedule DES simulation. FLEXSIM is the simulation software tool used in this case study. Our case study is a pharmaceutical Factory X, Figure 14 shows the layout of the shopfloor and Table 1 contains the inputs for the production scheduling problems.  
The nature of the products on this line are tablets and capsules. The raw materials of the production line are semi-finished powders for tablets and capsules. The tablets production processes are kneading, drying, blending, compression, coating and packaging. For capsules, the processes are encapsulation, coating and packaging. The following assumptions are set in the simulation:  
* The priority of the products can be set
* The path of each product through the machines is defined
* The working hours of the factory are 462 h per month  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**No. of Workstations** & **No. of Machines** & **No. of Products** & **Production Line Nature** \\ \hline
7 & 18 & 25 & Fully Automatic \\ \hline \hline \end{tabular}
\end{table}
Table 1: Production Line specifications.  
Figure 12: Multi-class classification model results for half case.  
Figure 13: Multi-class classification model results for double case.  
In the fourth workstation, some products cannot be processed on certain machines and each product has different processing times on each machine.
* Products can be processed on two or more machines within the same workstation and backtracking is possible.
* Setup times differ from one product to another.  
The output of the DES simulation is a Gantt chart showing the routing of the products within the production line. The simulation is made multiple times for different dispatching rules EDD, SPT and LPT. The Gantt charts showing the products on the y-axis and the time at which these products are produced on the x-axis is shown in Figure 15. For each product, the sequence of machines for which the product passed on is shown. For example,  
Figure 14: Shop floor layout for Factory X.  
for product 1, it was first processed on machine 1, then machine 8 and finally machine 16. The software also produces a state Gantt chart showing the used machines. The simulation model can produce such chart after using the predicted data from the ML algorithms. The state Gantt chart shows the machines used in the production line on the y-axis and the time at which they were idle, operating or in maintenance on the x-axis. Figure 16 shows the maintenance slots which were added to the simulation model marked with a red box and the machine breakdown in black. These slots are added by the ML algorithm, hence producing a complete schedule showing the sequence of products onto the machines and the PdM slots. Figure 16 shows the state chart produced for the EDD model since it is the best performing dispatching rule.  
The proposed framework was used for makespan calculations for three dispatching rules: EDD, SPT and LPT while including the PdM maintenance time slots. ML algorithms was used to estimate the machine's RUL and possible breakdowns. The EDD, SPT and LPT models produced makespan of 76.82, 104.92, and 116.42 h, respectively. The EDD model produced the minimum makespan. Hence, this case study verified the proposed methodology.  
Figure 16: State chart for production schedule using EDD as a dispatching rule.  
Figure 15: Gantt chart for production schedule using EDD as a dispatching rule.