mo-gymnasium

Multi-objective Gymnasium environments for reinforcement learning

https://github.com/farama-foundation/mo-gymnasium

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in README
  • Academic publication links
    Links to: springer.com
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.8%) to scientific vocabulary

Keywords

gym gym-environments gymnasium morl multi-objective multi-objective-rl reinforcement-learning

Keywords from Contributors

gym-environment autonomous-driving
Last synced: 6 months ago · JSON representation ·

Repository

Multi-objective Gymnasium environments for reinforcement learning

Basic Info
Statistics
  • Stars: 340
  • Watchers: 7
  • Forks: 51
  • Open Issues: 6
  • Releases: 15
Topics
gym gym-environments gymnasium morl multi-objective multi-objective-rl reinforcement-learning
Created almost 4 years ago · Last pushed 8 months ago
Metadata Files
Readme Funding License Code of conduct Citation

README.md

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: bash 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:

```python import gymnasium as gym import mogymnasium as mogym 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!

nextobs, vectorreward, 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

Notable related libraries

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.

Development Roadmap

We have a roadmap for future development available here: https://github.com/Farama-Foundation/MO-Gymnasium/issues/66.

Project Maintainers

Project Managers: Lucas Alegre and Florian Felten.

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:

bibtex @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} }

Owner

  • Name: Farama Foundation
  • Login: Farama-Foundation
  • Kind: organization
  • Email: contact@farama.org

The Farama foundation is a nonprofit organization working to develop and maintain open source reinforcement learning tools.

Citation (CITATION.bib)

@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}
}

GitHub Events

Total
  • Create event: 7
  • Issues event: 3
  • Release event: 2
  • Watch event: 44
  • Delete event: 3
  • Issue comment event: 13
  • Push event: 55
  • Pull request review comment event: 11
  • Pull request review event: 15
  • Pull request event: 19
  • Fork event: 11
Last Year
  • Create event: 7
  • Issues event: 3
  • Release event: 2
  • Watch event: 44
  • Delete event: 3
  • Issue comment event: 13
  • Push event: 55
  • Pull request review comment event: 11
  • Pull request review event: 15
  • Pull request event: 19
  • Fork event: 11

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 234
  • Total Committers: 9
  • Avg Commits per committer: 26.0
  • Development Distribution Score (DDS): 0.402
Past Year
  • Commits: 127
  • Committers: 6
  • Avg Commits per committer: 21.167
  • Development Distribution Score (DDS): 0.496
Top Committers
Name Email Commits
Lucas Alegre l****e@g****m 140
Florian Felten f****n@u****u 49
Florian Felten 19
Florian Felten f****n@h****r 13
Manuel Goulão m****o@g****m 8
Florian Felten 1****n 2
Mark Towers m****s@g****m 1
ianleongudri 8****i 1
rk1a 9****a 1
Committer Domains (Top 20 + Academic)
uni.lu: 1

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 1,917 last-month
  • Total dependent packages: 1
  • Total dependent repositories: 1
  • Total versions: 11
  • Total maintainers: 3
pypi.org: mo-gymnasium

A standard API for MORL and a diverse set of reference environments.

  • Versions: 11
  • Dependent Packages: 1
  • Dependent Repositories: 1
  • Downloads: 1,917 Last month
Rankings
Downloads: 3.8%
Stargazers count: 5.1%
Forks count: 8.2%
Average: 9.8%
Dependent packages count: 10.1%
Dependent repos count: 21.5%
Maintainers (3)
Last synced: 6 months ago

Dependencies

setup.py pypi
  • gym *
  • numpy *
  • pygame *
  • pymoo *
  • scipy *
.github/workflows/build-docs-dev.yml actions
  • JamesIves/github-pages-deploy-action v4 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/build-docs-version.yml actions
  • JamesIves/github-pages-deploy-action v4 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • dawidd6/action-get-tag v1 composite
.github/workflows/build-publish.yml actions
  • actions/checkout v3 composite
  • actions/download-artifact v2 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v2 composite
  • pypa/gh-action-pypi-publish release/v1 composite
.github/workflows/manual-build-docs-version.yml actions
  • JamesIves/github-pages-deploy-action v4 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/pre-commit.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/test.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
docs/requirements.txt pypi
  • cython *
  • furo *
  • gymnasium *
  • mo_gymnasium *
  • myst-parser *
  • sphinx *
  • sphinx_github_changelog *
  • tqdm *
pyproject.toml pypi
  • gymnasium >=0.27
  • numpy >=1.21.0
  • pygame >=2.1.0
  • pymoo >=0.6.0
  • scipy >=1.7.3