# Application of Modeling and Simulation in a Self-Reprogrammable Prototype of a Manufacturing System
## 1 Introduction  
Production systems have undergone significant growth since the Industrial Revolution in the late 18 th century. This expansion has been primarily driven by advancements in technologies such as machinery, energy systems, and computing. Moreover, in recent decades, the digital revolution and globalization have introduced profound transformations in consumer markets, consequently reshaping production systems [1]. As a result, numerous companies have expanded their operations internationally, intensifying market competition. This increased competitiveness has led to a significant diversification of product offerings, posing challenges in production management due to shorter product life cycles and a growing demand for personalization and mass customization [2, 3]. Several authors assert that the complexity of production systems is expected to increase due to escalating customer demands, necessitating the implementation of more flexible and agile manufacturing systems [4]. In this scenario, the most impacted areas include production scheduling and the management of operational failures in manufacturing systems, such as rework and supply chain disruptions [5, 6, 7, 8]. To address these challenges, various technologies and computational tools have been developed. Among them, digitalization stands out as a transformative innovation, enabling the consolidation of business data into virtual databases. Another significant advancement involves the application of production simulation software, which facilitates the creation of digital models to evaluate and optimize manufacturing processes within a virtual environment, thereby minimizing disruptions in real-world operations [9; 10; 11]. However, for simulation models to effectively support decision-making, it is crucial to ensure high-quality modeling, which, in turn, depends on the ability to collect and process data from the production system. The evolution of sensors and electronic components used in manufacturing has significantly enhanced data collection and processing capabilities [12]. The integration of these data with simulation models, in conjunction with optimization tools, enables more effective decision-making for manufacturing management [6; 13]. In this context, the concept of smart factories has emerged [12; 14; 15]. In recent years, simulation models have evolved into Digital Twins (DT), wherein the digital environment maintains continuous connectivity with the physical environment through sensors that collect real-time data and transmit it to the models. This connectivity significantly enhances the accuracy of analyses compared to traditional production modeling methods [16; 17; 18]. This real-time data exchange mechanism has become feasible due to advancements in Internet of Things (IoT) tools and concepts [19]. Consequently, DT-based decision-making has become faster and more precise, owing to the integration of production simulation with optimization algorithms, supported by mathematical models and Artificial Intelligence (AI) tools, aligning with the requirements of Industry 4.0 [6; 8; 20; 21; 22]. [PERSON] et al. (2021) argue that Industry 4.0 enables the real-time collection and synchronization of data, allowing manufacturing systems to dynamically adjust to product variations or process failures [12]. However, the architecture of Industry 4.0 still requires further development to facilitate the efficient simulation of complex environments. This involves several critical steps, including real-time data acquisition, integration of these data into DT-based simulation models, optimization processes, and automated reprogramming of production systems [23]. A notable gap exists between the output of DT systems and the input requirements of production systems, which is conceptually linked to the goal of achieving self-reprogramming capabilities--one of the fundamental pillars of Industry 4.0 [2; 24].