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.4.2.tar.gz (89.0 kB view details)

Uploaded Source

Built Distributions

laser_learning_environment-1.4.2-cp312-none-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.12 Windows x86-64

laser_learning_environment-1.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

laser_learning_environment-1.4.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.3 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

laser_learning_environment-1.4.2-cp312-cp312-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

laser_learning_environment-1.4.2-cp312-cp312-macosx_10_12_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.12 macOS 10.12+ x86-64

laser_learning_environment-1.4.2-cp311-none-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.11 Windows x86-64

laser_learning_environment-1.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

laser_learning_environment-1.4.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.3 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

laser_learning_environment-1.4.2-cp311-cp311-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

laser_learning_environment-1.4.2-cp311-cp311-macosx_10_12_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.11 macOS 10.12+ x86-64

laser_learning_environment-1.4.2-cp310-none-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.10 Windows x86-64

laser_learning_environment-1.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

laser_learning_environment-1.4.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.3 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

laser_learning_environment-1.4.2-cp310-cp310-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

laser_learning_environment-1.4.2-cp310-cp310-macosx_10_12_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.10 macOS 10.12+ x86-64

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.2.tar.gz
Algorithm Hash digest
SHA256 e79994c9799f865273113d07b2453da013f8e62c9f4de94c9535d48e4a2cd98b
MD5 5d4a959dddc0a3982b4b9845588ab508
BLAKE2b-256 d2af5a537f0749dac1289834266eceebb709344cc8e5519a78ba4cdf927dd4ce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2a3a23e60cd66a1816990f4d7144dc3d06f3ecdf8edef8e257938707716b499f
MD5 b553c1476eec5f3883c7351d6b10fb9e
BLAKE2b-256 ea2ad884b9af7cfd3e8735773f7fcc9488763c7719073f4fd34aaefea54e4b73

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 01ba1eb75693f8da2f6f736dd2434615b805e2e469f40aab07686dd30a18ca05
MD5 ca7d84066ca987a79be65c89f73d4728
BLAKE2b-256 ddee175877f6c9415f4d8a450ee7333975cc26863c9b883a021f341ca4700d87

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.2-cp312-none-win_amd64.whl
Algorithm Hash digest
SHA256 c1eb75ea48a6589c6bf980e4b882bf631bb7f3fc22a612805e111cd914c8446c
MD5 64c068089f32cf6cf441b4c97cf8fc6c
BLAKE2b-256 f8a348a3cffa704b04b0f01e8b5eb299225d56147efb10382bca7e937c69c5d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3859bcef56a9b4594d52fa191cf8c118b785c51dd86591c7f67784125f01d500
MD5 2967c2e305e7d456b340a03b440eb151
BLAKE2b-256 3e5d7f7721b2dbff3743466a1ceb2443d617c7c90af6a565a71ef34e89848d5d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a9bd4b3a98cc39faf2713448f36a9bb164135331fd72c769b0e07e6a8af06d43
MD5 123885816fa74bd56ae8e3eaec1276ac
BLAKE2b-256 a4d2690b44f9ec49767cb6d70a13c976d7703e06de46d72bf6abd0b39826201a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d1d02ff767e3d3bdba0dbe13ab7f3ee832c400c1d00b2712db76745ed2f96a96
MD5 7b419d6a5fd8657c8b57132f2c47fafc
BLAKE2b-256 ed77831f818cb233b23ae3f50ccc1616a8b52db0d3d25c4b31c092444d48a317

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.2-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9e5233fa084f47a760b93401b1304841cfaa20bdf1e97aa5beacd93fa2077d58
MD5 c274e7cce9e5ba601b3425435938dfda
BLAKE2b-256 69ace4f22d8e8de5912e8516234002c7cab2d61b90b57e2c994f9a818d389f5c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.2-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 2140051f5fddcac0198b8365d77eb028dc11a7772fb02155b6bfd98087ee9df5
MD5 fb179a143d3fdb851672a8b9138f761d
BLAKE2b-256 b9322e782859bd217ac093ee3a02c1318a14ea89bbaeca65ad44643ea72ea633

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2f3bbcf628b8f5b30fe3a4a0569f969e48feb1c10fb602d54b16518c468428fb
MD5 3b8c0609463a3852b20ad7c027b8e570
BLAKE2b-256 e0607a4a649a2b2e2ced7fde3814ac656f6aea1fa49687937741a77d2f4a7fd8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5915f05c008672ba0107d2e05049ba544d7c5934185be15a01a3b304d4608a6d
MD5 10f215a96799fd9149ac93bd2c63a150
BLAKE2b-256 93c50738e33ccb382aa97c9600e5bfe57be35f472b40a90ff9cddeb1b4ffe07b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b993fc05e077d4937cb4fbeb2b86bad1d0282e48990f9fbb19f8cab76c44baa3
MD5 04713f1b91a1f0c90eda2e7b9d0d6975
BLAKE2b-256 c9686d3bd0153ee6eab0a13891e2f440ba4edd22fc0b1da58daa79e3f75e5495

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.2-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e85138923a20145f7cb5073a03fbd0a5bf4341118675e983be108de4691447fe
MD5 af2f8263087dcbd112342403da976b2e
BLAKE2b-256 57c08337989733745c3ad6471986902bb04dd281e2b8f35075fce7e161208794

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.2-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 850e7d3c215bb9541d18b551aab6ff69d08ce5d5af97f4f81cfafa74129698ac
MD5 db73b91e93f40ae44bd5780a6fb77316
BLAKE2b-256 c95cc49da6a8748d4c5c73b0ee85ab4d956b113a2d293b8e145293dccf66ef52

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3aedd500f8d35548d084f0db35e228398f86862c16ba8269378c44302dab4af3
MD5 c0a8845ee8c236d8ccee07c084d2dd1e
BLAKE2b-256 5b3be83d0d0d812b4cccd1ac1e950fe4d9dc0736da4a454d595584fc9c3392ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 aa066706f3b9fa479212f6869ee4e45f9fad8efcda48e097503df6b6c5a0b094
MD5 d131697fed1c942b0569de40157e8feb
BLAKE2b-256 5849dc39fbaed8873d5d0c670cf09b2095be2555e9b4365ea8f3a63e1c5bcdd4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 90f8de70a8487c4abc1813d2c4497484dd46bc62ad2355de9f2f3da62352e95e
MD5 a1c8062fbaa939276121a4d8ce33b817
BLAKE2b-256 cea145cf19ed617ccba3b63a56e12b788def736fe8691057a9437b00c58a310f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.2-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 5cdf2d63706dfcecd3b6711a24ff41b90157be5bb44b86173a54c9d1d10b6eeb
MD5 c1f5062577d4f2d67c43e5d2cbd942d2
BLAKE2b-256 5c7fe5923a4f83f227a7061698ca3ae6af8d49df517db026c36f01f1c030348f

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