Skip to main content

Mosaik is a flexible Smart-Grid co-simulation framework.

Project description

Mosaik

Mosaik is a simulation compositor for Smart Grid simulations.

It lets you re-use existing simulators and couple them to simulate large-scale Smart Grid scenarios. Mosaik offers powerful mechanisms to specify and compose these scenarios.

Example

A simple demo scenario with mosaik:

>>> import mosaik
>>>
>>> sim_config = {
...     'ExampleSim': {'python': 'example_sim.mosaik:ExampleSim'},
... }
>>>
>>> def create_scenario(world):
...     exsim1 = world.start('ExampleSim')
...     exsim2 = world.start('ExampleSim')
...
...     a = [exsim1.A(init_val=0) for i in range(3)]
...     b = exsim2.B.create(2, init_val=0)
...
...     for i, j in zip(a, b):
...         world.connect(i, j, ('val_out', 'val_in'))
>>>
>>> world = mosaik.World(sim_config)
>>> create_scenario(world)
>>> world.run(until=2)
Progress: 25.00%
Progress: 50.00%
Progress: 75.00%
Progress: 100.00%

Installation

Mosaik requires Python >= 3.3. Use pip to install it, preferably into a virtualenv:

$ pip install mosaik

Documentation, Source code and issues

The documentation is available at https://mosaik.readthedocs.org.

Please report bugs and ideas for improvment to our issue tracker.

Changelog

2.0 – 2014-09-22

  • Mosaik 2 is a complete rewrite of mosaik 1 in order to improve its maintainability and flexibility.

  • Removed features:

    • The mosl DSL (including Eclipse xtext and Java) are now gone. Mosaik now only uses Python.

    • Mosaik now longer has executables but is now used as a library.

    • The platform manager is gone.

    • The database is now a separate package, see mosaik-hdf5.

    • The old web UI is gone.

  • Mosaik now consists of four core components with the following feature sets:

    • mosaik Sim API

      • The API has bean cleaned up and simplified.

      • Simulators and control strategies share the same API.

      • There are only four calls from mosaik to a simulator: init, create, step and get_data.

      • Simulators / processes can make asynchronous requests to mosaik during a step: get_progress, get_related_entities, get_data, set_data.

      • ZeroMQ with JSON is replaced by plain network sockets with JSON.

    • Scenarios:

      • Pure Python is now used to describe scenarios. This offers you more flexibility to create complex scenarios.

      • Scenario creation simplified: Start a simulator to get a model factory. Use the factory to create model instances (entities). Connect entities. Run simulation.

      • Connection rules are are no based on a primitive connect function that only connects two entities with each other. On top of that, any connection strategy can be implemented.

    • Simulation Manager:

      • 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. This can be used as a replacement for the now gone platform manager.

    • Simulation execution:

      • The simulation is now event-based. No schedule and no synchronization points need to be computed.

      • Simulators can have different and varying step sizes.

  • Mosaik ecosystem:

You can find information about older versions on the history page

Authors

The original concepts for mosaik were developed by Steffen Schütten and Stefan Scherfke.

The author of mosaik version 2 is Stefan Scherfke.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mosaik-2.0.tar.gz (2.2 MB view hashes)

Uploaded Source

Built Distribution

mosaik-2.0-py2.py3-none-any.whl (23.2 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page