## 3 Materials and Methods  
Discrete-event simulation is a computer modeling technique that offers an intuitive and versatile approach to reproducing the dynamic behaviors of complex systems [87]. This methodology is implemented in Witness, an interactive visual simulation software used in this research to reproduce the production process [88]. Model construction in the Witness Horizon simulation environment is characterized by an iterative process featuring four macro phases. The research methodology that enabled the development of the digital model of the real production process is divided into several consecutive stages, as shown in Figure 2.  
The methodology followed in this study represents a structured and replicable approach for the analysis, modeling, and optimization of a production process through digital simulation. Below, each step is described, with emphasis on the technical aspects required to ensure the reproducibility of the entire process. Step 1: Process characterization and input analysis  
The first phase consists of a detailed assessment of the existing production process. During a period of direct observation at the company, a systematic collection of data and information regarding the daily operation of the system was carried out. These data include the following:  
* Operation cycle times: Precise measurements of the time taken to complete each stage of the production process. * Material and product flows: Monitoring the movement of materials through the various workstations. * Scrap levels and rework: Collecting data on quantities of defective products and rework rates. * Resource utilization: Analysis of the use of machines, operators, and buffers along the process. This information was used to construct a detailed flowchart of the production process, shown in Figure 3. This diagram represents the basis for subsequent digital modeling. Thorough analysis of the inputs ensures that the model accurately reflects the behavior of the real system [89]. Accuracy is ensured by verifying randomness (independence of events), homogeneity (uniformity of the data population), and goodness of fit (consistency with the theoretical distribution), through specific statistical tests. Below is a description of each test:  
* Randomness: Randomness in the input data is essential to ensure that simulations are not affected by unanticipated patterns or correlations. In a discrete-event simulation, events should occur independently, reflecting the stochastic nature of the real system. To analyze randomness, statistical tests such as Pearson's test for independence are used, which tests whether two variables are independent of each other [90]. If the variables show strong dependence, it could indicate the presence of a pattern that must be eliminated to obtain a correct simulation. Another method is the runs test, which examines the sequence of the data to detect the presence of patterns. Finally, the autocorrelation test helps identify any temporal dependencies between successive data points, ensuring that the inputs are not influenced by previous events [91]. * Homogeneity: Homogeneity of input data is crucial to ensure that all data come from the same population or that their variances are equivalent. This is especially important when modeling complex systems with multiple components or operational steps. To check for homogeneity, statistical tests such as [PERSON]'s test, which assess whether multiple samples come from populations with the same variance, are used. However, because this test can be sensitive to deviations from normality, Levene's Test offers a more robust alternative [92]. Homogeneity is further analyzed using nonparametric tests such as the Kruskal-Wallis Test, which compares the averages of multiple groups without assuming a normal distribution. In addition, visual tools such as box plots and Q-Q plots make it possible to observe the distributions of the data and visually verify the equality of variances between groups [93].