# Minimization of Material Waste Through Maintenance Interval Optimization in Transport Systems
## 4 Results  
### Testing the Correctness of the Algorithms  
The algorithms were designed using Python version 3.7. To configure the environment required to run the individual programs, the following modules need to be installed:  
* pyodbc--responsible for communication with the database;
* datetime--contains functions related to handling dates and times;
* json--formatting of JSON files;
* requests--allows communication using the REST API interface. By default, the algorithm displays transitions and current results in the console:  
During the implementation phase of the algorithms, several logical errors were identified in conditions or variable increments, which, for example, caused the algorithm to get stuck in a loop with no way out. Issues were also found with data type mismatches, where variables were stored as text but processed as numbers. The conducted tests (Figure 9) helped identify and resolve these issues. All algorithms have been verified and now execute correctly. During the testing of the algorithms' correctness, a conformity criterion was used to measure the consistency of the results with the theoretical maintenance optimization model. We defined an error function \(E\), which measures the difference between the predicted and actual mileage:  
\[E(t)=|M(t)-M_{actual}(t)| \tag{17}\]For the algorithm to function correctly, we expect that \(E(t)\to 0\) for all \(t\ \in T\) where \(T\) is the testing period. Multiple iterations were performed to ensure that the value of \(E(t)\) was minimized, confirming that the algorithm correctly predicts future reviews without generating significant deviations. As part of the tests, the models and functions coded based on the described algorithms were tested. Data Models  
1. Vehicle  
* Attributes: \(V_{\text{id}}\), \(V_{\text{type}}\), \(V_{\text{company}}\), \(M_{\text{current}}\), \(T_{\text{current}}\), \(T_{\text{mileage}}^{\text{update}}\), \(T_{\text{work}}^{\text{update}}\);
* Description: This model stores fundamental information about each vehicle, including its unique identifier (\(V_{\text{id}}\)), type (\(V_{\text{type}}\)), and current operational metrics such as mileage (\(M_{\text{current}}\)) and work time (\(T_{\text{current}}\)), along with dates of the latest updates \(\left(T_{\text{mileage}}^{\text{update}}\text{ and }T_{\text{work}}^{\text{update}}\right)\). It provides the foundation for tracking vehicle utilization and ensuring timely maintenance. 2. CarrierVehicle
* Attributes: \(V_{\text{type}}\), \(M_{\text{current}}\), \(T_{\text{mileage}}^{\text{update}}\), \(T_{\text{current}}\), \(T_{\text{work}}^{\text{update}}\);
* Description: This model provides detailed information about vehicles operated by a transport company, focusing on current mileage (\(M_{\text{current}}\)), work time (\(T_{\text{current}}\)), and dates of updates \(\left(T_{\text{mileage}}^{\text{update}}\text{, }T_{\text{work}}^{\text{update}}\right)\). It enables effective fleet management and optimization of maintenance schedules. 3. ExploitationData
* Attributes: \(T_{\text{end}}\), \(M_{\text{total}}\), \(T_{\text{total}}\);
* Description: This model stores data concerning the completion of operational tasks by vehicles, including the end time of the operation (\(T_{\text{end}}\)), total mileage (\(M_{\text{total}}\)), and total work time (\(T_{\text{total}}\)). It plays a key role in evaluating vehicle performance and planning future maintenance activities. 4. RestApiRequestModel  
Figure 9: Testing each steps of the algorithm—console screen. * Attributes: \(M_{\text{request}}\), \(T_{\text{request}}\);
* Description: This model is used to communicate data through the RestAPI interface, specifically regarding mileage (\(M_{\text{request}}\)) and work time (\(T_{\text{request}}\)). It ensures effective communication between internal and external systems by standardizing data exchange.