CBLab: Scalable Traffic Simulation with Enriched Data Supporting

Chumeng Liang, Zherui Huang, Yicheng Liu, Zhanyu Liu, Guanjie Zheng, Hanyuan Shi, Yuhao Du, Fuliang Li, Zhenhui Li

TL;DR

CBLab is an open-source, city-scale traffic simulation platform designed to bridge the gap between microscopic traffic modeling and real-world urban policy optimization. By pairing CBEngine (a highly parallelized simulator capable of running 100,000 vehicles across 10,000 intersections faster than real-time) with CBData (a 100-city OpenStreetMap dataset pipeline) and CBScenario (an RL benchmark suite), CBLab enables reinforcement learning algorithms to train on realistic, full-scale urban road networks.

What Problem Does This Paper Address?

Reinforcement learning (RL) has shown great promise in optimizing urban traffic policies—such as dynamic traffic signal timing and congestion tolling. However, real-world trial-and-error is infeasible because exploring suboptimal policies can cause massive gridlock. Researchers rely on microscopic traffic simulators (e.g., SUMO, CityFlow), but these existing tools face two critical bottlenecks:

  1. Poor Scalability and Efficiency: Most simulators hit performance walls or suffer deadlock issues when scaled beyond a few dozen intersections. Simulating thousands of intersections and hundreds of thousands of vehicles in feasible time has remained out of reach.
  2. Scarcity of City-Scale Simulation Data: Setting up road networks and realistic vehicle demand requires painstaking manual configuration. Consequently, most literature tests algorithms on tiny, synthetic toy grids (e.g., $4 \times 4$ intersections) that fail to reflect the topology or traffic dynamics of real cities.

Methods

CBLab addresses these bottlenecks through three integrated components:

  • CBEngine (Scalable Microscopic Simulator):
  • Unified Parallel Execution: Typical simulators compute vehicle updates in two serialized parallel passes—first collecting vehicle status, then calculating actions. CBEngine consolidates both into a single parallelized Compute() pass per thread. By binding temporary state data directly to the thread rather than individual vehicles, CBEngine dramatically cuts memory overhead and CPU cache misses.
  • Deadlock Prevention: Instead of micro-simulating vehicle conflicts inside the intersection nexus (which frequently causes artificial deadlocks in SUMO and CityFlow at high loads), CBEngine models intersection passage using parameterized holding times.
  • Modular Vehicle Models: Driving (Krauß car-following model with lane-changing) and routing models are implemented as independent, hot-swappable C++ classes.
  • CBData (Data Ingestion & Calibration Pipeline):
  • Transforms raw OpenStreetMap (OSM) data into simulation-ready road networks with a one-click automated preprocessor (handling graph extraction, duplicate removal, and topology reduction).
  • Generates origin-destination vehicle flows and provides pipelines to calibrate driving parameters (via black-box Bayesian optimization using OpenBox) and route distributions (via RNN-based sequence models) against real-world GPS trajectory traces.
  • CBScenario (Benchmark & RL Environments):
  • Implements standardized Markov Decision Process (MDP) interfaces for two core tasks: Traffic Signal Control and Congestion Pricing.
Raw Traffic Data (OSM / GPS) 
           │
           ▼
     ┌───────────┐      Road Network & Flows     ┌────────────┐      Observation / State     ┌────────────┐
     │  CBData   │ ────────────────────────────> │  CBEngine  │ ───────────────────────────> │ CBScenario │
     └───────────┘                               └────────────┘ <─────────────────────────── └────────────┘
                                                        ▲               Action / Control            │
                                                        └───────────────────────────────────────────┘

Datasets

  • 100-City Road Network Dataset: Raw and processed road network graphs extracted from OpenStreetMap covering 100 major global cities (including Shanghai, Shenzhen, Hangzhou, and Manhattan).
  • Trajectory Data: GPS traces of 123,481 vehicles over one day in Shenzhen, China, used to calibrate car-following parameters and train RNN route generation.
  • Evaluation Benchmarks: Standard benchmarks adapted from open traffic repositories for real-world road networks in Hangzhou and Manhattan.

