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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.12 Windows x86-64

laser_learning_environment-1.6.0-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.6.0-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.6.0-cp312-cp312-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

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

Uploaded CPython 3.11 Windows x86-64

laser_learning_environment-1.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

laser_learning_environment-1.6.0-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.6.0-cp311-cp311-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

laser_learning_environment-1.6.0-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.6.0-cp310-none-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.10 Windows x86-64

laser_learning_environment-1.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

laser_learning_environment-1.6.0-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.6.0-cp310-cp310-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

laser_learning_environment-1.6.0-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.6.0.tar.gz.

File metadata

File hashes

Hashes for laser_learning_environment-1.6.0.tar.gz
Algorithm Hash digest
SHA256 3aff81f9e9c63b978384e87baa9a98a4048e3cb1eb73776eb273df7972f105b7
MD5 ec825763e58060b0f070835001589728
BLAKE2b-256 1c31f5fa887b0c64911f372af411355867f36d88a369fec5e6f254408f29456a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.6.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 90fb6302c22df6fec0016f5a857f30ce6a22c7256be3423cb18f424ee189869f
MD5 e7622d6ae234c03b50c80697144c1be9
BLAKE2b-256 d79571dcf173284abac235c85a26776f04836c66531bfbf254b6b8a4389e6a34

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.6.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f455bba92dcddccabb2a6970be87cf3d47b765962692192af9dc836de9104975
MD5 453487b3848d9122e602a9b4c8e3dfe5
BLAKE2b-256 eb4e344b2aa52b9535143508ff963f374bd269604da4ddf74b52f8e5f0369a9c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.6.0-cp312-none-win_amd64.whl
Algorithm Hash digest
SHA256 31cbabcea21af7ba18e83aaec641370d24531d14ba92f64248a6ded31dc78678
MD5 84107bf6adab47e82cd1e87ce0806a1e
BLAKE2b-256 2a84453f43d58413c029d5b72379579292befdfb968cd73b1ab1f867d7107f95

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3d727d81fbc92adc7866f4a9bedcd0d4c0301c1be478c1c3c254310c428878ed
MD5 8f8d3e17ed791b6271f6e310cfa8da03
BLAKE2b-256 6b30ebf352dba34c98caa44cb8c4950121cfdf52de6279159a7a33fc5b05cba7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.6.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 199b59436682bf607ad4e8a8c5ebcf7d83b0e8e6261068532d92746d22054378
MD5 700fb441acb8f2c7588bdb152a5a6cc4
BLAKE2b-256 71535952a537116b7f5a67b03898d70242258464b0d74f1acbd3739d131b0187

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.6.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c05f1b137fa785d4bdbb93f510392d6504d1e7ca1dd9e70b75205026df643188
MD5 c35e6c5478ecee634f23ccdd6d6e1b84
BLAKE2b-256 5d86f6c67321fbfd4ba0016ff59d5143524e4ba47482af460d3770175787ca74

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.6.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e0c25a8107af4bb173939b876e536dd097381b13fff70d09c499561f8166cbd1
MD5 4297f4c797323136898165219b224f8e
BLAKE2b-256 5f8aba31f26b920abb9ef8eaae7a85eeec052d81a32d18f9a1a77e3050117e65

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.6.0-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 fb1458061270645723ceebdb1b1b36f56002f4e9d249233e6e9c59a82a69808b
MD5 2acf81825be727ab93033e281b525e12
BLAKE2b-256 cab38ee3f39e499f90c2ec3a270354e58217594d75351798928de34dfd714679

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a202dcf3e12dbfb8153ba158a2df8d90d274859ec90acad3f89daff722818bf9
MD5 3d15a9eb88010280ea27264cbd5ba76c
BLAKE2b-256 2e23352ce18ef1045c885cff59a4ca182e00383c43b46157f2e63fa8714c9def

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.6.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 bd8c4e79a473b615b358e19c99fb08b97b56b7288752b02c963150ddfdcfe19e
MD5 5fcf3f49d66786879bee68940e354522
BLAKE2b-256 5f647374723596a17601a42458698e5c74e43c9d2eb0c839bde79a4be5be33b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.6.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 73bba4b133bf0ada4f1f7a9a1cd7ecb11ba7fd39986c6e858caec9506a8a3091
MD5 2908741e23e07532b3c5581a7ca3139f
BLAKE2b-256 1116a40cd82152f15bf32f7e9a8f88cd003be176fb526cdfa8082217b816acef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.6.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 21f8065822b4b098238578be70b56fddbec47774efe2defb0096473bf9b3b03f
MD5 8ad453b6bac55778ca631ff81341559e
BLAKE2b-256 576412c377065232bd8f00feee7f3c659c8bcae227416cab5c8a01d8a4177c26

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.6.0-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 f48c2d03acbceb22a6922ed37725eac37c22b00903e70797051555042739181b
MD5 daa434f0d88fc1e047fb1b392828b74e
BLAKE2b-256 70637c8488cc206c33ed209cb6a74e6bede39aa5647238fe2a8f18e664c6e1bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3f5f796c19b27040d889afdd968a0dabddbfacd38e65081afcf9914d27ad4a54
MD5 b8c5a5f403db85dc707442e79fa526cf
BLAKE2b-256 538bed20aee0a5e52c1abeb0414c1185f20e84ebd4c7c98050aa9c45ae4bea68

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.6.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6cf1461732253c21a58c461642ea64179df1b9c07692ef4bcfbbbabf85d34fa2
MD5 d6460f4f3ebd8a5a93e101166727fd3c
BLAKE2b-256 881d8c877fea3c86f80f7d2975e2922144925f812e6fe7546676c0a80406c86e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.6.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0a2d0a6128734984678f7fdaefc45f56a60a5659afd4edd7bc3a6d656fb966d8
MD5 fa4d13eb44aac3ecabeddbce4ce19287
BLAKE2b-256 173036b964d76e733a2021529fafe9836aee904bb02d4a7c4e2924a3ca476755

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.6.0-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 db9b484a2778c53a9342de8bd31cbe97aefea90bacdb8c729775d7d92a9630cf
MD5 cdc674b7b3efc12b3cc3133dbecf8557
BLAKE2b-256 de27113fa6348d2ccba0d75991f3fe005d2d501148a0a3c63adf3909ea69d8bc

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