CityFlowER is An Efficient and Realistic Traffic Simulator Platform with Embedded Machine Learning Models. It Can Support Multi-agent Reinforcement Learning for Various Traffic Analysis and Control Tasks.
Framework and comparison to other implementations:
This simulator introduces following features:
- Realistic A microscopic traffic simulator which simulates the behavior of each vehicle. Any individual vehicle can be controlled by one or multiple behavior models to mimic the realistic driving scenario.
- Efficient The embedded structure's simulation speed is much faster than API based implementation, and approximating the rule based control methods.
- Large Scale CityFlowER support large scale simulation efficiently.
-
Simple config setting for loaded models. You could find the following implementation in
src/vehicle/vehicle.cpp
orsrc/vehicle/lanechange.cpp
The code blocks to import rule based file is shown below: We also provide training example inImitate_cityflow/*
, please check it out for example of training:// vehicleInfo is updated out of the function // "PATH" is the pre-trained model path double Vehicle::getCarFollowSpeed(double interval) { Vehicle *leader = getLeader(); std::vector<torch::jit::IValue> input_feature; auto input = torch::tensor ({leader->getSpeed(), vehicleInfo.speed ...}); input_feature.push_back(input); static torch::jit::script::Module speedModel = torch::jit::load("PATH"); at::Tensor output_speed = speedModel.forward(input_feature).toTensor(); return output_speed.item<double>(); }
void SimpleLaneChange::makeSignal(double interval) { std::vector<torch::jit::IValue> input_feature; auto input = torch::tensor ({vehicle->engine->getCurrentTime(),...}); input_feature.push_back(input); static torch::jit::script::Module laneModel = torch::jit::load("PATH"); at::Tensor lane_choice = laneModel.forward(input_feature).toTensor(); signalSend->target = lane_choice; }
For large scale vehicle settings, you could also define
control_config.xml
and mapping thevehicle_id
with assignedML models
intended to use.In next updated version, we will provide this detailed instructions for the defination of
control_config.xml
.
- Basic Platform Code
- Integration with LibTorch
- Functionality Release
- Car Following Speed Model
- Lane Changing Model
- Install & Deployment guideline
- Pre-trained model release
- PressLight: Learning Max Pressure Control to Coordinate Traffic Signals in Arterial Network (KDD 2019)
- CoLight: Learning Network-level Cooperation for Traffic Signal Control
- Traffic Signal Control Benchmark
- TSCC2050: A Traffic Signal Control Game by Tianrang Intelligence (in Chinese) Tianrang Intelligence home page
@inproceedings{da2024cityflower,
title={CityFlowER: An Efficient and Realistic Traffic Simulator with Embedded Machine Learning Models},
author={Da, Longchao and Chu, Chen and Zhang, Weinan and Wei, Hua},
booktitle={Joint European Conference on Machine Learning and Knowledge Discovery in Databases},
pages={368--373},
year={2024},
organization={Springer}
}