🦩🌴 MARL-Neon-Grid
A collection of multi-agent reinforcement learning gridworlds to study coordination and cooperation that follows the Gymnasium interface. All agents are equipped with a 360 degree sensor to obtain a partial view of the world. We use ray casting and bresenham's algorithm to determine what the agents see.
Setup
Simply run:
pip install marl-neon-grid
Example
from marl_neon_grid import FoodNAgents
n_agents = 2
gw = FoodNAgents(n_agents=n_agents, n_food=8, max_steps=128, agents_must_coordinate=False)
for t in range(100): # simulate 100 episodes
observations = gw.reset()
dones = [False] * n_agents
while not all(dones):
gw.render() # render with pygame
# perform random actions
observations, rewards, dones, info = gw.step([gw.action_space.sample(),
gw.action_space.sample()])
# observations, rewards, dones are lists where each entry i belongs to agent i.
Environments
The following environments are available.
Closed Rooms
In each episode, goal fields on the left or the right of the upper room are randomly chosen. The goal for the upper agent is to navigate to one of these fields while the lower agent must navigate to the opposite side in the lower room. However, the agent in the lower room does not see the goal fields in its observation while the upper agent does. Reward is given to both agents as long as they both stay on their respective goal fields.
Doors n' Agents
Two agents are randomly placed in the environment in each episode. The environment terminates successfully when both doors are opened by the agents simultaneously.
Food n' Agents
I each episode a prespecified number of agents (n_agents=...) and number of foods (n_food=8) are randomly placed in the environment.
Agents receive reward for collecting food. When agents_must_coordinate is set to True, all agents must gather around a food source
and simultaneously perform the "collect food" action to obtain reward. Otherwise agents are able to collect food individually.
The environment terminates successfully when all foods are collected.
🚧 More environments are under construction ...
Metadata
Release files for Marl-Neon-Grid 0.1.4.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| Marl-Neon-Grid-0.1.4.5.tar.gz | 225.6 kB | Without provenance | Details for Marl-Neon-Grid-0.1.4.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| Marl_Neon_Grid-0.1.4.5-py3-none-any.whl | Python 3 | none | any | Details for Marl_Neon_Grid-0.1.4.5-py3-none-any.whl |
Total release size: 421.4 kB
Release files / Marl-Neon-Grid-0.1.4.5.tar.gz
| Download URL | Marl-Neon-Grid-0.1.4.5.tar.gz |
|---|---|
| Size | 225.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
327c8693b0c685848cd59c4f488c69c2708fc3844bfe4a5fea8088574554b239
|
|
BLAKE2b-256 checksum How to use checksums |
a6da7836a01668331ead6d25d9b66413f016ef2f6472708d3e85e269e53efcd5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / Marl_Neon_Grid-0.1.4.5-py3-none-any.whl
| Download URL | Marl_Neon_Grid-0.1.4.5-py3-none-any.whl |
|---|---|
| Size | 195.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d06b086e9a4fc5d6edb215652d870f133d89d48bc1c7c16295e4d1b0f4d95b8b
|
|
BLAKE2b-256 checksum How to use checksums |
0c7014fde377eb87fd636f49d1dda0ef7232f5b373386cdc01bd3ec9958539d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Security for Marl-Neon-Grid 0.1.4.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.