# A Methodology for the Design of Application-Specific Cyber-Physical Social Sensing Co-Simulators
## 2 State of the Art
### Selection of the Co-Simulation Paradigm
Each part could be modified in different levels, but there is always a separation among the different functional parts (which maintain all their traditional characteristics). Federated co-simulation is the most profitable paradigm in the first stages for building a new simulation tool. Now, as we said, in federated co-simulation the different parts which make up the global simulator could be modified in different level. Depending on the number of required modifications different federated co-simulation paradigm may be identified. Figure 4: Different simulation paradigms (**a**) Independent simulation (**b**) Co-simulation. The paradigm which needs the highest level of development is the _choreographed federated co-simulation_. In this scheme, all the different domain-specific simulators have been modified to understand the global description of the simulation scenario, to select the important data for them, to configure the simulation and to share the resulting data with the other domain-specific simulator (see Figure 5a). Thus, programming is required in order to modify the simulation tools. Finally, one of the simulators is in charge of building the final simulation results. This federated paradigm is the closest to the integrated simulations. In contrast to choreographed co-simulation, _orchestrated federated co-simulation_ does not require to modify all the domain-specific tools (or the modifications are negligible), and, then, programming knowledge to modify the simulators themselves is not required in the development team. In this paradigm, an entity is in charge of receiving the global description of the scenario, processing it, and configuring the simulation in the different tools. Finally, this entity must also generate the final results using the data from the different simulators. In _orchestrated by one of the simulators federated co-simulation_ the described entity is one on the domain-specific simulator which has been adequately modified (see Figure 5b). In _orchestrated by a third-party engine federated co-simulation_ no modification in the domain-specific tools is required, as the described entity is a third-party program which uses the available interfaces in the simulator to interact with them (see Figure 5c). Various proposals and commercial simulators applying different paradigms may be found. For example, in [114] it is described an orchestrated by a third-party engine federated co-simulator for CPS (based on the union of the NS3 simulator and the MASON simulator). In [115] an orchestrated by one of the simulators federated co-simulator is presented. The proposal is based on the coordination of MATLAB/Simulink (a tool which, besides, performs the coordination tasks) and the NS3 simulator. This paradigm is greatly extended (especially when MATLAB/Simulink suite is involved), for example to perform simulations about reflector antennas with the commercial software GRASP [116]. On the other hand, in [117] a Smart grid simulator based on choreographed co-simulation between the NS2 simulator and the PSLF (Positive Sequence Load Flow, software for power systems) Simulator is described; and in [118] an integrated simulator (also for Smart grids) is presented. Selecting the appropriate co-simulation paradigm for a new simulation tools is a complicated task which depends, basically, on two factors: the technological capacity of the future developers and the future users' abilities and (mainly) the characteristics of the selected tools to make up the co-simulator. Table 6 presents and discusses the most important criteria which must be considered in the selection of a co-simulation paradigm. Figure 5: Different simulation paradigms (**a**) Choreographed (**b**) Orchestrated by one of the simulators (**c**) Orchestrated by a third-party engine.