Laser Learning Environment (LLE) for Multi-Agent Reinforcement Learning
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.
Quick start
Installation
You can install the Laser Learning Environment with pip or poetry.
pip install laser-learning-environment # Stable release with pip
pip install git+https://github.com/yamoling/lle # latest push on master
Usage
LLE can be used at two levels of abstraction: as an RLEnv
for cooperative multi-agent reinforcement learning or as a World
for many other purposes.
For cooperative multi-agent reinforcement learning
The LLE
class inherits from the RLEnv
class in the rlenv framework. Here is an example with the following map:
from lle import LLE
env = LLE.from_str("S0 G X").single_objective()
done = truncated = False
obs = env.reset()
while not (done or truncated):
# env.render() # Uncomment to render
actions = env.action_space.sample(env.available_actions())
obs, reward, done, truncated, info = env.step(actions)
For other purposes or fine grained control
The World
class provides fine grained control on the environment by exposing the state of the world and the events that happen when the agents move.
from lle import World, Action, EventType
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]
events = world.step([Action.EAST])
assert events[0].event_type == EventType.GEM_COLLECTED
events = world.step([Action.EAST])
assert events[0].event_type == EventType.AGENT_EXIT
You can also access and force the state of the world
state = world.get_state()
...
events = world.set_state(state)
You can query the world on the tiles with world.start_pos
, world.exit_pos
, world.gem_pos
, ...
Citing our work
The environment has been presented at EWRL 2023 and at BNAIC 2023 where it received the best paper award.
@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={BeNeLux Artificial Intelligence Conference},
booktitle={BNAIC 2023}
}
Development
If you want to modify the environment, you can clone the repo, install the python dependencies then compile it with maturin
. The below example assumes that you are using uv
as package manager but it should work with conda
, poetry
or just pip
as well.
git clone https://github.com/yamoling/lle
uv venv # create a virtual environment
source .venv/bin/activate
uv sync # install python dependencies
maturin dev # build and install lle in the venv
You can also re-generate the python bindings in the folder python/lle
with
cargo run --bin stub-gen
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 Distributions
File details
Details for the file laser_learning_environment-1.5.0.tar.gz
.
File metadata
- Download URL: laser_learning_environment-1.5.0.tar.gz
- Upload date:
- Size: 93.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3afd6cdda44a2a9081220a90f1126760ed97d56d4a0b5502615ca6a54a3cc04 |
|
MD5 | df77edb854f996ae3b4a5716152d6a5d |
|
BLAKE2b-256 | f42137054c53017f514d219e718974b44a0df120c4ff00862a9fffd9871ed307 |
File details
Details for the file laser_learning_environment-1.5.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: laser_learning_environment-1.5.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.5 MB
- Tags: PyPy, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 965de290f10079213b604b64e1777304f4455a2ec3d810232b04d421febc4f0f |
|
MD5 | 321c817749c4292ebf7f4ca45402efc1 |
|
BLAKE2b-256 | 869686594e58097bd155712b9f2256c2c134e10ba2ab5fdb87d387d41442f42f |
File details
Details for the file laser_learning_environment-1.5.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: laser_learning_environment-1.5.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.4 MB
- Tags: PyPy, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e9cf2882fcab4a33f18d75e785ee95da7d17501d4db9f4884fc26374b04f505 |
|
MD5 | 872b403170de8f69b44aac94a590d30b |
|
BLAKE2b-256 | 0cd96cb677ad155262263b176d09dacad28ae9ab3dd975c0e424e5af4d8f65c1 |
File details
Details for the file laser_learning_environment-1.5.0-cp312-none-win_amd64.whl
.
File metadata
- Download URL: laser_learning_environment-1.5.0-cp312-none-win_amd64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94239b95dbe706a1562e2f925152a7b542bc9536a29016f6417955c18faf1aee |
|
MD5 | 28fdc126032922f5567d26313fcf4a5b |
|
BLAKE2b-256 | 9a337f7db08003ad7bdfa758e7cd3ccd3935a634292de2aa643a151be0a53b09 |
File details
Details for the file laser_learning_environment-1.5.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: laser_learning_environment-1.5.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | df08847aa0d7ff0cabe875a36eecfff6064515eca94cd1c3694b3cd7d8f0aa36 |
|
MD5 | aca1230867dac77e34865c8322d1b98e |
|
BLAKE2b-256 | 101a1abf50ff47ee56d35d50061b4039f851172069d9112ee22bfb1abc12eebd |
File details
Details for the file laser_learning_environment-1.5.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: laser_learning_environment-1.5.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bae6c846db5ed5453b20ff2bc21dedd9af22de94cae69387a50bcb389182b80b |
|
MD5 | 26356b04b13ce0556b6c585aa0a5db85 |
|
BLAKE2b-256 | 71d18befc0539c24495f7e5519a6c30189cb8352421921316c192f6a4a4c303a |
File details
Details for the file laser_learning_environment-1.5.0-cp312-cp312-macosx_11_0_arm64.whl
.
File metadata
- Download URL: laser_learning_environment-1.5.0-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13c53ca9dc690378fcd9e0b5570718248c86a6bd93ac67d5411937a4b209e450 |
|
MD5 | d036e6bd13335e7b7cbf4a8d48974dc5 |
|
BLAKE2b-256 | 2d57b5e2c24dbfb64710c8e474bd3c7d7b66adc98db600ed90937b41b4cba532 |
File details
Details for the file laser_learning_environment-1.5.0-cp312-cp312-macosx_10_12_x86_64.whl
.
File metadata
- Download URL: laser_learning_environment-1.5.0-cp312-cp312-macosx_10_12_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.12, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a75e5e416307c13bf0d4cb679c1fbe5f98cfe556ab57fbee1d7d7b89b2056de |
|
MD5 | 25b8a0921ea28053023ff98b18f1930d |
|
BLAKE2b-256 | 39b8f232184e3a3e83bdbed6ccc9e8c1bc825fefe4de355a621aa170480bbcfd |
File details
Details for the file laser_learning_environment-1.5.0-cp311-none-win_amd64.whl
.
File metadata
- Download URL: laser_learning_environment-1.5.0-cp311-none-win_amd64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb3d52843335c97694d9433b306309754f1c7e1aec433fb72c27ea47953b0eb0 |
|
MD5 | 06e7bc4d91dc2e274eb38ddfacc217b8 |
|
BLAKE2b-256 | a813b63fe5d4c94a4b501b5084639d9eb23c70905252cadc15ae22d7d081beac |
File details
Details for the file laser_learning_environment-1.5.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: laser_learning_environment-1.5.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b19bc438a81209cfe00918008a5af6d60f84a368cd9e898a601f0ec6dbb3260 |
|
MD5 | 1d323095600c2f66ea585771a2ea50fd |
|
BLAKE2b-256 | e6bdd0b44b8a38cc6822ca19f055f53efd78aca09d6c4db5edf7b9fe7e9f18e4 |
File details
Details for the file laser_learning_environment-1.5.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: laser_learning_environment-1.5.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a6952b178a7a6faa53a9c177297c07ac682e3929fc635390a8d943f03fced81 |
|
MD5 | ac7af112f3891d12db573a816b0a2d91 |
|
BLAKE2b-256 | 3bae9db980e4200a7de1cd4c1cd0bd79ce21c6ba87b0745b051fadcfbc9197f9 |
File details
Details for the file laser_learning_environment-1.5.0-cp311-cp311-macosx_11_0_arm64.whl
.
File metadata
- Download URL: laser_learning_environment-1.5.0-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56397b8d70a4d5910d0d67611777da9bd21e5e5ed1bcaf06e540804e26c2305d |
|
MD5 | 50ac57527d4ba4fb37e4485e30ba477b |
|
BLAKE2b-256 | 94f9933fd829189ac4f9b3253cb0bb5232c4ce5249dcddccd493b281be4c6475 |
File details
Details for the file laser_learning_environment-1.5.0-cp311-cp311-macosx_10_12_x86_64.whl
.
File metadata
- Download URL: laser_learning_environment-1.5.0-cp311-cp311-macosx_10_12_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.11, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53d709cf007ca43f1189634b4c4f53145ed505d18034b83419af490dff90842e |
|
MD5 | 600527fa1d2651670c090ea25c524de7 |
|
BLAKE2b-256 | 1b7cc2894bfdf82e905c5b308d8c71f2d814eb7a0967472183e719de3176303f |
File details
Details for the file laser_learning_environment-1.5.0-cp310-none-win_amd64.whl
.
File metadata
- Download URL: laser_learning_environment-1.5.0-cp310-none-win_amd64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 395e3e5be23f1cdd582a5faef287394fb20fc3567f0b703a52a8db52b7edab99 |
|
MD5 | c52baa1d4882834dd3a2f3178cb11e69 |
|
BLAKE2b-256 | 1d6651c23c092288d6042d7017dc5f0bb3f4f98eb9e96d9bd97abbd2782d2cd0 |
File details
Details for the file laser_learning_environment-1.5.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: laser_learning_environment-1.5.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97357a022608072badd9729a2d22afa9cc5c05a2606e37b4498ac43cc0fcf9ab |
|
MD5 | 93f244ef686f458729a9eb8702b3b6a0 |
|
BLAKE2b-256 | 6c23ceab2c0b5d93bbcf7dc7f588ddcf84db5194e1e3b542b8fa794946825cbb |
File details
Details for the file laser_learning_environment-1.5.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: laser_learning_environment-1.5.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d54d425c732f86d638510d2a401527d32a9ce7205e42b1a74267cea011d77a44 |
|
MD5 | 2f3934d9f0507bff262e6008c433c971 |
|
BLAKE2b-256 | b0ca4ba1d9fb925a0808a7edf431895e2afd6ead8a4953db23333bc0f7614af7 |
File details
Details for the file laser_learning_environment-1.5.0-cp310-cp310-macosx_11_0_arm64.whl
.
File metadata
- Download URL: laser_learning_environment-1.5.0-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1950b123104a4c49df67ca4a51adce9b3c016f6d987b68902e38b530864ef3ca |
|
MD5 | 35dce14659bc4f8c8fb53063c0b6152a |
|
BLAKE2b-256 | ce5590b306d2c2edafa5e03324759104bb1b22e12a14c081654aa9d85705841f |
File details
Details for the file laser_learning_environment-1.5.0-cp310-cp310-macosx_10_12_x86_64.whl
.
File metadata
- Download URL: laser_learning_environment-1.5.0-cp310-cp310-macosx_10_12_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.10, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f79eed7409c3c8cba24a2916aa8b1434f5494f2e404a690bb767b0415a25031f |
|
MD5 | 0a969254b9e91fe0d648a984a492a7b4 |
|
BLAKE2b-256 | c29a44e7213b3d753e6192d9fd3d19c026f446a983dd4b82cd80aee3d7ce23cf |