Skip to main content

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

Project description

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.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sumo_gym-0.3.0.tar.gz (28.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sumo_gym-0.3.0-py3-none-any.whl (30.5 kB view details)

Uploaded Python 3

File details

Details for the file sumo_gym-0.3.0.tar.gz.

File metadata

  • Download URL: sumo_gym-0.3.0.tar.gz
  • Upload date:
  • Size: 28.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for sumo_gym-0.3.0.tar.gz
Algorithm Hash digest
SHA256 948a7e393a674c64e5d3bd07c29983c2877accb67776990c16f206c1a2a9f652
MD5 cccd589837a83d3963340e56a3099e19
BLAKE2b-256 f1f5e5a82cb9dd723247d941075934d18c9f85e180b43f4e6b10fe66b9934eff

See more details on using hashes here.

File details

Details for the file sumo_gym-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: sumo_gym-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 30.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for sumo_gym-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 00fcf5b7a6798c68a1e97e544015011b59b8ee77079e521239290357abbcd9d3
MD5 40ba7b48ee3f39289b0296ed60df33f2
BLAKE2b-256 34bf15e8513ca21249883a3e426a16e6a482bdbf20d1e306c8f6f3f369dcc95c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page