## 3 Materials and Methods
* Goodness of fit: The goodness of fit of the input data refers to how well the observed data follow an expected theoretical distribution. This is critical to ensure that the models used in the simulation accurately represent the behavior of the real system. The chi-square test is commonly used to compare the observed distribution with an expected distribution, detecting significant discrepancies. The Kolmogorov-Smirnov test, on the other hand, compares a sample distribution with a reference distribution, checking their congruence over all points in the distribution [94]. A more sensitive test, the Anderson-Darling, places more emphasis on the tails of the distribution, where discrepancies can have a significant impact on simulation results. Using these goodness of fit tests helps ensure that the input data are well represented by the theoretical models used in the simulation [95]. Step 2: Model development and validation  
Once the process analysis was completed, a digital model was constructed using Witness Horizon simulation software v.14. Model construction is an iterative process that consists of the following technical steps:  
* Insertion of physical elements: The first step is to insert physical elements representing the system's resources into the model. These include the following:
* Machines: Identification and modeling of the machines used in the process, with parameters such as capacity, utilization rate, and setup times. * Buffers: Definition of buffers between operations, specifying maximum capacity and material flow management policies. * Operators: Modeling the workforce, with the inclusion of parameters such as availability, work times, and movement between locations. * Defining logical elements: After modeling the physical elements, move on to configuring the logical elements, which are needed to simulate resource behavior:
* Processing and waiting times: Specifying cycle times for each operation and waiting or transit times between operations. * Resource capacity and availability: Configuration of resource operating limits and their time availability. * Maintenance and failure parameters: Inclusion of variables to simulate scheduled maintenance events and sudden failures. * Implementation of connections among resources: Defining the paths between different resources, creating a network that allows simulating multiple flows and different operational sequences within the same model. This step is crucial to reproduce the complexity of real production processes. * Setting input/output rules: Finally, the rules governing the flow of materials and products within the system are established. These rules determine how product unitsmove from one stage to another, what conditions must be met for transfer, and how to handle any bottlenecks. After construction, the digital model undergoes a rigorous validation phase to ensure its accuracy. The process is inherently iterative, as the insights gained from the analysis phase feed back into the modeling phase, leading to model refinements and subsequent re-execution [96]. This cycle continues until the model accurately reflects the system or the desired insights are achieved according to the following iteration loop. This iterative, event-driven approach allows DES to model complex systems with a high level of detail and accuracy, adapting to changes and providing deep insights into system dynamics over time [97]. Figure 2: Research methodology. It involves the following:  
* Comparison with real data: The behavior of the model is compared with real data collected during the analysis phase. Matching cycle times, production rates, and resource utilization are checked. * Statistical analysis: Statistical tests are performed to ensure that the model results are statistically aligned with the real system, including analysis of variance and significance tests. Figure 3: Flow diagram of the production process.