Skip to main content

Adversarial Resilience Learning --- Mosaik Environment

This projects contains the interface between palaestrAI and mosaik, the mosaik environment.

Introduction

This package allows to use worlds created with the co-simulation framework mosaik as environment in palaestrAI. The package was developed with MIDAS in mind but should work for arbitrary mosaik worlds. See documenation for more details on how to import a world.

Installation

palaestrAI-mosaik is written in Python. Use, preferable in a virtual environment:

pip install .

or, for development including Midas:

pip install -e .[dev,midas]

Alternatively, you can install it from pypi:

pip install palaestrai-mosaik

Usage

Under tests, you find the example_experiment_midas.yml that should be passed to the palaestrai command line interface::

palaestrai experiment-start /path/to/tests/example_experiment_midas.yml

Absorbing power-flow failure

Both the asynchronous and multiprocessing bridges automatically subscribe to entities exposing a powerflow_failed output. With the companion midas-powergrid change, no extra agent sensor configuration is needed. The monitoring channels do not change an agent's selected observation space.

On failure, the final environment state has:

done = True
terminated = True
truncated = False

The environment publishes a powerflow_failed reward with value 1.0, independently of its configured reward provider. The companion midas-palaestrai ARL objectives turn this into attacker reward 1.0 and defender reward 0.0. Healthy monitored transitions carry value 0.0. Failure cannot be reclassified as horizon truncation by a terminal-classification callback.

Physical grid stepping freezes immediately. The bridge detects the signal at its next synchronization point, retaining the original failure tick and date from powerflow_failure_time. It delivers the final transition without another agent action, drains in-flight final samples, joins scheduler tasks, and then finalizes recorders. A terminal initial reading is retained for the first update() rather than lost in the baseline handoff. Setup/constructor errors and unrelated simulator errors still propagate.

Normal horizon endings use terminated=False, truncated=True. Existing terminal_condition callbacks continue to classify endings only; a constant classification callback does not stop healthy intermediate transitions.

Failure is deliberately an absorbing operational outcome. Nonconvergence does not by itself prove a physical blackout. Full-horizon resilience evaluators must extend terminal FOM=0 through the original horizon rather than treat a shorter CSV as lower loss. Fixed setpoints are useful for diagnostics; final evaluation can and should retain state-responsive attackers.

Deploy the terminal-failure changes in midas-powergrid, palaestrai-mosaik and midas-palaestrai together. The real-grid/CSV regression tests in tests/unit/test_powerflow_end_to_end.py run when the companion grid API is installed; protocol and lifecycle tests also run without that optional update.

Metadata

Release files for palaestrai-mosaik 3.5.10

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

Source distribution (sdist)

Source distribution for palaestrai-mosaik 3.5.10
File Size Uploaded Provenance Actions
palaestrai_mosaik-3.5.10.tar.gz 56.2 kB Without provenance Details for palaestrai_mosaik-3.5.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for palaestrai-mosaik 3.5.10
File Interpreter ABI Platform Actions
palaestrai_mosaik-3.5.10-py3-none-any.whl Python 3 none any Details for palaestrai_mosaik-3.5.10-py3-none-any.whl

Total release size: 97.5 kB

Release files / palaestrai_mosaik-3.5.10.tar.gz

Download URL palaestrai_mosaik-3.5.10.tar.gz
Size 56.2 kB
Tags Source
SHA-256 checksum
How to use checksums
25c76662704d8ee113a7df3f9690a457f43c5c2684c9b2ef2d3f7b415275209d
BLAKE2b-256 checksum
How to use checksums
de332955e5eaab3f1cd4a9d7d0c19dc598791b898ccec8b84d043ef2278c4523
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.9

Release files / palaestrai_mosaik-3.5.10-py3-none-any.whl

Download URL palaestrai_mosaik-3.5.10-py3-none-any.whl
Size 41.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
017072e5e54ebe32cbb341f5e29a032e2b36ed68c2afb86ba7aa4ddfce3efc07
BLAKE2b-256 checksum
How to use checksums
ab075d67a49112e8b837880465f4e76429c6ea8e0f2bc17e457c30529958430e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.9

Security for palaestrai-mosaik 3.5.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

3.5.10 This release

2 release files No provenance

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