## 2 Materials and Methods
### Mathematical Optimisation Model  
The model developed extends the classic job-shop scheduling approach by integrating preventive maintenance measures in addition to production tasks. A mixed-integer programming (MIP) model is used to enable the integration of both tasks. This allows dynamic machine allocation, taking into account maintenance intervals, resource availability and delivery dates [15, 16]. This model is particularly suitable for the short-term planning horizon in production environments with a high number of variants, in which production steps need to be organised efficiently. The model recognises and uses unused time slots that arise due to changes in the production plan. This replanning allows machine downtimes to be minimised and maintenance measures to be integrated efficiently without unnecessarily disrupting the production flow. By using MIP, both integer and continuous variables can be modelled in order to optimise machine allocations, maintenance intervals and production processes [15]. These variables enable flexible and precise mapping of time-based and organisational decision-making processes in the model. The objective function aims to minimise production time and maximise machine availability through strategic maintenance measures while at the same time complying with all constraints.  
Although the model is initially based on predefined order sequences and time slots to ensure practical applicability in small-batch production environments, it already contains mechanisms for flexible adaptation. These include prioritisation constraints between jobs and dynamic machine assignments that allow production sequences to be restructured within the feasible planning horizon. In addition, task priorities influence scheduling through time window constraints and are reflected in the objective function through weighted penalties. While real-time sequencing is not yet implemented, future research will focus on integrating the current machine status and workload into the sequencing logic. Maintenance tasks are directly integrated as decision variables in the MIP model. The optimisation logic identifies and utilises idle times not as a downstream processing step, but as an integral part of the central planning strategy. Maintenance affects both the objective function and machine availability. In addition, the model iteratively reschedules when wear limits are reached, ensuring that maintenance is prioritised without disrupting critical order sequences.  
The production plan is calculated again in an iterative optimisation process that is carried out at regular intervals or in the event of unplanned events (e.g., machine failure). Real-time data from production are used to create an updated, customised production and maintenance plan. At the same time, the model identifies unused time slots that arise due to changes in the production plan. When rescheduling, new time dependencies and the availability of resources are taken into account in the operational planning horizon. The model also shows when maintenance tasks can be inserted into existing time slots without affecting the production flow [17]. The model ensures that realistic constraints such as machine availability and precedence conditions are taken into account.  
The objective function and the constraints are described in mathematical detail in Section 2.4. In the model presented, MIP enables precise mapping of machine allocation, maintenance planning and sequencing of production orders by integrating both discrete and continuous decision variables. This results in dynamic and flexible control that can react flexibly to short-term changes in the production process [18].