Adaptive traffic-light control using multi-agent Dueling Double-DQN with SUMO + TensorFlow.
Each traffic light runs an independent DQN agent that learns optimal signal phases through interaction with the SUMO simulator. Includes training, evaluation, visualization, and automatic model saving.
traffic-dqn/
main.py # training entrypoint
config.py # hyperparameters
agents/ # DQN agent, dueling network, replay buffer
training/ # coordinator + evaluator
utils/ # logger + plotting
models/ # saved weights
logs/ # training/evaluation logs
plots/ # reward/loss graphs
sudo add-apt-repository ppa:sumo/stable
sudo apt-get update
sudo apt-get install sumo sumo-tools sumo-docSet SUMO_HOME according to your installation. (default sumo installation path is /usr/share/sumo)
echo 'export SUMO_HOME="/usr/share/sumo"' >> ~/.bashrc
source ~/.bashrcFor a performance boost with Libsumo(you will not be able to run with sumo-gui if this is active)
export LIBSUMO_AS_TRACI=1uv sync
source .venv/bin/activateuv run main.pyFor running GUI in parallel, update main.py
env = SumoEnvironment(
...
use_gui=True,
)Outputs:
models/— saved checkpointslogs/— training & evaluation logsplots/— reward/loss curves
