Skip to main content

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.

Metadata

Release files for sumo-gym 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sumo-gym 0.5.0
File Size Uploaded
sumo_gym-0.5.0.tar.gz 28.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sumo-gym 0.5.0
File Interpreter ABI Platform
sumo_gym-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 58.2 kB

Release files / sumo_gym-0.5.0.tar.gz

Download URL sumo_gym-0.5.0.tar.gz
Size 28.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b6976e15cfee17f439ef5c3ec58e4c5cbdfedc6ce8b8730820a530c036e49723
BLAKE2b-256 checksum
How to use checksums
98f759052a71586a2b1fe4535b70494613cf88a8b28412686b51531c203ff77d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

Release files / sumo_gym-0.5.0-py3-none-any.whl

Download URL sumo_gym-0.5.0-py3-none-any.whl
Size 29.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a2174445c998c0ddc8209cea899554d809d4fdbbaaaa161f822eff7db97b8589
BLAKE2b-256 checksum
How to use checksums
c5cebbbd55244352a6d50f9e89505e29d215993dfb7797d56ec8c3340b5d3775
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page