Skip to main content

Laser Learning Environment (LLE) for Multi-Agent Reinforcement Learning

Project description

Laser Learning Environment (LLE)

Documentation: https://yamoling.github.io/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

Install the Laser Learning Environment with uv, pip, poetry, ...

pip install laser-learning-environment # Latest 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 MARLEnv 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 MARLEnv class in the marlenv framework. Here is an example with the following map: LLE

from lle import LLE

env = LLE.from_str("S0 G X").build()
done = False
obs, state = env.reset()
while not done:
    # env.render() # Uncomment to render
    actions = env.sample_action()
    step = env.step(actions)
    # Access the step data with `step.obs`, `step.reward`, ...
    done = step.is_terminal # Either done or truncated

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

Run unit tests in rust & python with

cargo test
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-2.6.1.tar.gz (103.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

laser_learning_environment-2.6.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.17+ x86-64

laser_learning_environment-2.6.1-cp313-cp313t-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.13tmacOS 11.0+ ARM64

laser_learning_environment-2.6.1-cp313-cp313t-macosx_10_12_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.13tmacOS 10.12+ x86-64

laser_learning_environment-2.6.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

laser_learning_environment-2.6.1-cp313-cp313-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

laser_learning_environment-2.6.1-cp313-cp313-macosx_10_12_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

laser_learning_environment-2.6.1-cp312-cp312-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

laser_learning_environment-2.6.1-cp312-cp312-macosx_10_12_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

laser_learning_environment-2.6.1-cp311-cp311-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

laser_learning_environment-2.6.1-cp311-cp311-macosx_10_12_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

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

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

laser_learning_environment-2.6.1-cp310-cp310-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

laser_learning_environment-2.6.1-cp310-cp310-macosx_10_12_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-2.6.1.tar.gz
Algorithm Hash digest
SHA256 48978ad1b1b82b1a606b433bbbfbcb7dcda98003982f0d6355001914074ca26e
MD5 ce8f7c470d69001a65e5043de2d261b9
BLAKE2b-256 7b664f329b81a838a3b3f1cb9a3adc734a092edcf3bb49c911660fbeb09d31c3

See more details on using hashes here.

File details

Details for the file laser_learning_environment-2.6.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for laser_learning_environment-2.6.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b462614a726b9b415670ac09edafcc0c630c9fc30d64356c744e005464df9876
MD5 7938fc9f2b563fcc8705b6ad57a5ff88
BLAKE2b-256 7bcce946316eceb269e8e828f3ea36f7c49e4b5f97c5500fec53c02a3d2abed0

See more details on using hashes here.

File details

Details for the file laser_learning_environment-2.6.1-cp313-cp313t-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for laser_learning_environment-2.6.1-cp313-cp313t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f9d2d1478058240787f8f7067a347228910b39a143fa7596e4ce76cd37df5941
MD5 95902cfee1e6a32d09d71996f59ff680
BLAKE2b-256 d2ae378048bbe65452371e2ce2ec4b9183c89932c71f05f8b95cd4f599977471

See more details on using hashes here.

File details

Details for the file laser_learning_environment-2.6.1-cp313-cp313t-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for laser_learning_environment-2.6.1-cp313-cp313t-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 197bd5687cd969f01b69f229e16826f45a88a6ae8bfb0d72a5ac138ba7c5b6b2
MD5 aeccce29174dd124391680c0b25cc8f5
BLAKE2b-256 6ae42e90e6114bccfac283ad3151910f0acf9682853e6a8f6d2299eecc6438c5

See more details on using hashes here.

File details

Details for the file laser_learning_environment-2.6.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for laser_learning_environment-2.6.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6066a2c66493255738e915e248d387741ad2c0e4b062430b4c24084199f4db90
MD5 185271adc91b768d4483194efdbc270d
BLAKE2b-256 dd883c935f61472c123cc3a915cc8aceade3ee86502dce32900b62f35cb905d0

See more details on using hashes here.

File details

Details for the file laser_learning_environment-2.6.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for laser_learning_environment-2.6.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ecfbd67c15e88581b69386f5bd3714f521131592a6b318d1be53ceac347bf0af
MD5 fa2fbbfb8b985302ad2c5791ef2f72ee
BLAKE2b-256 415a9a87eee1d27e49b80827d22a53368c02b107a3a994325859cf578db075b3

See more details on using hashes here.

File details

Details for the file laser_learning_environment-2.6.1-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for laser_learning_environment-2.6.1-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c6d300927b7b715e2812a7a3b3c1805d76ab4c03fbf92a7f2525ef4d2668b26c
MD5 60d30c411389b989ba907eb059167eee
BLAKE2b-256 85813fef715823c652543bc62832760d98be6d495775f4fcc12accaeeaf1c06e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-2.6.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 09084a887849cc298f543b8eaa35b5010e7ec87e2d05f89df2849d0e97441e3a
MD5 cc43bc938fda90a3cd886243be2df925
BLAKE2b-256 5241e31b8ad6a19b7ae9668f42f27cd2e74576e2bbc0ec723691fddf1de81dfd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-2.6.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e82f440eadd3c1b467a29b806579f5e5cff9b5d9c3cd98467568485966dda0b3
MD5 c58ff5f464f7d3ca2aeb2a47626959d9
BLAKE2b-256 7fc0b3f5445253c2f5df94c23e0d8fa3bcbd762b25f678fd6de4a97af724cbdc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-2.6.1-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 880fe9339a7550c2e5209741e913dfa5133fae95e1503eb4a44a1b19a74f2aa2
MD5 2733394c40655ab27f15be9bc43f2273
BLAKE2b-256 ecdc4f906c112289fadf38ab35fae33dce33d903a6a4487389dad2d6cdb15d1a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-2.6.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3c0d4b78a798e208a1d9be9941c64b468d3ff7ab606201fce28f37fec5f37d8d
MD5 890bf9e6b89fdb10408ef989073d9ac0
BLAKE2b-256 04d561ca5bfc33d72660689978f108cb4c7d495d07927b09bd1fc21ce6b2f108

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-2.6.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c85e5ed328dfd7e80d3ea9a2e4f58eb413b9098fe64e9a261614a03e3a835e2f
MD5 7755dc368009de1b3553a7919cbfea3e
BLAKE2b-256 b1410b1712acd5932cbf384424fcae59ea714f2349ee39f9ffe956bf5858f542

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-2.6.1-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7104e55b3fc6bb278f7e23c2f7b501509e2c97bd81e648afc21ba9ba39067f7f
MD5 2610cc4a3c7f7e8bec0ebcbf79dbaebe
BLAKE2b-256 318e5801044c75ba404aba1d8e16d5751bd0c985e25acb12f879c9c142091de0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-2.6.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fd3833de698734ead8202aa658126df71addf85075bc8d0a81f52912567691c0
MD5 43e465d840dccbae6e766cc8b39a6568
BLAKE2b-256 d0f26ce7635cfd2dabb2f298e32eb5c0b7e926325e8159ed197854d54b654aa0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-2.6.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cd28ce339d4c04db63a36ef4e1e01de8aa2090a1f356d6f137bde4e88e2f67a1
MD5 9422886fe2cc7e57177b5da471c2dfbf
BLAKE2b-256 aa055bf8b4b4204bfcb52fb4625c700e412c56ea2788a0d2aee31e9fa7cb29b5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-2.6.1-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c12a3186874f991edb5c973f536a65fc9503c22ed24e216cbc5d26f8a2c2b86c
MD5 7749df0ef82fd4a148a38e9fb2af18f0
BLAKE2b-256 5b382c3083d1503e3d859d92f69f555facaecb2dccc150d7a1445bcaa4bdc8b2

See more details on using hashes here.

Supported by

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