This repo contains for the moment a first environment:
git clone https://github.com/MehdiZouitine/gym_ma_toy
cd gym_ma_toy
pip install -e .
import gymnasium as gym
import gym_ma_toy
env = gym.make('team_catcher-v0')
obs, info = env.reset()
done = False
truncated = False
while not done or not truncated:
env.render(mode='rgb_array')
action = env.action_space.sample()
obs, reward, truncated, done, info = env.step(action)
env.close()
This is a map where targets are randomly placed. Some targets do not move , other move randomly (one square at the time). Agents must capture all targets. Targets are captures when there are at least two agents on an adjacent cell of a target. The environement gives a reward point for each captured target. The episode ends when there is no more target on the map. The number of agents and targets can be arbitrarily large.
There are currently 3 implemented versions:- V0: This is the simplest environment. Targets (RED) do not move and agents (BLUE) can only move horizontally and vertically.
- V2: Some agents move horizontally/vertically (BLUE), other move diagonally (GREEN)
# Running 8 environment in parallel
import gymnasium as gym
import gym_ma_toy
env = gym.vector.make('team_catcher-v0',num_envs=8, asynchronous=True)
pytest test/
Cite the environment as:
@misc{amarl2020
Author = {Mehdi Zouitine, Adil Zouitine, Ahmad Berjaoui},
Title = {Toy environment set for multi-agent reinforcement learning and more},
Year = {2020},
}
This project is free and open-source software licensed under the MIT license.