DeTraffic is a multi-agent deep reinforcement learning model to de-traffic our lives.
You have to install SUMO beforehand.
sudo add-apt-repository ppa:sumo/stable
sudo apt-get update
sudo apt-get install sumo sumo-tools sumo-doc
Don't forget to set SUMO_HOME variable (default sumo installation path is /usr/share/sumo)
echo 'export SUMO_HOME="/usr/share/sumo"' >> ~/.bashrc
source ~/.bashrc
Important: for a huge performance boost (~8x) with Libsumo, you can declare the variable:
export LIBSUMO_AS_TRACI=1
Notice that you will not be able to run with sumo-gui or with multiple simulations in parallel if this is active (more details).
If you do not have poetry
installed:
pip install poetry
For testing:
poetry install --without-dev # for newer versions of poetry
poetry install --no-dev # for older versions of poetry
For development purposes:
poetry install
And then you can dive into the environment with:
poetry shell
After the installation, there are several steps to follow for development.
pre-commit install
You can check predefined experiments at experiments
and models at models
, or define your own experiments or models.
poetry shell
python detraffic/benchmark.py
This repository contains code from PyTorch Reinforcement Learning (DQN) Tutorial and efficient-kan. Also containts SUMO installation steps from sumo-rl.