lujiaming-12138 / DuaLight

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Resources for "DuaLight: Enhancing Traffic Signal Control by Leveraging Scenario-Specific and Scenario-Shared Knowledge"

This page give the code, data, scenarios, and demo results for our paper submission.

Our code mainly base on CoLight

Demo Results for the Whole Scenario (Macro-Level)

The result for Nanshan Scenario:

Demo of Grid 4x4 Scenario

The result for Ingolstadt21 Scenario:

Demo of Grid 4x4 Scenario

The result for Grid 5x5 Scenario:

Demo of Grid 4x4 Scenario

The result for Grid 4x4 Scenario:

Demo of Grid 4x4 Scenario

The result for Arterial 4x4 Scenario:

Demo of Arterial 4x4 Scenario

The result for Cologne8 Scenario:

Demo of Cologne Scenario

The result for Fenglin Scenario:

Demo of Fenglin Scenario

Scenarios introduction

There are seven scenarios in the dir: sumo_files/env/.

Open source scenarios

There are four open-source scenarios: Grid4x4, Arterials4x4, Cologne8, and Ingolstadt21. And the Grid 5×5 is designed by us, following the same setting of Grid 4×4. All of them are shown in Fig1 and Fig2.

The scenarios of Fig1.(a) Grid 4×4, Fig1.(b) Grid 5×5, with all the intersections signaled and each entering approach having three lanes with movements of left, through, and right, respectively; Fig1.(c) Arterial 4×4, with all the intersections signaled, E & W entering approaches having two lanes with movements of left and right-through, as N & W entering approaches having one lane with the movement of left-through-right. (The blue strips indicate the locations of 50-meter detectors.)

Fig 1.

The scenarios of Fig2.(a) Ingolstadt 21, Fig2.(b) Cologne 8, with the signaled intersections highlighted and three intersections zoomed for demonstration.

Fig 2

Two real-word scenarios

To build more realistic scenarios, we manually construct the Nanshan scenario based on Nanshan district in Shenzhen, China and Fenglin scenario based on Fenglin corridor in Shaoxin, China. All of them are shown in Fig3 and Fig4. In particular, the traffic flow of the Fenglin scene is generated based on the real traffic flow, as shown in Fig4.(c).

Fig 3

Fig 4

How to use

First, you need to install sumo and python=3.6 or install it from requirement.txt, and then you need to set SUMO_HOME in the environment variable. For example, if sumo is installed from requirement.txt, the env should be setted like:

export SUMO_HOME=/your python env path/lib/python3.6/site-packages/sumo

Second, export PYTHONPATH to the root directory of this folder. That is

export PYTHONPATH=${PYTHONPATH}:/your own folder/root directory of this folder

Third, unzip resco scenarios' files:

  • unzip sumo_files/scenarios/resco_envs/grid4x4/grip4x4.zip to sumo_files/scenarios/resco_envs/grid4x4.

    cd ./sumo_files/scenarios/resco_envs/grid4x4/
    unzip grid4x4.zip
  • unzip sumo_files/scenarios/resco_envs/arterial4x4/arterial4x4.zip to sumo_files/scenarios/resco_envs/arterial4x4.

    cd ./sumo_files/scenarios/resco_envs/arterial4x4/
    unzip arterial4x4.zip

Final:

  • Model training
python tsc/base_agents/dualight/run_sumo_dualight.py
  • Eval
python tsc/eval_metric.py

Now you may find some results in the dir: sumo_logs

About


Languages

Language:Python 99.8%Language:Shell 0.1%Language:Dockerfile 0.1%Language:Batchfile 0.0%