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.4.0.tar.gz (28.9 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.4.0-py3-none-any.whl (31.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sumo_gym-0.4.0.tar.gz
  • Upload date:
  • Size: 28.9 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.27.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for sumo_gym-0.4.0.tar.gz
Algorithm Hash digest
SHA256 543289fc86a8cac37af2cf6ffdfcdc3502568af8775c78a8446d7ad5c8b8f1b1
MD5 f97db6fde156226d724a1ca0a2b73b3d
BLAKE2b-256 fb9489957a4a92154a44bd8e41edba2c74a409b4ec6183c989df3dfed40af140

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sumo_gym-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 31.1 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.27.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for sumo_gym-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 089c3ee439298e21081276b671d62c979e4353f101a5ccf8c5fda2f4605fcde1
MD5 5aa9c921be98453a2575e304367b01ab
BLAKE2b-256 a921fea159b2e8da6b7a9c5ba805aea80dfbdb7afc5876f57f0f856fc9249800

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