Skip to main content

Python PyPI tests pre-commit Code style: black

MO-Gymnasium is an open source Python library for developing and comparing multi-objective reinforcement learning algorithms by providing a standard API to communicate between learning algorithms and environments, as well as a standard set of environments compliant with that API. Essentially, the environments follow the standard Gymnasium API, but return vectorized rewards as numpy arrays.

The documentation website is at mo-gymnasium.farama.org, and we have a public discord server (which we also use to coordinate development work) that you can join here: https://discord.gg/bnJ6kubTg6.

Environments

MO-Gymnasium includes environments taken from the MORL literature, as well as multi-objective version of classical environments, such as MuJoco. The full list of environments is available here.

Installation

To install MO-Gymnasium, use:

pip install mo-gymnasium

This does not include dependencies for all families of environments (some can be problematic to install on certain systems). You can install these dependencies for one family like pip install "mo-gymnasium[mujoco]" or use pip install "mo-gymnasium[all]" to install all dependencies.

API

As for Gymnasium, the MO-Gymnasium API models environments as simple Python env classes. Creating environment instances and interacting with them is very simple - here's an example using the "minecart-v0" environment:

import gymnasium as gym
import mo_gymnasium as mo_gym
import numpy as np

# It follows the original Gymnasium API ...
env = mo_gym.make('minecart-v0')

obs, info = env.reset()
# but vector_reward is a numpy array!
next_obs, vector_reward, terminated, truncated, info = env.step(your_agent.act(obs))

# Optionally, you can scalarize the reward function with the LinearReward wrapper
env = mo_gym.wrappers.LinearReward(env, weight=np.array([0.8, 0.2, 0.2]))

For details on multi-objective MDP's (MOMDP's) and other MORL definitions, see A practical guide to multi-objective reinforcement learning and planning.

You can also check more examples in this colab notebook! MO-Gym Demo in Colab

MORL-Baselines is a repository containing various implementations of MORL algorithms by the same authors as MO-Gymnasium. It relies on the MO-Gymnasium API and shows various examples of the usage of wrappers and environments.

Environment Versioning

MO-Gymnasium keeps strict versioning for reproducibility reasons. All environments end in a suffix like "-v0". When changes are made to environments that might impact learning results, the number is increased by one to prevent potential confusion.

Project Maintainers

Project Manager: Lucas Alegre

Maintenance for this project is also contributed by the broader Farama team: farama.org/team.

Citing

If you use this repository in your research, please cite:

@inproceedings{felten_toolkit_2023,
	author = {Felten, Florian and Alegre, Lucas N. and Now{\'e}, Ann and Bazzan, Ana L. C. and Talbi, El Ghazali and Danoy, Gr{\'e}goire and Silva, Bruno C. {\relax da}},
	title = {A Toolkit for Reliable Benchmarking and Research in Multi-Objective Reinforcement Learning},
	booktitle = {Proceedings of the 37th Conference on Neural Information Processing Systems ({NeurIPS} 2023)},
	year = {2023}
}

Metadata

Release files for mo-gymnasium 1.3.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 mo-gymnasium 1.3.3
File Size Uploaded Provenance Actions
mo_gymnasium-1.3.3.tar.gz 433.2 kB Without provenance Details for mo_gymnasium-1.3.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mo-gymnasium 1.3.3
File Interpreter ABI Platform Actions
mo_gymnasium-1.3.3-py3-none-any.whl Python 3 none any Details for mo_gymnasium-1.3.3-py3-none-any.whl

Total release size: 876.1 kB

Release files / mo_gymnasium-1.3.3.tar.gz

Download URL mo_gymnasium-1.3.3.tar.gz
Size 433.2 kB
Tags Source
SHA-256 checksum
How to use checksums
dbb4359a97d91eda59f9d3afee1fd56ff98a499da70f7d8a70f491313059972f
BLAKE2b-256 checksum
How to use checksums
a4e4d10bc288e1eb33d4c59581839a3af5e604909512683248af5c588f35801a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / mo_gymnasium-1.3.3-py3-none-any.whl

Download URL mo_gymnasium-1.3.3-py3-none-any.whl
Size 442.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
12f771157cb3e336d38b12bdebad068949855a5d205a898d05de27c7f1d5fa50
BLAKE2b-256 checksum
How to use checksums
88d66ddef6ecaa9ef1a152ccc022bd2381111dfad78be4e7e895903da0be017f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for mo-gymnasium 1.3.3

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.

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