Skip to main content

Mosaik API for Python

This is an implementation of the mosaik API for simulators written in Python. It hides all the messaging and networking related stuff and provides a simple base class that you can implement.

Installation

Just use pip to install it:

$ pip install mosaik-api

Documentation

Please refer to mosaik’s documentation of the API.

Example Simulator

This distribution contains an example simulator in the example_sim package.

It can be started via the pyexamplesim command; pyexamplesim --help shows you how to use it.

It can also be run in-process by importing and calling example_sim.mosaik.main().

Example MAS

This distribution contains an example “multi-agent system” that uses the asyncronous remote calls to mosaik (get_progress(), get_related_entities(), get_data(), set_data()).

It can be started via the pyexamplemas command; pyexamplemas --help shows you how to use it.

It can also be run in-process by importing and calling example_mas.mosaik.main().

Development setup

To setup a devleopment environment, create a virtualenv and install the packages from requirements.txt:

$ mkvirtualenv --python=/usr/bin/python3 mosaik-api-python
(mosaik-api-python)$ pip install -r requirements.txt

To run the tests for the Python version you are currently using, execute py.test. You should also add the test coverage check:

(mosaik-api-python)$ py.test --cov=example_mas --cov=example_sim --cov=mosaik_api

To run the tests for all supported Python versions, run tox:

(mosaik-api-python)$ tox

Mosaik’s documentation contains more details.

Changelog

2.2.1 – 2019-01-24

  • [BugFix] Bugfix Tests

2.2 – 2016-02-15

  • [NEW] API version 2.2: Added an optional “setup_done()” method.

  • [CHANGE] API version validation: The API version is no longer an integer but a “major.minor” string. The major part has to math with mosaiks major version. The minor part may be lower or equal to mosaik’s minor version.

  • [FIX] Various minor fixes and stability improvements.

2.1 – 2014-10-24

2.0 – 2014-09-22

  • Initial release of the mosaik 2 Sim API for Python.

Authors

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

The author of the mosaik API version 2 is Stefan Scherfke.

Metadata

Release files for mosaik-api 2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mosaik-api 2.3
File Size Uploaded
mosaik-api-2.3.tar.gz 18.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mosaik-api 2.3
File Interpreter ABI Platform
mosaik_api-2.3-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 31.7 kB

Release files / mosaik-api-2.3.tar.gz

Download URL mosaik-api-2.3.tar.gz
Size 18.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9a71aa8542b5d7e20820afc18b045bc41858bacbd697657097706dd70fdc53cb
BLAKE2b-256 checksum
How to use checksums
53acb88f974e5be895a46c43bd0ace089e11ac96b63e2749c105eacae95ffc64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.9.1

Release files / mosaik_api-2.3-py2.py3-none-any.whl

Download URL mosaik_api-2.3-py2.py3-none-any.whl
Size 13.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
58e6f199861d208046c163d5aaa6380674d75570c55b233f6f04b865e3e50e4b
BLAKE2b-256 checksum
How to use checksums
d0d43dab7d391402c6adc51c17d4e3ea175ab37b36807968f809e76074bb7851
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.9.1
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page