Genetic Programming as An Explainable Alternative to Reinforcement Learning for Traffic Signal Control
This is a example code for paper GPLight "Learning Traffic Signal Control via Genetic Programming"
and paper GPLight+ "GPLight+: A Genetic Programming Method for Learning Symmetric Traffic Signal Control Policy"
Evolving explainable policies using genetic programming, rather than learning non-transparent neural policies via deep reinforcement learning.
The testing platform for the algorithm is CityFlow and
GPLight(+) is adapted as an intelligent agent in LibSignal.
This project does not have complex third-party dependencies!
Please execute the following command to install and configure our environment.
git clone https://github.com/Rabbytr/gplight.gitIf you don't have Git on your computer, you can download the zip file directly.
You can use pip to directly install the following dependencies.
pip install -r requirements.txtdeap==1.4.1
numpy==2.0.0
libsumo==1.20.0
gym==0.26.2
pyyaml==6.0.1
pathos==0.3.2
To install CityFlow simulator:
To ensure that CityFlow installs successfully, please make sure that CMake is installed on your computer and C++ can be compiled on your computer
git clone https://github.com/cityflow-project/CityFlow.git
cd CityFlow
pip install -e .The pybind11 in source code of CityFlow is unfortunately a static version. If you encounter installation errors, you may consider upgrading the pybind11 version included in CityFlow.
After installing the dependencies mentioned above, you can directly run GPLight.
python run_gplight.py --gplightYou can also run GPLight+ using the same file
python run_gplight.py --gplight_plusTo quickly get feedback on running and keep you from getting bored 😂, the parameters set in run_gplight.py are relatively small.
Once the code runs correctly, please set appropriate parameters or those recommended in the paper.
If you encounter any difficulty using our code, please do not hesitate to submit an issue or directly contact us! If you find our work helpful (or if you are so kind as to offer us some encouragement), please consider giving us a star, and citing our paper.
@misc{liao2024learningtsc,
title={Learning Traffic Signal Control via Genetic Programming},
author={Xiao-Cheng Liao and Yi Mei and Mengjie Zhang},
year={2024},
eprint={2403.17328},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://arxiv.org/abs/2403.17328},
}
@article{liao2025gplightplus,
title={GPLight+: A Genetic Programming Method for Learning Symmetric Traffic Signal Control Policy},
author={Liao, Xiao-Cheng and Mei, Yi and Mengjie Zhang},
journal={IEEE Transactions on Evolutionary Computation},
year={2025},
publisher={IEEE},
url = {https://doi.org/10.1109/TEVC.2025.3578575}
}
