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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.12 Windows x86-64

laser_learning_environment-1.4.3-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.3-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.3-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.3-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.3-cp311-none-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.11 Windows x86-64

laser_learning_environment-1.4.3-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.3-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.3-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.3-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.3-cp310-none-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.10 Windows x86-64

laser_learning_environment-1.4.3-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.3-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.3-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.3-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.3.tar.gz.

File metadata

File hashes

Hashes for laser_learning_environment-1.4.3.tar.gz
Algorithm Hash digest
SHA256 6254860796b281acd5b5126069de7f3746367327b4def4d9820da8ba8403fc25
MD5 93526097923f472932dee1f659d8c71d
BLAKE2b-256 5959da34eed62b7851233778f0bad4e38994a716af261e8437503cd8f9eb2389

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.3-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1c2bdd1b0fad71c781a0c93d4ea8b8f56bd87da5494dc9dea35a7bc886dd59ee
MD5 43b4a244604dbde181bbd9df1944cacb
BLAKE2b-256 3856bcc318aad5ebe105dfab65fccf9d13dcacb3e010e7da9d57ee4a825ada75

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 192e8a04767cb06982efb05d9d613ff5f4d73de9e3c03748969b05c298987fc1
MD5 071d2d30ac7407b0a5b6fd5385f90033
BLAKE2b-256 3817d3b06b590acb8e27ed4d475d71f4a2dd0fbf94eb4962d4d0eb121337c765

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.3-cp312-none-win_amd64.whl
Algorithm Hash digest
SHA256 dbf9dcdea9213be2b477b938de303d90dd5452ca0e92ea24cf766f7c47a866d4
MD5 08b82fdad0d7f1d0f9093a4d807aba2e
BLAKE2b-256 b75ae92ef8a4fa79c45815643e0e6db55d5d6a49ad51947227055daa3e4e2d95

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f1ba1e7e1f8e0b1af5fd1c50f4b19c5731d2749f45170b6fd94d6a308043933b
MD5 6a0aacc4c2b185afe39cb17bd9e4fc96
BLAKE2b-256 d20f5c9930dd1f5daaba963e6b6c238d45a87f53fc633b471498b4e3023f59a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ca6a39d399faa7daa2bcf48008ea722ae479194ff92c60d35fecdae0bcc62b6f
MD5 78119b5c09ee628d5cd0e89876759f3e
BLAKE2b-256 8d99cf46a27c5b3eb60f1f24f9d9b9fa927807c06facd1894e6cda983f09be2a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 16228ace33f85d4bd20b7536fe5fdf961ffd894e5bec7f5e7d90bd017d66e25f
MD5 39a4bb9e9d5035e8d73088b5e59ab89e
BLAKE2b-256 2b739376299860621417adf461e03e609f87e9db110b48bfa359d3802e1f1efe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.3-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e59d431c1e1bf3a0f218c4b84c8af1b4d941f58daa3f4c74d1c4a8e9395c956d
MD5 80d79c9736ed463ecf664477e3529ca9
BLAKE2b-256 9a493fef05af971335443b99d3a89b03c83ac452847f60c612ee8afff3a3618e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.3-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 b204430820e88814b6c872b4ae87635b61eb092bbea7f286943de927256f42e1
MD5 c67c21e77ec591e1cea2b68a97390d33
BLAKE2b-256 1c33f39772c3fbf44230acbc585f991297661fa460a85a4e87e761fbf3b1450e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 809cd4cd0bd7e89291d24ded4d64922f9b9964071c0ac9c9ed64c934581df1f9
MD5 cd9a890b8ad6286ac048a773de39132e
BLAKE2b-256 4bbecad0bceaa3f23afd5679651ddf12ef6cc1d18e96b040ace8439cfeb1e081

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 454379f4be3efb8cc5240560e14346d9d9d24319f8b47d1252b2d2a0ea68c789
MD5 1813a2c9b8825c30d0594b2a6aef4c0d
BLAKE2b-256 6753383904601f77cab2ab07c1640c2b743ee29fb6ec1cfbc2a267da9fc73038

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4fd92513e3a8d676f2d049e10e17261162ec885039d7f9d6ef89866cd6cf255b
MD5 0bdd35f3ec28a1c1c05008ba824e17b1
BLAKE2b-256 24d838082e3b82946ae7dc69cfa6f0370bf13e4c016d012b615eb8435fc71ec3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.3-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 08e8cb35a191dfa6200ef4f7b507e9da75198c13ca23dca992e233f3249df9dc
MD5 1d2f784712e599bde78efa6e6aee8ba0
BLAKE2b-256 5e16787d07cd8cf3414808689d40fb65988a43bde81f93411f493c9b04d3974d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.3-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 905b0d4ed5e9abdf689d56cab452343cbec607176144bed57848d18125c93d5e
MD5 90b60dc823dbe9e62abc4052d18cfd3b
BLAKE2b-256 2f0a24c0011de0ac19a932b0357196b2163d1792b1460d73ce6b1b7e6711f46a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 41a5bb32aebca089d415cb1cc579ce9c327ee862852718907d259051bb5c5346
MD5 da6a112027f39071491e0673ac732f92
BLAKE2b-256 f1426c58bc5249c7f53707c753c4073c588198f82392c2fb4369ee2d2c1d1d56

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9d9565d2caff71fc628ba38a54b38f01c99d3b726575fa5f5dc60cb34c72a93e
MD5 e74eb097f78c2f0da89f9d189706cbfe
BLAKE2b-256 a4e3ca4748bc6fca8cca8402bcbd807c52f595e176ac5cf78734e62430f5db45

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 622ed9a21b74830c7a1eb2e936029125437e0f5d5ea7cc4570243eb00db9fd0a
MD5 6b5667f79ec4960cd967e5e7e1f3c0d4
BLAKE2b-256 26db0906d84ffd57c9b5625316f9a3172bf3ea4de399b9472ab3bca2fdf47a7c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.4.3-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b5cb2ef32f054abe45557f9718ce3b98f0e6d87b593ca02172142975c25f1ebe
MD5 a46c7528151fcb5cef54da724462a978
BLAKE2b-256 ccd486167ae731fbceeb7bed6843cc88457f5528d510e7303a68a374f237634a

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