# Multi-Agent Simulation Approach for Modular Integrated Construction Supply Chain
## 3 Proposed Agent-Based Model
### Model Implementation Using AnyLogic
#### 3.4.2 Model Implementation  
The implementation of the multi-agent model using the AnyLogic 8.7.9 Personal Learning Edition involves several key steps to ensure that the simulation accurately reflects the MiC supply chain process and provides valuable insights for optimization. This section details the properties, behaviors, and parameters of each agent involved. Table 2 synthesizes these elements for each agent. \begin{table}
\begin{tabular}{p{113.8 pt} p{113.8 pt} p{113.8 pt}} \hline \hline
**Agent** & **Properties and Parameters** & **Behaviors and Functions** \\ \hline Construction Site & Demand generation event based on BIM and project planning. & Function: GenerateDemand() for integrated modules. \\  & Parameter: MiC factory associated with the demand. & \\ \hline MiC Factory & Event to generate demand for prefabricated components from suppliers. & Process: Fabrication of integrated modules (see Figure 5(a)). \\  & Parameter: Supplier associated with the demand, number of vehicles assigned to transport the module. & \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Properties, behaviors, and parameters of each agent. Process Description for MiC Factory Agent:  
The diagram in Figure 6a illustrates the process flow related to the MiC Factory agent. Each block in the diagram represents a specific step for managing orders and transporting integrated construction modules. The process begins with the \"Process Order\", which involves receiving orders for modules. The orders are placed in a queue, indicating that multiple orders can be managed simultaneously. The purpose of this step is to organize and prioritize incoming orders for module production and delivery. Next, the system moves to the \"Wait for Module\" step. After an order is processed, the system waits for the corresponding module to be ready. This includes the time required for fabricating the integrated modules in the MiC factory. The purpose of this step is to ensure that the module is fully assembled and ready for delivery. Once the module is ready, the process advances to the \"Take Vehicle\" bloc. In this step, a vehicle from the fleet is assigned to transport the module. This involves allocating an appropriate transport vehicle based on availability and suitability for the delivery task. Following this, the process moves to the \"Delivering\" step, which represents the actual transportation of the module from the MiC factory to the construction site. The module is loaded onto the vehicle and transported to its destination. After the module is delivered, the process proceeds to the \"Release Vehicle\" bloc. At this stage, the vehicle is released and made available for future transportation tasks. This step marks the completion of the delivery process. The final step in the process is the \"Sink\". This represents the stage where the order is considered complete. The purpose of this step is to close the current order loop, ensuring that the logistics process can start anew with the next set of orders. The MiC factory agent supervises the entire lifecycle of an order, from receiving the order to ensuring its delivery to the construction site. Process Description for Supplier Agent:  
The diagram in Figure 6b illustrates the process flow related to the supplier agent. The process begins with the \"Process Order\" step. This involves receiving and processing orders for prefabricated components. The orders are placed in a queue, indicating that multiple orders can be managed simultaneously. The purpose of this step is to organize and prioritize incoming orders for component production and delivery. Next, the system moves to the \"Wait for Components\" step. After an order is processed, the system waits for the corresponding components to be produced. This includes the time required for manufacturing the prefabricated components. The purpose of this step is to ensure that the components are fully produced and ready before proceeding to the next step. Once the components are ready, the process advances to the \"Take Vehicle\" step.