mosaik — Features

Features

The following sections provide an overview of the features mosaik currently provides. You can also take a look at mosaik’s history to follow its evolution.

Simple and intuitive API for simulators and control strategies:

  • Only four types of calls from mosaik to a simulator:

    • init – Initialize the simulator.
    • create – Create model instances.
    • step – Perform a simulation step based on some input data for a time interval.
    • get_data – Get data from the simulator.
  • Control strategies can make asynchronous requests to mosaik during a step:

    • get_progress – Get the current simulation progress in percent.
    • get_related_entities – Get a list of entities related to another entity (to allow traversing the simulated topology).
    • get_data – Retrieve data from another simulator.
    • set_data – Set input data for another simulator.
  • Based on plain network sockets with JSON encoded messages.

  • High-level API implementations that implement the network event loop and provide a simple base class that you can inherit from. Implementations are currently available for:

    Implementations for other languages will be added on demand.

Simple but flexible scenario creation:

  • Scenario description in pure Python leveraging its simple syntax and great flexibility to support from a few up to tens of thousands entities.
  • You just start a simulator and get a model factory. You use that factory to create model instances (entities). You connect the entities with others. You run simulation. Done.
  • Connection entities is based on a single primitive called connect. It only connects two entities with each other but can be used as a building block to implement any connection strategy for sets of entities that you can imagine.

Management of external simulator processes:

  • Simulators written in Python 3 can be executed in process.
  • Simulators can be started as external processes.
  • Mosaik can connect to an already running instance of a simulator.

Event-based simulation execution:

  • Based on the established SimPy simulation library.
  • Simulators can have different and varying step sizes. They only need to agree on a common time resolution, which can be defined in the scenario.
  • Simulators’ steps can be triggered based on available output of other simulators.
  • Output data can be specified as persistent or non-persistent (i.e., transient).
  • Simulators can request steps asynchronously to react to external events.
  • When there’re no interactions, simulators can compute the state transformation of several fundamental time steps at once (max_advance).

Powerful ecosystem:

All components of the mosaik ecosystem can be found at Gitlab. In the following an overview is given, which might be not complete, because new repositories are added regularly.

  • The root folder contains the mosaik core and the high-level API implementations.
  • mosaik-examples contains some example scenarios.
    • The mosaik-demo contains a simple demo scenario for mosaik.
    • The DES demo is a simple example scenario showing the new mosaik 3.0 DES features
    • cosima is an example scenario with integrated communication simulation based on OMNeT++.
  • mosaik-components contains some components, which can be used as base for a co-simulation scenario.
  • mosaik-tools contains some additional tools.

There are also some implementations done by external users of mosaik. We give an overview here but can not guarantee or support the flawless integration of these tools with mosaik. If you also have implemented additional tools for mosaik, simulation models or adapters, feel free to contact us to be listed here.

  • pysimmods contains some simulation models, which can be used in mosaik scenarios.
  • MIDAS contains a semi-automatic scenario configuration tool.
  • mosaik-docker is a package for the deployment of mosaik with Docker.
  • ZDIN-ZLE contains the research and development of digitalized energy systems in ZLE using mosaik (collection of simulation models and scenarios).