Git Product home page Git Product logo

sumo-gym's Introduction

SUMO-gym

Actions Status pre-commit.ci status Code style: black All Contributors

OpenAI-gym like toolkit for developing and comparing reinforcement learning algorithms on SUMO.

This repo provides the source codes for "SMART-eFlo: An Integrated SUMO-Gym Framework for Multi-Agent Reinforcement Learning in Electric Fleet Management Problem". Please cite it if you find it helpful.

@INPROCEEDINGS{9922047,
  author={Liu, Shuo and Wang, Yunhao and Chen, Xu and Fu, Yongjie and Di, Xuan},
  booktitle={2022 IEEE 25th International Conference on Intelligent Transportation Systems (ITSC)}, 
  title={SMART-eFlo: An Integrated SUMO-Gym Framework for Multi-Agent Reinforcement Learning in Electric Fleet Management Problem}, 
  year={2022},
  volume={},
  number={},
  pages={3026-3031},
  doi={10.1109/ITSC55140.2022.9922047}}

Installation

Install SUMO, SUMO GUI and XQuartz according to official guide.

$ python3 -m venv .env
$ source .env/bin/activate
(.env)$ pip install -r requirements.txt
(.env)$ pip install sumo-gym
(.env)$ export SUMO_HOME=<your_path_to>/sumo SUMO_GUI_PATH=<your_path_to>/sumo-gui # and copy the paths to ~/.bashrc

The installation is successful so far, then you can try the examples in the tutorials, for example:

(.env)$ python3 tutorials/fmp-jumbo.py --render 0

Features

SUMO-gym aims to build an interface between SUMO and Reinforcement Learning. With this toolkit, you will be able to convert the data generated from SUMO simulator into RL training setting like OpenAI-gym.

Remarkable features include:

  1. OpenAI-gym RL training environment based on SUMO.
import gym
from sumo_gym.envs.fmp import FMP

env = gym.make(
    "FMP-v0", mode, n_vertex, n_edge, n_vehicle, 
    n_electric_vehicles, n_charging_station, 
    vertices, demand, edges, 
    electric_vehicles, departures, charging_stations,
)
for _ in range(n_episode):
    obs = env.reset()
    for t in range(n_timestamp):
        action = env.action_space.sample()
        obs, reward, done, info = env.step(action)
        if done:
            break
env.close()
  1. Rendering tools based on matplotlib for urban mobility problems.

  1. Visualization tools that plot the statistics for each observation.

Contributors

We would like to acknowledge the contributors that made this project possible (emoji key):


N!no

๐Ÿ’ป ๐Ÿ› ๐Ÿค”

yunhaow

๐Ÿ’ป ๐Ÿ› ๐Ÿค”

Sam Fieldman

๐Ÿ› ๐Ÿค”

Lauren Hong

๐Ÿ’ป

nmauskar

๐Ÿ’ป

This project follows the all-contributors specification.

sumo-gym's People

Contributors

lovelybuggies avatar wyunhao avatar allcontributors[bot] avatar pre-commit-ci[bot] avatar qqqube avatar alwayssearching avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.