Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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.0a4 – 2014-07-31

  • [NEW] The model meta data may now contain the any_inputs which, if set to True, allows any attribute to be connected to that model (useful for databases and alike).

  • [CHANGE] The dictionary of input values in the API’s step() call now also contains the source of a particular value. This is also usefull to for databases. This may break existing simulators.

  • [CHANGE] “.” is now used as separator in full entiy IDs instead of “/” (issue #19).

2.0a3 – 2014-06-26

  • [NEW] Hierarchical entities: Entities can now have a list of child entities (issue #14).

  • [NEW] The World class now has a get_data() method that allows you to get data from entities while creating a scenario.

  • [NEW] World.connect(a, b, ('X', 'X')) can now be simplified to World.connect(a, b, 'X').

  • [NEW] Attribute Entity.full_id which uniquely identifies an entity: '<sid>/<eid>'

  • [NEW] Attribute ModelFactory.meta which is the meta data dictionary of a simulator.

  • [NEW] World() now accepts a configuration dictionary which can, e.g., specify the network address for mosaik.

  • [NEW] Overview section for the docs

  • [NEW] Description of the mosaik API in the docs

  • [CHANGE] When you create entities, mosaik checks if the model parameters actually exists and raises an error if not (issue #9).

  • [CHANGE] The mosaik API’s init() function now receives the simulator ID as first argument (issue #15).

  • [CHANGE] The behavior of the get_related_entities() RPC that simulators can perform has been changed.

  • [CHANGE] Various internal improvements

  • [FIX] issue #18. Improved the error message if a Python simulator could not be imported.

  • [REMOVED] Attribute Entity.rel.

2.0a2 – 2014-05-05

  • [NEW] Preliminary documentation and installation instructions (https://mosaik.readthedocs.org)

  • [NEW] Simulators can now set data to other simulators using the asynchronous request set_data (issue #1).

  • [NEW] There is now a start timeout for external processes (issue #11).

  • [CHANGE] Mosaik now raises an error if a simulator uses the wrong API version (issue #4).

  • [CHANGE] Mosaik prints everything to stdout instead of using the Python logging module (issue #7).

  • [FIX] issue #2. Scheduling now works properly for processes using async. requests. New keyword argument async_requests for World.connect().

  • [FIX] issue #3. Local (in-process) Simulators can now also perform async. requests to mosaik (get_progress, get_related_entities, get_data, set_data).

  • [FIX] issue #8. Cleaned up the code a bit.

  • [FIX] issue #10. Tests for the sim manager improved.

2.0a1 – 2014-03-26

  • Mosaik 2 is a complete rewrite of mosaik 1 in order to improve its maintainability and flexibility. It is still an early alpha version and neither feature complete nor bug free.

  • 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.

    • Mosaik no longer includes a database.

    • Mosaik no longer includes a web UI.

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

    • mosaik 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.

      • 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.

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.0a4.tar.gz (2.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mosaik-2.0a4-py2.py3-none-any.whl (24.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file mosaik-2.0a4.tar.gz.

File metadata

  • Download URL: mosaik-2.0a4.tar.gz
  • Upload date:
  • Size: 2.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mosaik-2.0a4.tar.gz
Algorithm Hash digest
SHA256 122bd2cde508c45af6dd76d542fd5df2df17a31c275471b1282f7326185918d6
MD5 560d1b083c39f4dc59d38344ac52e879
BLAKE2b-256 fc30c2806bea163f717b77c5dab513a1307133694dbf295732a6217a3cadc39c

See more details on using hashes here.

File details

Details for the file mosaik-2.0a4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for mosaik-2.0a4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e9432ea54a6099451cab67900deb7df14dbd6ccf8547c2c1bd94c691975e0657
MD5 5addba2e7164ec49e71596596e404e3d
BLAKE2b-256 05aef2a4019ec7515cc8c2b8d949a17c5f3c376b080cb752055c77a508626c4f

See more details on using hashes here.

Supported by

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