Skip to content

🎮 Toy environment set for multi-agent reinforcement learning and more

License

Notifications You must be signed in to change notification settings

MehdiZouitine/gym_ma_toy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Toy Multi agent environment

ma_gym_logo

Start of a toy gym environment bank for multi-agent reinforcement learning.

This repo contains for the moment a first environment:

How to install ?

git clone https://github.com/MehdiZouitine/gym_ma_toy
cd gym_ma_toy
pip install -e .

How to use it ?

import gym
import gym_ma_toy

env = gym.make('team_catcher-v0')

obs = env.reset()
done = False
while not done:
    env.render(mode='rgb_array')
    
    action = env.action_space.sample()
    obs, reward, done, info = env.step(action)
env.close()

Team catcher:

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.

ma_gym_logo

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.

ma_gym_logo

ma_gym_logo

- **V1**: Some targets do not move (ORANGE) but some can move randomly (RED).
  • V2: Some agents move horizontally/vertically (BLUE), other move diagonally (GREEN)

ma_gym_logo

- **V3**: **Partially observable** (fog of war like) environment with some agents move horizontally/vertically (BLUE), other move diagonally (GREEN)

ma_gym_logo

Running multiple environment in parallel

# Running 8 environment in parallel
import gym
import gym_ma_toy

env = gym.vector.make('team_catcher-v0',num_envs=8, asynchronous=True)  

Test

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},
}

License

This project is free and open-source software licensed under the MIT license.

About

🎮 Toy environment set for multi-agent reinforcement learning and more

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages