Smart City Road is a game environment for multi-agent reinforcement learning. The environment simulates the movement of cars in conditions of dense traffic flow with the separation of agents into cooperators and defectors.
git clone https://github.com/egormorgunov/smart_city_road.git
cd smart_city_road
pip install -e .
- Single-agent version with 8 cooperative agents and 1 defector agent (see Single-agent version)
- Single-agent version with 8 cooperative agents and 2 defector agents (see Multi-agent version)
Full environment documentation is given in the following 🚕 file 🚕
To test the Smart City Road environment use files "test.py ", which are contained in folders with each of the environment versions (for a single-agent environment, the file is here, for a multi-agent environment - here).
from Env_Single_agent import SmartCityRoad
import random
env = SmartCityRoad()
if __name__ == '__main__':
episode = 5
max_steps = 100
for e in range(episode):
for i in range(max_steps):
action = random.randint(0, 4)
reward, next_state, done = env.step(action)