Skip to content

egormorgunov/smart_city_road

Repository files navigation

smart_city_road

DQN_singleEnvironment

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.

Installation

git clone https://github.com/egormorgunov/smart_city_road.git
cd smart_city_road
pip install -e .

Environment Versions

image

Environment Documentation

Full environment documentation is given in the following 🚕 file 🚕

Testing

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)