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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.12 Windows x86-64

laser_learning_environment-1.5.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

laser_learning_environment-1.5.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.4 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

laser_learning_environment-1.5.1-cp312-cp312-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

laser_learning_environment-1.5.1-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.1-cp311-none-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.11 Windows x86-64

laser_learning_environment-1.5.1-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.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.4 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

laser_learning_environment-1.5.1-cp311-cp311-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

laser_learning_environment-1.5.1-cp311-cp311-macosx_10_12_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.11 macOS 10.12+ x86-64

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

Uploaded CPython 3.10 Windows x86-64

laser_learning_environment-1.5.1-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.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.4 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

laser_learning_environment-1.5.1-cp310-cp310-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

laser_learning_environment-1.5.1-cp310-cp310-macosx_10_12_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.10 macOS 10.12+ x86-64

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.1.tar.gz
Algorithm Hash digest
SHA256 d872075e357c0ffea71e40bec0adece061e99ceac063760be604bd8c6adb82aa
MD5 139843fd3740da537aa249cc636431ac
BLAKE2b-256 1f770b0f24bb473c6fd8af8c9008feeecafcb08e9661ba57050b1bc84883e132

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 893215be3cce4e6946dbcc39bf83f8c759a162e4663b3a9856ad398f06cebb14
MD5 68e8a99cb4fc5b7823e01de1bf2c70ee
BLAKE2b-256 bb3b8cb31d12313d93e4fe1399859b6a7f304a980d444861516da63965bc4eef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 95b89bb3d018266c01967cbff920e05875e472b10bd9815c265e090b0ce8eb6e
MD5 7f36cc76c5fcf698faa65c57442aeab9
BLAKE2b-256 4b189a2db044b42d455218add54439c332b5125ade4ff0341a86df82a038d8d7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.1-cp312-none-win_amd64.whl
Algorithm Hash digest
SHA256 6049115bc3e5f0efd367cbd91771c00745114a3f46e45acfe28525c94c162b86
MD5 101f133178cd457a66e86aefecd17fb7
BLAKE2b-256 f45d63e8e47f4022e7ed3593b6ae1d6f4c049c325514b5e2c03aab05cb2d8452

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6555faef16272f6df96515ce810d0533c1b2c8beee8c1085aa67195775bfba15
MD5 ec929a92da6dcb668f4cf5727d9b7f99
BLAKE2b-256 0caeeab5e4bf64e4bb7ca220e32a83210e29708e0ebf83f6c88f82465b19928b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a7d896a4df8f76f7289ee03007a8d6d4b846d89884d3bec064a2924f1b3ab0ac
MD5 b289ae40c84b500a0964cd77f9dbf895
BLAKE2b-256 fe68c4c79ad5bdd0c9fdd67967b206b16fcee501b87bb83e739715bcbdd06070

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 09369a913e5218cdb7c9dd29b202918085821748c44f77090a4fff46c5a0524b
MD5 9d751da4d6c55d1cb4cff40300abada6
BLAKE2b-256 b61c883487003a50feac85e6fd060249b4bd7e636142af2eace29a1a88c9b12f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.1-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 1f0ef51b19c9d937e6ad4a174b0bbac5f81be832cd3602e26eef07ebccc71def
MD5 1339431f07a57925ba1041d9a17823b6
BLAKE2b-256 b387bfbb5ba22bb1c797052b5109f2326a4aead5b642c8f239f67444e8b0dc35

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.1-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 af447fe55a707f164b6e093041c14e4bc7d98f2e21e7b0aedbc39baa6ad2824f
MD5 b68dcec952b278c3bed16468322e9450
BLAKE2b-256 b9fd5b9ce62860d919ab4b0e83903dbb1747098ffe481f1a6ed154a64f9bf7fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0d874f67b174e59e22a4582d26234e37ba7b85cf12287f9aa1ebcad902a60c9c
MD5 99fd62a057848a7734181ae37035a914
BLAKE2b-256 b147ca284bf7813542b781d868df4a08ba128d3bf5f5325b0feafeb8611c4eac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 72a3d8f0446c4fd76096d3fd715615c699d790f13be32d4fe40d8414f6391174
MD5 a60057f83051fd0066dbc978da07634a
BLAKE2b-256 3d7d91ab1f915b7a82362bdf935871fde0b2c4b8d12de2ffe4d12163f9fa0ef5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5bf76a51ca01b152c7d8fd96b0fa5fc84a2aa442bc1a7219a0f5fe96fb68934d
MD5 1e62cc9181dc21d7993f2ca657f608c7
BLAKE2b-256 7f7e3fefc790cf382960c394c3c78d98df3c446fefaa9adc83de6748f22e1aa2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.1-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0ff4074cdefc9f9c2ae70b6f4f057f84141f44046b09dfe1dc4e20f12802e2a7
MD5 cc337a46e2e911362c729f918521370e
BLAKE2b-256 ec516914b34bce99e81985d5a61038552a73bbc3c8a382ca6549fadd06f855f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.1-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 e159d7424be134ec295b26ca5ab001302856b82608988ef7068ea0d37db933d5
MD5 d3a891797c23fa900421a45253400269
BLAKE2b-256 4660431feaa6c4655a15b8285c6a1a07602e388c27248546b191212c6fbf7c7d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 05fa2239a91522ed2fef8e1a7f44b100bd4e2acecb5011f3b77083b158fb875c
MD5 82176e5f56e248ae16962813dc86457c
BLAKE2b-256 9688120e68fb6df6a49d2a31c8c3c0dd87b0459f5308138d8efea7f8ede3fa6d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 19a2f8acc3ec0a71b245763727255c93785c42cc7e83cb2aa00c334a0994e2e5
MD5 a6a4a81f2dbd955c383d40d46a0936ae
BLAKE2b-256 03de6f9cda16beb8ae8c80816cb9f2301b9fc41accd5a1cf2be4961f42ffb241

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0d973516fde443cb6f05f421bfcda5f3a21a147f032e0ae1daa09c83e384b9b3
MD5 f2c1d5f19cd348e2669def6a9e0e0a88
BLAKE2b-256 395377933cca2a80c82df6419656658463062334a91af3fa23bab273109c6353

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.1-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c13b079c864761146a9f1182a3bcb226424c2c55b3cf036373cb506cde8b6cdd
MD5 9d61d656fd8673f69b70a50c5de32c07
BLAKE2b-256 b6fd98d827ca350374ace89fb695ec285a38dcc19545830ac208a7cad2e0fc32

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