
KDD ’23, August 6–10, 2023, Long Beach, CA, USA Liang et al.
Raw Traffic Data Traffic Control
Policies
CBData CBEngine CBScenario
Input Data Observation
Action
Store Train
1 2
34
Deploy
CBLab
Simulator
Data Tool Environment
Figure 1: An overview of CBLab.
interact with. These simulators [
3
,
10
,
27
] simulate the microscopic
evolution of the urban trac. For each time step, they describe
the trac state, obtain a trac action from the decision made by
trac control policies and make it happen in the simulation. Trac
control policies can then learn from how the trac evolves under
certain actions and improve decision-making.
While existing trac simulators help hatch various trac con-
trol policies successfully, they still come with drawbacks. Current
simulators, as they were designed primitively, support simulation in
road networks smaller than one hundred intersections and cannot
scale to city-level trac, which involves thousands of intersections.
Due to limits in eciency and scalability, these simulators are either
not able to conduct a city-level simulation in a feasible time or set
to prevent masses of vehicles from coming in the trac.
Another concern lies in the shortage of input data for large-scale
trac simulation. Although the map data of the main cities in the
world is completed, there is an absence of infrastructure for access to
the map data and a pipeline to transform it into simulation inputs.
Therefore, inputs for trac simulation only come from manual
work and are limited to a small set of road networks [
19
,
20
,
23
,
30
]
whose scales are often dozens of intersections (e.g. 4x3 or 4x4) -
much smaller than real urban road networks.
To overcome two aforementioned drawbacks, we propose City
Brain Lab, a novel toolkit for scalable trac simulation. CBLab con-
sists of three components: a microscopic trac simulator CBEngine,
a data tool CBData, and a trac control policy environment CBSce-
nario (See Figure 1). Beneting from well-designed parallelization,
CBEngine is of high eciency and scalability and is capable of
running the trac simulation on the scale of 10,000 intersections
and 100,000 vehicles with a real-simulation time ratio of 1:4 with or-
dinary computing hardware. CBData includes an accessible dataset
that contains raw road networks of 100 main cities all around the
world. A pipeline is prepared to automatically transform the raw
data into input data for trac simulation. Combining CBEngine
and CBData, users can easily start up trac simulation on real
city-level road networks. Based on the scalable trac simulation,
we implement CBScenario as an environment for two trac control
policies: trac signal control and congestion pricing. Users can de-
sign, develop, and train trac control policies in the framework of
CBScenario. To the best of our knowledge, we are the rst to provide
infrastructure for large-scale trac control policy optimization.
Our contribution can be summarized as follows.
•
We develop a scalable trac simulator CBEngine that sup-
ports city-level microscopic trac simulation for the rst
time.
•
We develop a data tool CBData to provide input data for
large-scale trac simulation.
•
We implement an interactive environment CBScenario for
training trac control policies under a large-scale setting.
The original version of CBLab has successfully supported the
City Brain Challenge @ KDD CUP 2021 with 1,156 participating
teams. See Appendix C for details.
2 CBENGINE: CITY-SCALE TRAFFIC
SIMULATION ENGINE
In this section, we introduce CBEngine, the trac simulator. We
demonstrate its trac modeling and conduct extensive experiments
to show the eciency, scalability, and plausibility of CBEngine.
2.1 Overview of Simulation Modeling
Trac simulators take the road network and the trac ow (vehi-
cles in the trac) as inputs and aim to simulate their interaction.
Road networks describe the topology of roads and intersections.
Trac ows describe the origins, destinations, and routes of vehi-
cles. As shown in Figure 2, the road network interacts with vehicles
through trac signal lights, which control the passing of vehicles
at intersections. When the simulation starts, vehicles in the trac
ow set out from their origins, travel down the routes, and nally
arrive at their destinations. Roads, intersections, trac signal lights,
and vehicles can be considered as trac elements.
We can formulate the simulation in the form of states and actions.
The simulator holds states for trac elements at the time step
𝑡
.
For the vehicle, the state is its location and speed. For the trac
signal light, the state is the current signal. Actions of elements then
iterate the current state to that in the next time step. For example,
the acceleration of a vehicle rises up the vehicle’s speed at the
next time step. Finally, the simulation moves on to the next time
step, where a new state-action iteration will begin. Let
𝑠𝑡
,
𝑎𝑡
, and
𝑠𝑡+1
denote the current state, action, and the next state, the trac
modeling in the simulation can be concluded by Eq 1.
𝑠𝑡+𝑎𝑡→𝑠𝑡+1(1)
2.2 Road Network
In CBEngine, Road Network is the topological network where ve-
hicles drive. It consists of two components: roads and intersections.
Road models the road segment in the real-world road network.
A road may include multiple lanes. Each lane holds one or more
vehicles. Intersection is the nexus of dierent roads. Through lane
links in the intersection, lanes of dierent roads connect to each