Skip to main content

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.

LLE

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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

laser_learning_environment-1.5.3.tar.gz (95.8 kB view details)

Uploaded Source

Built Distributions

laser_learning_environment-1.5.3-cp312-none-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.12 Windows x86-64

laser_learning_environment-1.5.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

laser_learning_environment-1.5.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.5 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

laser_learning_environment-1.5.3-cp312-cp312-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

laser_learning_environment-1.5.3-cp312-cp312-macosx_10_12_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.12 macOS 10.12+ x86-64

laser_learning_environment-1.5.3-cp311-none-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.11 Windows x86-64

laser_learning_environment-1.5.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

laser_learning_environment-1.5.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.5 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

laser_learning_environment-1.5.3-cp311-cp311-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

laser_learning_environment-1.5.3-cp311-cp311-macosx_10_12_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.11 macOS 10.12+ x86-64

laser_learning_environment-1.5.3-cp310-none-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.10 Windows x86-64

laser_learning_environment-1.5.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

laser_learning_environment-1.5.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.5 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

laser_learning_environment-1.5.3-cp310-cp310-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

laser_learning_environment-1.5.3-cp310-cp310-macosx_10_12_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.10 macOS 10.12+ x86-64

File details

Details for the file laser_learning_environment-1.5.3.tar.gz.

File metadata

File hashes

Hashes for laser_learning_environment-1.5.3.tar.gz
Algorithm Hash digest
SHA256 72466b4774da4103b863bfd0a3bd52893b9745cc21e2551a285b35ab9060d596
MD5 44fc222d833a75801e910f1a9c1a6b3f
BLAKE2b-256 336fe479b9e594ac8ca2d1368bdf9c31f9fabd7c784913787e9f4e95d525c39e

See more details on using hashes here.

File details

Details for the file laser_learning_environment-1.5.3-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for laser_learning_environment-1.5.3-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f977e7c891d0d82bd0d98772d9df09d14f5b64a21a56871854eb305b4f66ec3d
MD5 8614136814f0373620f93b6a9732eee5
BLAKE2b-256 d1fc4e0d8b517d3753077d83c972544367150e6c902882aaaab957bd5861e80d

See more details on using hashes here.

File details

Details for the file laser_learning_environment-1.5.3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for laser_learning_environment-1.5.3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7b8a5fae6256fd0b9e0c1f8205eb14bc908db6de34e410ea3ee8e6264a9f935b
MD5 0376bc03be8215611608f6ce4d86b49d
BLAKE2b-256 b4cc95dc964db4fb93fe5f57c62d643d29340c6c2468ae5041170f416ff61c7e

See more details on using hashes here.

File details

Details for the file laser_learning_environment-1.5.3-cp312-none-win_amd64.whl.

File metadata

File hashes

Hashes for laser_learning_environment-1.5.3-cp312-none-win_amd64.whl
Algorithm Hash digest
SHA256 96b730e9c53a923d9a92eca843bc728f4dc06147c29137fe2fd648f99075ab06
MD5 44fc36d1af1be33ca6296a8fba71082e
BLAKE2b-256 ce8f8f1051e0acc9bcc9f9e46ee14ca07b6a275dfb3bd3680d5c923ee263eca9

See more details on using hashes here.

File details

Details for the file laser_learning_environment-1.5.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for laser_learning_environment-1.5.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 eea5c8cff22153bfee85d54ff02f141993aa1315c78350fcc5ac76211a369b74
MD5 14ca1446e42942067473b024b4b8edad
BLAKE2b-256 868f82de9625caa0773bed0e154e5cf2520cc95a915ea3e8e9e22dfad8b4f62c

See more details on using hashes here.

File details

Details for the file laser_learning_environment-1.5.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for laser_learning_environment-1.5.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 65349ab19610aeeb8c9dc54974af2e76e3a7d85c9456475e45b04a10935a6313
MD5 01a43bd1f86e19d3ee4bef505a6edbcd
BLAKE2b-256 802ac9af9c4fb30aaeaa41416f5a185832822717fb9b63389dc3f7420c69e066

See more details on using hashes here.

File details

Details for the file laser_learning_environment-1.5.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for laser_learning_environment-1.5.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d7c0b9548b82fe692fb185fd7cf396f439b3dd3e448a00ada96625e33f8b1fe3
MD5 6e8f5cf7342235f1797b03fd741c69fe
BLAKE2b-256 42b6e11ec086187b3b730245437a67bb38ce430d14db307b1b103a4e766bfdc4

See more details on using hashes here.

File details

