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 --sumo-config-path assets/data/jumbo/jumbo.sumocfg

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", 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.2.0.tar.gz (27.7 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.2.0-py3-none-any.whl (29.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sumo_gym-0.2.0.tar.gz
  • Upload date:
  • Size: 27.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 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.2.0.tar.gz
Algorithm Hash digest
SHA256 88354aac3a1606ed5c7d051ddd2765b6b3e5388051e500d4391d48e30cfc6e63
MD5 92eb50fb7cad6816e2321288984a8ef9
BLAKE2b-256 a189174e899e9ec178bdabf7b1e9babef2006c4a958a8cf4f612e6d860f1e4dc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sumo_gym-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 29.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2c8ddcfe8f02f6728c69492bf1bc9ecc1fbb0a00d118c3b1c7db087952048859
MD5 0a643f7a3f2e582645e0371bae9a37d5
BLAKE2b-256 bdc6b53af926672adad707b1bb17b6fca4af46f73a366d147509f2b444ef4c44

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