Git Product home page Git Product logo

reinforcement-learning-sumo's Introduction

Reinforcement Learning + SUMO

Applying reinforcement learning to traffic microsimulation (SUMO)

A minimal example is available in the example folder

Very much a WIP

Structure

This project follows the structure of FLOW closely. I only chose to diverge from FLOW because it abstracted the XML creation for SUMO. For me, this repository plugs in to a greater code-base, that turns real-world ITS data into SUMO traffic demand and traffic light operation. Those tools work ultimately by writing to SUMO XML files, and we didn't want to convert to the FLOW pythonic framework.

Results

Full breakdown: https://maxschrader.io/reinforcement-learning-and-sumo

video on Youtube

ES vs. PPO

RL-Controlled Traffic Signals vs. Calibrated Real-World Simulation

Real World Traffic Signals during Simulation Period

RL-Controlled Traffic Signals during Simulation Period

reinforcement-learning-sumo's People

Contributors

mschrader15 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

reinforcement-learning-sumo's Issues

requirements.txt

Hello

I only run your models with python==3.8 and ray==1.11.0
Please update them in requirements.txt

After 1 day of training, my computer was out of memory with ray so I coud not have final resutls
The configurations of my PC: i9, ram=32gb

ImportError: cannot import name 'get_parameters' from 'rl_sumo.helpers.utils' (/media/ubuntu/diskB/reinforcement-learning-sumo/rl_sumo/helpers/utils.py)

(app39-dev) ubuntu@ubuntu-H8QG6:/media/ubuntu/diskB/reinforcement-learning-sumo$ python train.py

Traceback (most recent call last):
File "/media/ubuntu/diskB/reinforcement-learning-sumo/train.py", line 7, in
from rl_sumo.helpers.preprocessing import execute_preprocessing_tasks
File "/media/ubuntu/diskB/reinforcement-learning-sumo/rl_sumo/helpers/preprocessing.py", line 2, in
import json5 as json
ModuleNotFoundError: No module named 'json5'
(app39-dev) ubuntu@ubuntu-H8QG6:/media/ubuntu/diskB/reinforcement-learning-sumo$ pip install json5
Collecting json5
Downloading json5-0.9.8.tar.gz (22 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: json5
Building wheel for json5 (setup.py) ... done
Created wheel for json5: filename=json5-0.9.8-py2.py3-none-any.whl size=18604 sha256=f121186c35cfd4acedd7579d7a17e6d0c4433f4dd724e99f4307f500dc3e15af
Stored in directory: /home/ubuntu/.cache/pip/wheels/33/13/22/d6429949983cbc014ae883a13af8b3ce949adcc4cf9196a4b9
Successfully built json5
Installing collected packages: json5
Successfully installed json5-0.9.8
(app39-dev) ubuntu@ubuntu-H8QG6:/media/ubuntu/diskB/reinforcement-learning-sumo$ python train.py

Traceback (most recent call last):
File "/media/ubuntu/diskB/reinforcement-learning-sumo/train.py", line 8, in
from rl_sumo.helpers.utils import get_parameters
ImportError: cannot import name 'get_parameters' from 'rl_sumo.helpers.utils' (/media/ubuntu/diskB/reinforcement-learning-sumo/rl_sumo/helpers/utils.py)

TypeError: Cannot instantiate typing.Union

may i know is that a bug or python version incompatible?

(app39-dev) ubuntu@ubuntu-H8QG6:/media/ubuntu/diskB/reinforcement-learning-sumo$ which python
/home/ubuntu/.pyenv/shims/python
(app39-dev) ubuntu@ubuntu-H8QG6:/media/ubuntu/diskB/reinforcement-learning-sumo$ python --version
Python 3.9.13+
(app39-dev) ubuntu@ubuntu-H8QG6:/media/ubuntu/diskB/reinforcement-learning-sumo$ python train.py

Traceback (most recent call last):
File "/media/ubuntu/diskB/reinforcement-learning-sumo/train.py", line 6, in
from rl_sumo.helpers.register_environment import make_create_env
File "/media/ubuntu/diskB/reinforcement-learning-sumo/rl_sumo/helpers/register_environment.py", line 6, in
def make_create_env(env_params, sim_params, version=0) -> Union(str, object):
File "/home/ubuntu/.pyenv/versions/3.9-dev/lib/python3.9/typing.py", line 344, in call
raise TypeError(f"Cannot instantiate {self!r}")
TypeError: Cannot instantiate typing.Union

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.