Due a digital twin is a dynamic virtual representation of a physical object or system, we can define a supply chain digital twin as a detailed simulation model of an actual supply chain which predicts the behavior and dynamics of a supply chain to make mid-term/short-term decisions . Today, the development and implementation of digital twins in the supply chain is not done in a standard way. There is no single technological platform capable of performing all the activities of a digital twin. However, some computer tools have begun to strengthen the functionality of their services offered, see SAP  and anylogistix . For other applications you can see Veracity by DNV GL. It is built in Microsoft Azure, which ensures reliable data management in the cloud. . Other developments are, MindSphere by Siemens  who is able to connect all your equipment and systems, extract their data and convert them into valuable information for the company. One of the most robust digital twin developments is Open Simulation Platform (OSP) .Created by a joint effort between Det Norske Veritas Germanischer Lloyd Group (DNV GL), Norwegian University of Science and Technology (NTNU), Rolls-Royce and SINTEF Ocean.
However, although there is no single design and development scheme for digital twins in the supply chain, in this work, we rely on the six-layer architecture for digital twins proposed by . This architecture considers the neutral vision and the specific needs of the stakeholders. Each of the layers of the proposed digital twin is detailed below.
The physical twin
The use of inventory measurement devices under RFID environments consisting of labels that can be attached to any product. RFID technology is mainly based on the interaction of 2 fundamental elements: the TAG and a reader. The tag contains an antenna that allows the device to connect to the system and a microchip that accumulates information. When the RFID tag receives energy obtained by the reading antennas, the chip uses this energy as a power source and activates all its internal circuits.
The local data source
The data collected is uploaded by professionals through spreadsheets or other databases. Every day the costs of new computing technologies are lower, which facilitates investment in devices that provide the necessary data to start the process. The use of an internal database is recommended, which joins the information of the cyber-devices. This reduces dependency and simplifies support.
Local data repositories
The use of local databases (simple spreadsheets hosted in each area or department involved in the digital twin). There are mainly two types of storage, local storage and cloud storage. The first has the disadvantage of not being able to have our data available anywhere, only in the network, as well as security and physical damage issues, although it has an average cost. By contrast cloud storage offers us the possibility of having devices synchronized anywhere, high configurability and greater security in data exchange. It has a relatively high cost since we must have a backup, it requires a high-speed connection (preferably fiber optics) and maintenance of all hardware. The disadvantage is that it requires us to be aware that the service is working correctly since several factors may fail that may make it impossible for us to work.
The IoT gateway interfaces
The IoT gateway is a crucial technology that enables electronic devices to communicate and share data, data that can be analyzed and transformed into valuable information that enables the optimization of operating processes for the industries involved. Provide data to business systems (ERP or Digital Twins) for a more detailed analysis. Given the nature of the digital twin design, in our case, the anylogistix (ALX) platform does not need the development of an IoT interface to make the data obtained in simple spreadsheets compatible.
The Cloud-based information repositories
The AnyLogic Private Cloud  is a secure platform for hosting simulation models in your data center or at a cloud platform provider. It is natively supported by ALX.
The emulation and simulation platform
A powerful and flexible simulation tool is the key to developing a digital twin in the supply chain. It is recommended to use modeling tools that are multi-method in nature. This will allow the use of a smaller number of software in the design of the digital twin. Selecting a multi-method simulation software is the best way to achieve an efficient and more robust digital twin. The optimization and simulation capabilities of ALX enable you to create plans with network optimization and use simulation modeling to test and develop them. Optimization and simulation combine to extend your supply chain analytics (Figs. 1, 2, 3 and 4).
As previously described, the study conduce the development and implementation of a digital twin of the supply chain through anylogistix software, which allows us to connect and exchange input and output information with other data interfaces. The main idea is to use the optimization and dynamic simulation core provided by the software. Some background design of digital twins in ALX is reported in  and . A recent example for the analysis of risk in supply chains based on ALX technology can be consulted in , the case study is based on the current epidemic COVID-19. The author is a leading researcher in the development of supply chain risk measurements and digital twin design using ALX software.
The proposed digital twin of this research is an operational digital twin, as it exchanges data between production, storage and distribution. Additionally, this twin monitors the overall performance of the system. Through this, production scheduling and resource allocations are made and it is possible to implement decision-making algorithms. For reference see the Figs. 5, 6 and 7. The main goal is that the user can interact with the digital twin to obtain information or adjust operating parameters.The digital twin’s decisions have a medium and short-term planning horizon.
We have built into our solution machine learning and pattern recognition algorithms that can help to identify the changing trends in the supply chain, in demand and in operations. See Fig. 8.
We know that if a company can look into the future and predict supply chain key performance indicators (KPI’s) it will understand what needs to be done in order to meet financial goals. Figures 9 and 10.
The simulation-optimization process generates the necessary information to make up the system’s KPIs. KPIs allow decision makers to quickly identify problems that arise in the supply chain, so that new plans can be created to resolve contingencies and get back on track in operation. It is known that if better planning is combined with better visibility and predictive analytics, the impact on supply chain performance will be beneficial. This can be accomplished with the use of the proposed digital twin. The digital twin can be implemented simultaneously with existing supply chain operations or phased in over several stages. Typically, digital twins can be introduced and developed step-by-step, facilitating implementation and maximizing their benefits.
The way in which the digital twin of the supply chain is designed allows considering different types of information between the links of the supply chain, as well as integrating it. This allows for a clearer and more faithful integration between all the parties involved. The digital twin proposal developed for a pharmaceutical supply chain is described below.