A fast Multi-Agent Reinforcement Learning Environment
Project description
Laser Learning Environment (LLE)
LLE is a fast Multi-Agent Reinforcement Learning environment written in Rust which has proven to be a difficult exploration benchmark so far. The agents start in the start tiles, must collect the gems and finish the game by reaching the exit tiles. There are five actions: North, South, East, West and Stay.
When an agent enters a laser of its own colour, it blocks it. Otherwise, it dies and the game ends.
Installation
To use the environment
pip install laser-learning-environment # Stable release
pip install git+https://github.com/yamoling/lle # latest push on master
Citing our work
The paper has been presented at EWRL 2023. https://openreview.net/pdf?id=IPfdjr4rIs
@inproceedings{molinghen2023lle,
title={Laser Learning Environment: A new environment for coordination-critical multi-agent tasks},
author={Molinghen, Yannick and Avalos, Raphaël and Van Achter, Mark and Nowé, Ann and Lenaerts, Tom},
year={2023},
series={European Workshop on Reinforcement Learning},
booktitle={EWRL 2023}
}
Development
If you want to modify the environment, you can clone the repo, install the python dependencies then compile it with maturin
.
git clone https://github.com/yamoling/lle
poetry shell # start the virtual environment
poetry install
maturin develop # install lle locally
Usage
Low level control
The World
class is the low-level object that you can work with.
from lle import World, Action
world = World("S0 G X") # Linear world with start S0, gem G and exit X
world.reset()
available_actions = world.available_actions[0] # Action.STAY, Action.EAST
reward = world.step([Action.EAST])
reward = world.step([Action.EAST])
assert world.done
You can also access and force the state of the world
state = world.get_state()
...
world.set_state(state)
You can query the world on the tiles with world.start_pos
, world.exit_pos
, world.gem_pos
, ...
High-Level control
You can also use LLE as an RLEnv
with the lle.LLE
class. This class is a wrapper around the World
class that implements the RLEnv
interface.
from lle import LLE
env = LLE.from_str("S0 G X")
obs = env.reset()
obs, reward, done, info = env.step([0]) # Actions are now integers
Building
This project has been set up using Poetry. To build the project, run the following commands:
poetry shell
poetry install
maturin develop # For development
maturin build # For distribution
Tests
This project does not respect Rust unit tests convention and takes inspiration from this structure. Unit tests are in the src/unit_tests
folder and are explicitely linked to in each file with the #path
directive.
Integration tests are written on the python side.
Run unit tests with
cargo test
Run integration tests with
maturin develop
pytest
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 Distribution
Built Distribution
Hashes for laser_learning_environment-0.1.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9af3cee7677f4d08f55bdfd93a2cdbb643ef09f166e59f4459cddb60c5df54ff |
|
MD5 | 458a1e336db3ecd6a3616b7ca820fb9f |
|
BLAKE2b-256 | 2690473449f2b0d491a49a64abb37d797f508b3c45f8b955483d4e05651756b7 |
Hashes for laser_learning_environment-0.1.7-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddf79c06f4f3e69048a4437b0925d1795244ee21b8452c26bb2c87e6c84e6d00 |
|
MD5 | 0133ac36823c782ced962572e03edfe4 |
|
BLAKE2b-256 | 68011932c4867228a6f5258fd8354aace46a0b98d265ad99f893c26846512c99 |