## 4 Formal Description of Timed Colored PNs
### ZO Module  
All basic operations for performing production tasks are simulated in the ZO module. The topology of the ZO module is determined by the process Gantt diagram. Each task has a base operations module BOM associated with it. Figure 4 shows the ZO module structure as an example, including three blocks of operations BOM1-BOM3; these are substitution transitions that correspond to ZExec modules on the lower level of the model hierarchy. Figure 3: HPN structure. ZBM modules are intermediate substitution transitions to ZExec modules. The example (Figure 4) implements sequentially parallel execution of the production \"Main Task.\"  
The global color sets and variables are given in Table 1. Table 2 contains a description of the ZO places. Thus, according to Equation (1), the main color set U is defined in the HPN model as a tuple U = (id, md, rt, rl, mt, ti, ta). The unit's unique id and model md associate it with the tasks being performed. The time parameters rt, rl, mt, ti, and ta are used to control the unit's residual life. Only the active unit of work time determines the remaining useful life RUL (rl parameter). In periods of service or repairs to the unit, time rt does not change. \begin{table}
\begin{tabular}{c c c} \hline
**Color Set** & **Color Variables** & **Meaning** \\ \hline ID & id & Unit identification number \\ Model & md & Model of a unit \\ RT & rt & Unit’s operating time \(t_{rt}\) \\ RL & rl & Unit’s remaining useful life \(t_{RL}\) \\ MT & mt & The unit’s remaining time before maintenance \(t_{MT}\) \\ TI & ti & Unit’s exploitation start time \\ TA & ta & Unit’s accumulated operating time \(t_{ta}\) \\ U = product ID*Model*RT*RL*MT*TI*TA & u, upd\_u & Parameters of a Unit \\ Z & z & Task \\ BOOL & b & Failures and maintenance request events \\ ModelZ & mdz & Models of the units assigned to a task \\ \hline \end{tabular}
\end{table} 
Table 1: Global color sets. Figure 4: ZO module. Then from Equation (1), the expression for the unit current operating time \(t_{cu}\) follows:  
\[t_{cu}=t_{c}-t_{ti}+t_{rt}, \tag{6}\]  
where \(t_{c}\) is the model time. Requests for the unit's predictive maintenance are simulated in the process of performing tasks. For this purpose, the random distribution functions are used corresponding to the degradation and deterioration processes of unit parts. At random time \(t_{Mn}\), the Mrq signal is formed, causing a transfer of the unit for maintenance. Similarly, at the moment of time \(t_{F}\), the signal F is generated to simulate the failure occurrence. The unit is operated in the technological process under the following conditions:  
* The inspection time is less than the value of RUL defined for each unit. * The inspection time is less than the time before scheduled maintenance. * There are no signals about the appearance of failure. * There are no predictive maintenance requests. Therefore, the step sequence for simulating a technological process execution is as follows:  
1. Module initialization: Unit model types that can perform operations on the BOM module are set in place MZ. The number of operation cycles is set in place Cc. If necessary, the FE (failure enable) and PrME (predictive maintenance enable) indicators are set. 2. Each BOM\({}_{k}\) module assigns specific units to perform task \(z_{k}\) according to the rule: \[\exists u:u_{n}\in AU\wedge md(u_{n})=mdz(BOM_{k}).\] (7) As a result, the places UPZ 1-UPZ K contain sets of unit models that can perform these tasks throughout the entire period. Note that the set \(AU\) of available units can contain several units of the same model with different \(ID\)s.
3. The \"Main Task\" token movement through the BOMs simulates the execution of a technological process. When a task is completed in the BOM, the place EndZ in the ZExec module receives a token. 4. The RTA analyzer checks the unit operating conditions throughout the BOM module's activity period. If conditions 1 and 2 are not satisfied, the residual resource is exhausted; then, the unit stops working, and it is directed to preventive maintenance.