Skip to content

Master thesis Data Science BGSE - Reinforcement Learning applied to Transport

Notifications You must be signed in to change notification settings

thelastsinger/DDQN-for-traffic-control

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deep Reinforcement learning applied to transport networks

Master's thesis - BGSE Data Science
Authors: Monika Matyja, Sebastian Wolf and Jordi Morera
Supervisors: Hrvoje Stojic and Anestis Papanikolaou

Thesis description

We develop a traffic light control agent that can manage traffic lights with the objective to reduce traffic jams, trip time and other traffic metrics in a given network using reinforcement learning. To this end, we implement a Double Deep Q-Network algorithm and test its performance in controlling traffic lights on a ’small’ and a ’large’ traffic junction. We find that this algorithm beats a fixed traffic light phase program when traffic demand fluctuates, as it is capable of reacting to real-time traffic situations. The algorithm can be scaled up and holds promise to also perform well in controlling larger transport networks. For more information check the report.

Guide for folders:

  • Scripts: Any script is needed to run the simulation. Also a couple of examples of how to run the code
  • Report
  • Videos: Recordings of an evaluation episode in split screen: DDQN agent vs benchmark policy

Installation guide

Option 1

Run setup.sh

bash setup.sh

Option 2

Install sumo binaries

sudo apt-get install sumo sumo-tools sumo-doc

Set SUMO_HOME variable (default sumo installation path is /usr/share/sumo)

echo 'export SUMO_HOME="/usr/share/sumo"' >> ~/.bashrc
source ~/.bashrc

Installing required packages

pip3 install numpy tensorflow keras

Option 3

Pull Docker image

docker pull sebxwolf/sumo

Run Docker container

docker run -d -p 5901:5901 -p 6901:6901 -p 8888:8888 sebxwolf/sumo

In your browser, open: http://localhost:6901/?password=vncpassword

In the Desktop that opens, go to Applications and open Terminal Emulator

In the Terminal Emulator that opens, run

jupyter notebook --NotebookApp.token=admin --ip 0.0.0.0 --allow-root

In your browser, open localhost:8888/tree

The password is 'admin' and you can run all your notebooks and tutorials

(based on lucasfischerberkeley/flowdesktop)

Running tensorboard

In terminal, run:

tensorboard --logdir ./Scripts/Tests_Sumo/cross_RL/Logs/[name of experiment]

Then open a browser and enter:

http://localhost:6006/

About

Master thesis Data Science BGSE - Reinforcement Learning applied to Transport

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 75.8%
  • Python 24.1%
  • Shell 0.1%