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-docDon't forget to set SUMO_HOME variable (default sumo installation path is /usr/share/sumo)
echo 'export SUMO_HOME="/usr/share/sumo"' >> ~/.bashrc
source ~/.bashrcImportant: for a huge performance boost (~8x) with Libsumo, you can declare the variable:
export LIBSUMO_AS_TRACI=1Notice 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 poetryFor testing:
poetry install --without-dev # for newer versions of poetry
poetry install --no-dev # for older versions of poetryFor development purposes:
poetry installAnd then you can dive into the environment with:
poetry shellAfter the installation, there are several steps to follow for development.
pre-commit installYou can check predefined experiments at experiments and models at models, or define your own experiments or models.
poetry shell
python detraffic/benchmark.pyThis repository contains code from PyTorch Reinforcement Learning (DQN) Tutorial and efficient-kan. Also containts SUMO installation steps from sumo-rl.