## 2 Materials and Methods
### Pseudocode
```
1:Inputs:
2:Set of jobs \(J=\{j_{1},j_{2},...,j_{n}\}\)
3:Set of machines \(M=\{m_{1},m_{2},...,m_{k}\}\)
4:Processing times \(r_{jm}\) for job \(j\) on machine \(m\)
5:Earliest start time \(l_{jm}\), latest completion time \(q_{jm}\)
6:Wear thresholds and initial wear levels per machine
7:Precedence constraints for job dependencies
8:Setup times for task transitions
9:Maintenance requirements and intervals
10:Model Formulation:
11:Define decision variables: * \(s_{jm}\): Start time of job \(j\) on machine \(m\) * \(y_{jm}\in\{0,1\}\): Binary assignment of job \(j\) to machine \(m\) * \(w_{jkm}\geq 0\): Waiting time between tasks \(j\) and \(k\) on machine \(m\) * \(Z\): Total completion time
12:Objective Function:
13:Minimise total completion time while balancing machine usage: \[\min Z\cdot BIG+\sum_{(j,k,m)\in D}w_{jkm}+\sum_{(j,m)\in T}s_{jm}\] (9)
14:Constraint Definition:
15:Ensure job precedence constraints are met
16:Ensure that no two jobs run simultaneously on the same machine
17:Include setup times for transitions between tasks
18:Prevent exceeding machine wear thresholds
19:Schedule preventive maintenance when needed
20:Optimisation Process:
21:Solve the MIP model using the CBC solver:
22:while solution is not optimal and solver time limit not exceeded do
23:Sort jobs \(j\in J\) by priority level (e.g., high \(\rightarrow\) low)
24:Preferentially assign high-priority jobs within feasible time windows
25:Assign jobs to machines based on availability and priority
26:Adjust start times and incorporate maintenance slots
27:Update machine wear levels based on assigned tasks
28:Calculate objective function:
29:Compute \(Z\) as the total completion time
30:Compute total waiting times \(\sum w_{jkm}\)
31:Compute total start times \(\sum s_{jm}\)
32:if maintenance is required then
33:Schedule maintenance before the next critical wear threshold
34:endif
35:if a machine has an idle period and has not exceeded its wear threshold then
36:Schedule additional preventive maintenance in the available time slot
37:endif
38:Recalculate job scheduling based on updated conditions
39:endwhile
40:Validation:
41:Ensure that all constraints are met: * Jobs must be completed within deadlines * Maintenance must be scheduled within limits * No machine overloading allowed
42:Outputs:
43:Optimised job and maintenance schedule
44:Machine utilisation report
45:Maintenance forecasts and Gantt chart visualisation

## 3 Results and Visualisation

Based on the developed optimisation model, this section presents key findings that illustrate its impact on production planning and maintenance management. The following visualisations, generated directly from the model calculations, show the dynamic allocation of production and maintenance tasks within a given time frame, the evolution of machine conditions over time and relevant recommendations for maintenance personnel. The advantages of this model include the integration of fixed maintenance intervals based on time and wear, together with the flexibility to incorporate individual maintenance actions into the production schedule. The visualisations generated serve as a decision-making tool for production planners and maintenance teams, improving coordination and efficiency within the operational planning horizon, especially when dealing with short-term adjustments. ### Production and Maintenance Tasks in the Machine Allocation Schedule

The machine schedules (see Figure 1) visualise the timing of production orders and maintenance tasks on the individual machines. The colour coding indicates production orders that belong together and consist of several production steps with defined predecessor and successor relationships and priorities. Maintenance slots are marked separately to visualise their influence on machine availability. Other relevant factors, such as set-up times or unused time slots, can also be mapped in the model. The latter become particularly clear in the visualisation and can be used for more efficient planning.