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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.12 Windows x86-64

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

Uploaded CPython 3.11 Windows x86-64

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

Uploaded CPython 3.10 Windows x86-64

laser_learning_environment-1.5.4-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.5.4-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.4-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.4-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.4.tar.gz.

File metadata

File hashes

Hashes for laser_learning_environment-1.5.4.tar.gz
Algorithm Hash digest
SHA256 416427b6715913460c6a626560c0f66e641f45326fc2239b01c8796be6342ba3
MD5 2cf7a0e24c5952e5cc2af38f6d5a89e0
BLAKE2b-256 76e9d3ededd85fc9bb05f3620a78a345a5480bda564785c10690f99199546232

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.4-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 32b050ae7fa32d0a838ce04aecefdf6e82b16b5c22e24636cfebab9a21859ecd
MD5 f1ebb7837e30c5cec042bdfa615b88b2
BLAKE2b-256 0450432a117cd4a97b2f889a330c6c7f0094972e98e3277fa3e4568b73eff7fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.4-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4a05beae97893274aeac8c1a4899345a58c7ca77274238abd6e02e232f025ee2
MD5 88ace055fc39e700673c9832e8103f1f
BLAKE2b-256 5ed7f371d50360fe8ee4b5b6d9bd4507f463c07c16e31803c70d5b5c34c7dd1f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.4-cp312-none-win_amd64.whl
Algorithm Hash digest
SHA256 b2445fba3b211707351f7bc3c556abaa20e90886b6a080ebef6ce4594909649f
MD5 6e804a01f6960d58cba9b127825dc5b0
BLAKE2b-256 ca4e4a5f917990d155c390c184192c9652445ef5c3255a8d7057c352050e793b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c67114fd38e2024bba49d81d12b41d65593e03298693402bedf2d231a23cf919
MD5 41f827dd202d8199390ca472ac206e8b
BLAKE2b-256 ad4270ae811c76e8e0de2abbc53ecd514f9f00f3fccca416f0c971718171a954

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ad16c3428b434b86a1130d7c80caee39d1adc150e2d9e0416c71766584ffde97
MD5 bea998b2c7095a21bab6d746957571e6
BLAKE2b-256 1581a028f436867966e329f112aa105e12eaf43fde97988239fbbe7f69efa3cf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bccf7f42f2be588cc696a4bd72ce38e1c0bad51ee787c5bc00375aef6e71d8f5
MD5 17e080690f9736ad0fd63bdc95e42fc3
BLAKE2b-256 a57fc6646485b86dc4bbdb354b63e858e0b498bd7e4141984e26d234b2006504

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.4-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ef50d410f78e107ce3b9da8ddc6b2c1064affc0ed6bbab8cefc970ab3c1ae8d2
MD5 58bc86c09a821356906dd6d892db9a05
BLAKE2b-256 c7bb4be8ed8320d6e5a2d25b15afbae5c9f98d7c5ca59885312e2d9e5e818b52

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.4-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 3ec5adf31561574e62429933efe0fe85ce493462f73a43b47f9a49ff1e97ab98
MD5 7163c33e95216dd936ff34847dd4153d
BLAKE2b-256 496215897baeb38811f6b215579108c9318a6e08a359d5268f8f58315cb2d569

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b1aebb495c852c33edd94520d3ccab051a15f06efa3f1d9f5e8caa8ce22a0ffc
MD5 cb1e90a6b108cfb73650296150baad2f
BLAKE2b-256 f205a1c8347be8510be509374e0af8332c5b32dd67336473e1fd6dbb4c88ebc2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5f5febd63f263e4d7d38fe4f91b1142cf727c3112badb3b3bba05d18eccf11b9
MD5 ab5af8098d9184c4750b55f0754cc0eb
BLAKE2b-256 d1af2eb6db356da177c8405aa7d063e448ccfd951d9179e9fd00873bb591174b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8376fcaf6b908d0b505d5c28f3c021ac2ed8d2fdad33f426cd4baa8f15760b5c
MD5 9d5a8e8d575f8ce03f6c703958b5db78
BLAKE2b-256 6712964b33b38d9f78510dcb7526b03cb7ebd85d465dabff61e964130d361e04

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.4-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 dc149618132e67492b3173c7ec232310d6c82e7bf612898045f392297ffbd29a
MD5 423ca99a7de5313538a181e4a687140f
BLAKE2b-256 b942295d9622742424aa98df37305f118868ea180079a2b1d117a689b845dd48

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.4-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 4c45f1eebb447b5e698c40796d497e25c3c583383cbf11ba91300e19a43bf958
MD5 6d551bbd1f1e02a41436a524bdcd5023
BLAKE2b-256 05284870b94a7c97ee7c5a3a249e681388733d760a45d6308c8138420f5ea610

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 07be2eb00b457baeeddcbc4efc8343b0490a9e5b994072e06f869915d405a02d
MD5 7135ad5c00ac6875013b4a96958a713b
BLAKE2b-256 9d136da462d3de08415b03bfb3f5cfe644b75344f4d30967c7c4015ecd5d63dd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c2d75067eba2b1f4076bb6e4f81180c613c5f24c1b392c37c09db58ceb646a3b
MD5 b7b8892256d4ddb5dff59e57a96ca3a4
BLAKE2b-256 81c6a69b2b14d627ac9e68d2c89e559ae99f5242c1e08629c8acbdbd23f7fe21

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 935c6fbe80ef2f4cba692c915de38b7e1dbfcf41cddcd7728e7c81a3ef1ee765
MD5 cd44cf7261e66aa283f9973114a01efe
BLAKE2b-256 a72fcc174c84397bb034d6153f37d337828213fa13faaee4c536a901308159a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.4-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 5e7af892d5532df5146b80ce1a51c0b1126439fdda0d9e2f3674d8d570388366
MD5 e8648feb671ddf9fb5c974af4bd265fc
BLAKE2b-256 06a786f6dde8701108964a9547288975069313fb46e7125b93c3fc09505a85bc

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