Key Insights and Ideas

  • Cache Locality Outweighs Micro-Parallel Stages: Traditional two-stage multithreading schedules updates globally across all agents. Fusing status collection and decision-making into a thread-local execution loop ensures that data loaded into the L1/L2 CPU cache for a vehicle is immediately reused to compute its next action, minimizing DRAM latency.
  • Simplifying Intersection Links Prevents Gridlock: Micro-tracking vehicle geometry inside busy junctions often triggers simulation deadlocks that halt long-running experiments. Replacing internal junction geometry with an abstract holding-time delay eliminates geometric deadlocks while preserving macroscopic flow fidelity.
  • Closing the Reality Gap with Off-the-Shelf Optimizers: Rather than manually tweaking car-following parameters (e.g., maximum acceleration, deceleration, speed limits), treating driving behavior calibration as a black-box optimization problem over observed GPS speeds allows quick adaptation to local driving styles.

Key Results

  • Simulation Speed: On a standard 40-core workstation, CBEngine runs a 1-hour simulation of 100,000 vehicles across 10,000 intersections in roughly 15 minutes (a 1:4 real-to-simulation time ratio).
  • Head-to-Head Benchmarks:
  • Across city networks (1,500 to 8,400+ intersections), CBEngine is 30%–40% faster than CityFlow and over 90% faster than SUMO.
  • On a massive network with $10^{4.5}$ (~31,600) intersections, CBEngine's single-step simulation took 0.267 seconds, compared to 1.034s for CityFlow and 9.183s for SUMO.
  • Under heavy traffic load, CBEngine successfully simulated 1,000,000 concurrent vehicles, whereas both SUMO and CityFlow crashed or failed to run.
  • Policy Benchmarks: In CBScenario, RL policies (such as DQN for signal control and EBGtoll for pricing) scaled gracefully to large networks, outperforming traditional transport baselines (MaxPressure, SOTL, FixedTime) in throughput and vehicle travel time.

Limitations and Future Work

  • Coarse Intersection Modeling: Abstracting intersection interiors into holding times prevents geometric gridlock, but it limits the ability to model complex within-junction maneuvers (e.g., unsignalized pedestrian conflicts or intricate turning geometry).
  • Data Coverage Gaps: While road graphs are provided for 100 cities, real GPS trajectory traces were only used to tune models in Shenzhen. Obtaining rich dynamic trajectory data across diverse global locations remains an ongoing challenge.
  • Scenario Breadth: The benchmark currently supports signal control and congestion pricing; the authors plan to expand to other policy tasks such as tidal lanes, vehicle restrictions, and connected-vehicle dispatching.

Summary updated

Abstract

Traffic simulation provides interactive data for the optimization of traffic policies. However, existing traffic simulators are limited by their lack of scalability and shortage in input data, which prevents them from generating interactive data from traffic simulation in the scenarios of real large-scale city road networks. In this paper, we present \textbf{C}ity \textbf{B}rain \textbf{Lab}, a toolkit for scalable traffic simulation. CBLab is consist of three components: CBEngine, CBData, and CBScenario. CBEngine is a highly efficient simulator supporting large-scale traffic simulation. CBData includes a traffic dataset with road network data of 100 cities all around the world. We also develop a pipeline to conduct a one-click transformation from raw road networks to input data of our traffic simulation. Combining CBEngine and CBData allows researchers to run scalable traffic simulations in the road network of real large-scale cities. Based on that, CBScenario implements an interactive environment and several baseline methods for two scenarios of traffic policies respectively, with which traffic policies adaptable for large-scale urban traffic can be trained and tuned. To the best of our knowledge, CBLab is the first infrastructure supporting traffic policy optimization in large-scale urban scenarios. The code is available on GitHub:~\url{https://github.com/CityBrainLab/CityBrainLab.git}.
BibTeX
@inproceedings{liang2022cblab,
  author = {Chumeng Liang and Zherui Huang and Yicheng Liu and Zhanyu Liu and Guanjie Zheng and Hanyuan Shi and Yuhao Du and FULIANG LI and Zhenhui Li},
  title = {{CBLab: Scalable Traffic Simulation with Enriched Data Supporting}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2022},
}
Figure