# Method of Multilevel Adaptive Synthesis of Monitoring Object Knowledge Graphs
## 5 Algorithm Description  
Figure 2 represents a schematic diagram of the adaptive state prediction algorithm for a complex monitoring object using policies. The synthesis of the object model is performed in steps, starting from time \(t_{k}\) to the time \(t_{k}+T\) with the step \(\Delta t\). Diagram description:  
Step 1. Setting the initial point in time \(t_{k}\), with reference to which the prediction for the future is made. Step 2. Request the current state of the monitoring object and attribute values of its nodes and edges \(G_{t_{k}}\), \(G_{t_{k}}{}^{\mathit{attr}}\). Step 3. Calculate the set of context metrics \(O_{p,t_{k}}\) at time point \(t_{k}\). The algorithm for step 3 is shown in Figure 3.  
Figure 2: Conceptual diagram of the multilevel adaptive synthesis. The algorithm consists of the following steps:  
1. The context metrics counter is set to zero: \(i=0\). 2. The metric of the context \(O_{i}\) is calculated; the metrics of the context are determined through the elements of the model of the monitoring object, the influence is on which context is significant, and by the values, of which it is possible to determine the context of the monitoring object functioning. 3. According to the assigned range of values, the color for the \(O_{i}\) context metric is determined: \(\bullet\) Normal operation (green range); \(\bullet\) Borderline Operations (yellow range); \(\bullet\) Abnormal or abnormal operation (red range). 4. If there are unconsidered metrics of the context (\(i\leq p\)), the counter of the metrics of the context \(i=i+1\) increases, and a jump to step 2 is performed. Otherwise, it is the end of the algorithm. Step 4. Determine the context event \(S_{i}\) at time \(t_{k}\) (based on the results of calculating the context metrics in step 3). Step 5. Request additional data on node and edge attribute values at the lower levels of the model for the monitored object parameters that fall within the \"Red\" and \"Yellow\" value ranges. Step 6. Policy \(\overline{P}_{S_{i}}\) determination is based on the context event \(S_{i}\) that has been defined at step 4. Step 7. Build the monitored object model \(G_{t_{k}+1}\). The algorithm for step 7 is shown in Figure 4.  
Figure 3: Scheme of the algorithm for determining the context metrics. The algorithm consists of the following steps:  
1. The counter of the model nodes is set to zero: \(i=0\). 2. The range of valid values for the node \(V_{i}^{L}\) is calculated. For this, a rule from the policy \(\overline{P}_{S_{i}}\)- \(P_{S_{i},V_{i}^{L}}\big{(}\overline{G}_{S_{i},l_{k}}\big{)}\) is used. 3. The value for the node \(V_{i}^{L}\) is calculated using the function \(\psi_{V}(FV_{i,l_{k+1}},\ V_{i,l_{k}}^{L})\). 4. If there are no considered nodes (\(i\leq\)_nodes number_), the counter of nodes \(i=i+1\) increases, and a jump to step 2 is performed. Otherwise, to step 5. 5. The counter of the edges of the model is set to zero: \(i=0\). 6. The range of valid values for the edge \(E_{i}\) is calculated. For this, a rule from the policy \(\overline{P}_{S_{i}}\)- \(p_{S_{i},E_{i}}\big{(}\overline{G}_{S_{i},l_{k}}\big{)}\) is used. 7. Calculate the value for the edge \(E_{i}\) using the function \(\psi_{E^{H}}\big{(}FE_{l_{k+1}},\ E_{l_{k}}^{H}\big{)}\) or \(\psi_{E^{R}}\big{(}FE_{l_{k+1}},\ E_{l_{k}}^{R}\big{)}\) depending on the type of edge \(E_{i}\) (vertical or horizontal). 8. If there are unconsidered edges (\(i\leq\)_edges number_), the counter of edges \(i=i+1\) is incremented; go to step 6. Otherwise, it is the end of the algorithm. Step 8. If time point \(t_{k}+T\) has not been reached, proceed to the following step; otherwise, complete the synthesis. Algorithm 1 of the adaptive state prediction method for a complex monitoring object is given below. Figure 4: Diagram of the algorithm for predicting the state of the monitoring object for every step. ```
//Init //Set \(t=t_{k}\) //Set \(t_{k}\)-initial current timestamp for prediction algorithm Set \(G_{t}=getCurrentState(t)\) //Get initial object state.