## 3 Modelling and Implementation of the Simulation Prototype
### Proposed Simulation Meta-Model  
Once the functional and logical structure of MAS and the requirements for the simulation model (Steps 1 and 2) have been defined, the next step is to establish the meta-model for the simulation system of an assembly line. This meta-model must define the static structure of the blocks and the behavior of those blocks, which will serve as constructive elements for the creation of the corresponding executable simulation model for a specific assembly line. To support the production quality paradigm, the simulation meta-model is structured in two model library packages that include the reusable blocks to compose the simulation models. Specifically, these libraries are: (a) a basic one for the logistics flow simulation, which supports the  
Figure 2: Block definition diagram for the generic MAS structure. data corresponding to order processing, monitoring, control times, etc., and (b) a specialization of the previous one that adds the simulation of the geometric variability propagation according to the SoV technique. This geometric variation flow simulation supports the data corresponding to the differential motion vector of the parts of the assembly and their propagation. The model structuring using these libraries enables the subsequent development of other libraries to simulate the variability propagation according to other techniques, for example, based on data models, or to simulate the system with other planning and production control logics, for example, Kanban. In the rest of the section, in order to not extend too much, only some of the diagrams corresponding to the construction of the second library are presented. The BDD in Figure 3 shows the static structure of the simulation system, our system of interest. The Simulation_AssemblyProcess block is composed of a number of AssemblyWorkstationProcess blocks, corresponding to the assembly processes executed at the workstations; a number of InspectionWorkstationProcess blocks, corresponding to the inspection processes executed at the inspection stations; an OrderArrivalProcess block, corresponding to the assembly order arrival process; an OrderSinkProcess block, corresponding to the removal of the completed assembly orders. Additionally, the Simulation_AssemblyProcess block is composed of a Simulation_Control block that, in addition to monitoring performance measures, such as throughput and defect index, is responsible for reducing the variability of key quality characteristics by using different optimization logic and algorithms to calculate corrections in the position of locators. Figure 4 shows the internal block diagram of the composed block AssemblyWorkstationProcess. As can be seen, each AssemblyWorkstationProcess block consists of two block instances corresponding to the queuing process of the subassemblies (SubassemblyStoreProcess) and the parts (PartStoreProcess); a block instance corresponding to the arrival process of the parts that are incorporated into the processed assembly (PartArrivalProcess); a block instance corresponding to the assembly process (AssemblyMachineProcess). The diagram also shows the three types of connections between the blocks: a) assembly_item, which contains the data corresponding to the assembly flow in the line and its quality characteristics, b) part_item, which contains the data corresponding to the flow of the incoming parts and their quality characteristics, and c) control_data, which contains the data for stations monitoring and for corrections to be applied in the position of locators. Figure 3: Block definition diagram of the simulation system. An important aspect in the definition of the blocks that compose the structure of the simulation system model is their behavior. In this case, the behavior of the system blocks is of a discrete nature and it is modelled using the discrete event systems specification (DEVS) formalism [27].