## 2 Materials and Methods
### Mosaik System Architecture  
The mosaik co-simulation environment can be divided into three parts: the core framework, the set of adapters, and additional utility software. The core provides the basic co-simulation functionality via a set of interconnected modules, the central two being the sim-manager and the scheduler modules. The sim-manager is responsible for setting up and maintaining the connections between mosaik and the simulators. The scheduler, on the other hand, coordinates the data exchange between the simulators during runtime (see Section 2.2). A simulator is always an independently executable piece of software that implements a simulation model. For user interaction with mosaik, two API are provided. The component-API has to be used to establish an interface between mosaik and a new simulator. It specifies the socket connection used for data exchange and outlines what kind of data the simulator has to accept and provide. The scenario-API, on the other hand, allows users to set up executable co-simulation scenarios by specifying which simulators are to be used and how they should be parameterized and interconnected with each other. During execution, a scenario script employs the functionalities of the sim-manager and the scheduler. An overview of the mosaik core architecture is provided in Figure 1.  
While the mosaik software itself contains no simulation models, there is a constantly growing set of simulators that are interfaced with the framework. This is called the mosaik ecosystem. An important part of this ecosystem are open-source simulation tools that can be downloaded with the basic mosaik setup, e.g., the PyPower tool (based on the MatPower software [19]). The MAS tool, ISAAC, is to be mentioned here (see Section 2.5). However, a number of commercial tools are also already supported by mosaik, like PowerFactory or Opal-RT eMEGAsim [20; 21]. Even more so, the component-API specification has been implemented in different programming languages (e.g., Python, Java, MATLAB) to facilitate the integration of a wide variety of different simulators. An FMI adapter is also given so that mosaik can serve as a master for all simulators that support the standard.  
To improve the usability and performance of mosaik, additional software modules and processes are being developed to extend the capabilities of the system beyond data exchange scheduling between simulators. The mosaik system architecture follows a modular approach in regard of these utility tools. They build up on the co-simulation core but function as independent software. This way, users of the co-simulation framework have the freedom to install only those additional modules which they actually like to employ. The utility environment is comprised of a GUI for demonstration and education purposes ([[https://maverig.readthedocs.io/quickstart.html](https://maverig.readthedocs.io/quickstart.html)]([https://maverig.readthedocs.io/quickstart.html](https://maverig.readthedocs.io/quickstart.html))), processes for simulation planning (Section 2.3), an uncertainty quantification system (Section 2.4), and is currently being extended by modules for performance improvement via the application of surrogate modeling (Section 4.3).  
Figure 1: Architecture overview of the full mosaik environment.