Skip to main content

Python implementation of the mosaik API.

Project description

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.

Status

PyPI - Version PyPI - Wheel Coverage Report pipeline status PyPI - License PyPI - Status Libraries.io SourceRank

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.4.1 - 2019-05-15

  • [NEW] Introduce semantic versioning.

2.4 - 2019-02-05

  • [NEW] Simulator can now be started on a different node than mosaik, using the remote flag “-r” and the timeout flag “-t”. Mosaik can the integrate the simulator using the “connect” method of the simmanager.

2.3 – 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.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

mosaik.API_semver-2.4.2rc20200203224904-py2.py3-none-any.whl (21.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file mosaik.API_semver-2.4.2rc20200203224904-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for mosaik.API_semver-2.4.2rc20200203224904-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 896a39346b278d96742aa3ca8c65bcadfa4948f76629c666ef53a772147ccaa8
MD5 54c043b372a21d96e2daa31ebd1e7614
BLAKE2b-256 2f89ebd323413f841dc2a1bb0eec062b210011f551fc1c929ecd5894588c1606

See more details on using hashes here.

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