## 3 Organization of the Maintenance and Repair of Technological Process Units  
We assume that the main component of the technological process is the \"Task.\" The unit of equipment used in the technological process is denoted as \"Unit.\" We consider a set of technological tasks \(z_{k}\in Z,k=\overline{1,K_{\cdot}}\), a set \(AU\) of available units \(u_{n}\in AU,n=\overline{1,N_{\cdot}}\), and a Gantt chart \(G_{t}\), which describes the schedule for performing technological tasks. The maintenance and repair management system should perform the following functions:  
1. The model assigns available units \(u_{n}\) for tasks according to the schedule \(G_{t}\). 2. The system performs other tasks in case of the absence of the necessary units for task \(z_{k}\). When the unit becomes available, the model assigns them to the delayed task \(z_{k}\). 3. The model removes a unit from service in a defect or equipment failure, and replaces it with an available unit from the reserve \(AU\). 4. When a unit maintenance request is received, similar actions are taken. 5. Continuous monitoring of the unit parameters \"residual resource\" and \"time to preventive maintenance\". When the specified resources are depleted, the unit is decommissioned and replaced with a reserve one. 6. The model controls the unit queues for repair, maintenance, distribution, or recovery of consumable resources. 7. Returning serviced units to reserve \(AU\) for further use in the technological process. A generalized hierarchical structure for scheduling production tasks, assigning units, and maintenance and repair processes is shown in Figure 1. The first level \(L_{1}\) is formed by technological tasks performed according to the Gantt chart. The diagram shows units' movement from the state of availability to the state of activity (level \(L_{2}\)), as well as the transfer of units for repair or maintenance (level \(L_{3}\)). It is also possible to use the mobile service station \(MM\), located closer to the technological process. The level \(L_{4}\) corresponds to consumable resources \(Cs\) and reusable resources \(Ru\) for maintenance and repair. We describe the unit with a vector of parameters:  
\[u=(ID,M_{d},t_{tt},t_{RL},t_{MT},t_{ti},t_{ta}), \tag{1}\]  
where \(ID\) is the identification number of the unit, \(M_{d}\) is the model (type) and modification of the unit, \(t_{tr}\) is the value of the unit operating time after the last maintenance or repair procedure, \(t_{RL}\) is remaining useful life (RUL), \(t_{MT}\) is remaining time before scheduled maintenance, \(t_{ti}\) is the start time of the next exploitation period, and \(t_{ta}\) is the accumulated unit operating time. Decision making is carried out according to the condition-based policy. The inspection time \(t_{I}\) is related to the timing of the serviceability, degradation, and deterioration states of the unit components:  
if \(t_{I}\geq t_{RL}\) or \(t_{I}\geq t_{MT}\) then: preventive replacement of unit;  
if \(t_{I}=t_{PM}\) then: unit predictive replacement;  
if \(t_{I}=t_{F}\) then: unit corrective replacement;  
where \(t_{PM}\) is the prognostic maintenance time, and \(t_{F}\) is the time of a failure occurrence. As follows from Figure 1, the modeled object has a hierarchical character, and belongs to the class of discrete-event systems. Therefore, the adequate model should also have a hierarchical structure. We have chosen hierarchical timed colored Petri nets to simulate the schedule, task execution events, maintenance, and unit repair. Figure 2 shows the relationship of the main modules of the hierarchical HPN model. The ZSch module, based on the specified Gantt chart Gt, builds a task graph and assigns unit types for each task. A P\({}_{ZS}\) set of assigned units are transferred to the ZO  
Figure 1: The scheme of interaction of technological objects and tasks of the technological process. Figure 2: The main modules of the technological process hierarchical model. module to complete tasks.