Details for the file laser_learning_environment-1.5.3-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for laser_learning_environment-1.5.3-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f2343663ef4c8b67f814a24982a577ead91475d0c21229608f2a8818f3752564
MD5 7c336c3e12e52f868f2ba2e5c67a214f
BLAKE2b-256 0c4a8a2fe527cb1713a3e522ee61be3059fb468b1cfef5ba84b4e131c45e967a

See more details on using hashes here.

File details

Details for the file laser_learning_environment-1.5.3-cp311-none-win_amd64.whl.

File metadata

File hashes

Hashes for laser_learning_environment-1.5.3-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 0bb77795ac44512a4403faeb8195f98d7a28d6b638f56cec7657e13804a1ac08
MD5 866985bd180948f1d191cde5e6e0a14a
BLAKE2b-256 30b0a3f485d466df10804392b758643bf457b7e96415d45ffad20308a29260c1

See more details on using hashes here.

File details

Details for the file laser_learning_environment-1.5.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for laser_learning_environment-1.5.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8c3b02ee0b7a23180e3b5d0bed4a1da4b4f4a4a60de88d7e1191fad00a7f5ad6
MD5 9d8ae2bc2218c67f2114a801a4d47746
BLAKE2b-256 2370241c9515265c4a04d3d8700d8bc5b16f94c9289d47ad31f22a837ddf81d4

See more details on using hashes here.

File details

Details for the file laser_learning_environment-1.5.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for laser_learning_environment-1.5.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 693428e1e0455c5517ce641d618723255c5531486227bf59ebe3e4440b24b72e
MD5 e214be2e1a0424e40cb8260b75b07d05
BLAKE2b-256 7b3d2cc32eb9e2cc010144d26e3d1f1f57dff9fe608c33cd64319d44b3d7483c

See more details on using hashes here.

File details

Details for the file laser_learning_environment-1.5.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for laser_learning_environment-1.5.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e6face5dfc8faa4914c4c96aa350125f9f1f490ef406644eed5d247b6cd51402
MD5 89110a080d8cb2737bd83347ff83eb7a
BLAKE2b-256 a5097074d177ccfe43adfe0d644ec8a38b23a334c8a42d875fc07549bdad9dd7

See more details on using hashes here.

File details

Details for the file laser_learning_environment-1.5.3-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for laser_learning_environment-1.5.3-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7979dbd1bf5923b4c6b2c64889f4d9d04e7f7a8e073be500cb4f6ef1bcd24faf
MD5 0702809549f12def339921fcf5c1e17e
BLAKE2b-256 8847b1b2037287ebe1745712e75032ccb2c158f2f4be7c8e4a1c12cd8c87e4da

See more details on using hashes here.

File details

Details for the file laser_learning_environment-1.5.3-cp310-none-win_amd64.whl.

File metadata

File hashes

Hashes for laser_learning_environment-1.5.3-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 7e76c57706490fa521b3d18be265990e141ae3b9722c73027a6f6db4c2c1a1c3
MD5 574b5329a6d76dc4cca7797f15af0447
BLAKE2b-256 88552c53c82a3cf78b9a9eed88f18607a8c8dd5cbff536d3379fdfaf0f5eaa5b

See more details on using hashes here.

File details

Details for the file laser_learning_environment-1.5.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for laser_learning_environment-1.5.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 032e2677a5e5059c51cc8d2c7440d4a92c712613ee3c171143eff8360b222e45
MD5 129051e9f9f4fb20acf577430f85eb2d
BLAKE2b-256 4aeb90593b2ad6d355571e7e68a4d77b73d91d90a61de5cbf022a0558a1a2876

See more details on using hashes here.

File details

Details for the file laser_learning_environment-1.5.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for laser_learning_environment-1.5.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 fb2a6213cab5c684d4b602e938c928f2cdcb6cb8bd49241a14f226d129e46896
MD5 3d753f97b24e2b1c236847c8e137834d
BLAKE2b-256 e7fb1a18118c56b00a2c53b5cf3dffe4a9a80eba9bf9a05153e275aa93cff17c

See more details on using hashes here.

File details

Details for the file laser_learning_environment-1.5.3-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for laser_learning_environment-1.5.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1399d6ee1a553845d72ad7059478f3ac735f3d20cc1487e38ffce06be833660b
MD5 44c689939ca6e8a5bb8b45016690d9c8
BLAKE2b-256 b66c82ce828d58e11df9ec808f0736b88b2bc8852dd4d00e9980f96a447d5f9f

See more details on using hashes here.

File details

Details for the file laser_learning_environment-1.5.3-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for laser_learning_environment-1.5.3-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a31372d846303cbcd430445c23d6f104294cba255ceb63a579a9db762782e417
MD5 36f23d751ab46326df2cb7be39f752a9
BLAKE2b-256 ed46daf6a9c10366c87c985cca13a2b7f03029146cf5eda56ea16fb4c6a1ecb7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page