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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.12 Windows x86-64

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

Uploaded CPython 3.11 Windows x86-64

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

Uploaded CPython 3.10 Windows x86-64

laser_learning_environment-1.5.2-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.2-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.2-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.2-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.2.tar.gz.

File metadata

File hashes

Hashes for laser_learning_environment-1.5.2.tar.gz
Algorithm Hash digest
SHA256 aa7ae9ae60277a622e897d07a9f1e42bcffe9a8875ba767bb829c34e6d8e50ad
MD5 dd7e9f0628193041d2eb01ede1b5dfb0
BLAKE2b-256 5418cc9b976b5bd7b9d6611f06e223cfa234a9c7cea0034e851926f8b7265194

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6268ea7bec541de9f7ea214dc06605af7688c94ff417869d1b15846426930ebe
MD5 4ad9c64eb597e0bb7cc7a9b756ed1750
BLAKE2b-256 b6c4802f09fcc5628173d7e4e7b7a7380a86a334db8b8f95b36410d3d3ae7275

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0f99d49313250d27bfca3f13ae27634db548ef3b5135eca51a60e884b026082d
MD5 bbdf3d52f8430cbf3f0b7e035dd8b884
BLAKE2b-256 7f2d17b23ed0fe94a36fc5d8e27e81b54b1edee85afce3caeda6b926390050d5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.2-cp312-none-win_amd64.whl
Algorithm Hash digest
SHA256 94eb57aab4ee6285015f3d3d0972aafc14beb4de8ad5ca7cf3ba2a4e18d07bbb
MD5 947febe08fd743ff8079ff0dc70c8aeb
BLAKE2b-256 2bb49914c3ee4280f91d88fd4d7d5d35956206e77257fbcdcd8b65f0d0488c80

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 832bc92084fe2e2444ef5c12c315a3efe024d5260750d1c5bc0250f1dcad5e4a
MD5 c47afa35638918a8d61d7763d139e977
BLAKE2b-256 155e0c2363b3ffaf51d05bdc4c39eec360453f8f8f516a249aebd3776ead2ced

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2d1caa73c80e8c7b68e8176507a051ffb2056da153dd377770846051b04c28d8
MD5 fa34cd2ebec6dff054c653cb78fe072e
BLAKE2b-256 3a3a7d2f151d0b34ae8e55fd79327b1d07a1bba1b661d772b89266d5dcb9c382

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7218daa228768a8ed3cd93577c88af3d507b0997a4b87440f9716905f7043a42
MD5 1c6d8b6c476f8f840004adc2e8417ac2
BLAKE2b-256 990d481f3c9877b3ee80e94a1c7b274e47e141aa2b6c1f44115c7109c055eab7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.2-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c6d401607a4171820233db173abebfff9cf8bb1d39898a7c0dc85f9e2647e077
MD5 d53f4db0b3e0f1ac1c14d64017259265
BLAKE2b-256 5cba9d0556e07f764b76d4408164dc356dbe1c15ffdc33cfbde3928925935edc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.2-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 42f47691e34236b37de7c95a21a9a683e12bef987402fd836ec22644d09a54f5
MD5 f66cbd4a59aa49d06dcd13181c0b1dcd
BLAKE2b-256 0afecd489b4b66d5cfb716f791202ceb3b7a2a5392b69164a97505a9019675d4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 195f6ce37ce19e6e25498d06a6de8ba297ba13f03b49b2777fddcb1a44eff88a
MD5 5225bed29a183336ed8287cefcce667c
BLAKE2b-256 9cc492e67c79b59240df46940c5918563e1aea307c9958cda261cc95bd0b1cb1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 957c6591cddb48b5f0c5caeafc21a9abc466822f9c2413386f42f945af2daa73
MD5 bf03e77d848c20c6988e1657577745d6
BLAKE2b-256 591bf4ba510ea8611f909b0d8da2df50e7d73b5587b9d04f0f09c36f2ba54297

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8db10af3ba0f4fa6daff719effeda446888817b776d1d9060caff1eb86972aa8
MD5 4e8953acea73d0df1a17b7115307a71c
BLAKE2b-256 477053685bab31d805daf1d25286d9d8c20375c6d0d871c58e213aa5edbc3094

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.2-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4d4171a00b35680ecf556259a37f56007b67ed7c9b4da70a3233f61e22968bf9
MD5 cff72165f7fa12593166080cb7a5e81b
BLAKE2b-256 7f93fa0977f526e3cef6489c2a77b7a539bb87b22e0706809bb5e3119cb67a97

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.2-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 032d4e5cdde6a619046e72b4090ce882dbfe559ef74f9582321c4cba5a6c72fd
MD5 3d10077053ac88b9b347350d8cf00358
BLAKE2b-256 374807500252abff2a65fb7695ef640380771fc7606d741aa0aaa4eb5f024911

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8c5c266919c18634b274d38dfb130212e7affbf418faa14a37a5fe0ce0f445a6
MD5 14d7122102c7aef7591dc429803d0017
BLAKE2b-256 39041a486659e54b56fddc2973fb941bef9ace16a88a6f42db18ce37ec1fa902

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6f4218008134ce02ece8823252c2af80cd426548f11e794ba95e85c44fa8095c
MD5 d1b21cdda4aebdf59c1e0a4c0e294ecb
BLAKE2b-256 3599f3eea17fbed1eacfb1da6feadc300983438b2508710534787bd3824302e6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ff547f141e15af0eb5e5371d2ef752bd74ba019e80a3360ac73427ab8ab30ee4
MD5 75b7eeaf1ebe6303231dcdcf463e5045
BLAKE2b-256 0e5ef93411b261a5c62a29a6de6167c7fc63257a2ea7547c6ea59223493622df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laser_learning_environment-1.5.2-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 3288b1de5206f4d4a6733dcd803958a03272862d36f30af7e87ec8084d6e95c9
MD5 a7b16b52e7b15bf0a5f563d2ae9c2ff1
BLAKE2b-256 75359806f69e2485176b509c0a6626f913049a4277c7334f81ea70c5efbf80ae

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