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
There are seven scenarios in the dir: sumo_files/env/.
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 2To 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 4First, 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