Table of Contents
Fetching ...

CityFlowER: An Efficient and Realistic Traffic Simulator with Embedded Machine Learning Models

Longchao Da, Chen Chu, Weinan Zhang, Hua Wei

TL;DR

CityFlowER addresses the realism-efficiency gap in traffic simulation by embedding behavior models directly inside a city-scale simulator, removing the costly external API-ML loop. It introduces a simulator-level pre-embedding mechanism, implemented on CityFlow via LibTorch, enabling per-vehicle combinations of rule-based and imitation-learning–based driving policies. The approach achieves high fidelity in reproducing CityFlow and SUMO behaviors, while maintaining near-rule-based efficiency and enabling diverse, per-vehicle behavior configurations. This has strong practical implications for scalable, data-driven policy learning and city-wide traffic analysis. The authors also provide implementation details and demonstrations on large-scale networks, with plans to release the code publicly.

Abstract

Traffic simulation is an essential tool for transportation infrastructure planning, intelligent traffic control policy learning, and traffic flow analysis. Its effectiveness relies heavily on the realism of the simulators used. Traditional traffic simulators, such as SUMO and CityFlow, are often limited by their reliance on rule-based models with hyperparameters that oversimplify driving behaviors, resulting in unrealistic simulations. To enhance realism, some simulators have provided Application Programming Interfaces (APIs) to interact with Machine Learning (ML) models, which learn from observed data and offer more sophisticated driving behavior models. However, this approach faces challenges in scalability and time efficiency as vehicle numbers increase. Addressing these limitations, we introduce CityFlowER, an advancement over the existing CityFlow simulator, designed for efficient and realistic city-wide traffic simulation. CityFlowER innovatively pre-embeds ML models within the simulator, eliminating the need for external API interactions and enabling faster data computation. This approach allows for a blend of rule-based and ML behavior models for individual vehicles, offering unparalleled flexibility and efficiency, particularly in large-scale simulations. We provide detailed comparisons with existing simulators, implementation insights, and comprehensive experiments to demonstrate CityFlowER's superiority in terms of realism, efficiency, and adaptability.

CityFlowER: An Efficient and Realistic Traffic Simulator with Embedded Machine Learning Models

TL;DR

CityFlowER addresses the realism-efficiency gap in traffic simulation by embedding behavior models directly inside a city-scale simulator, removing the costly external API-ML loop. It introduces a simulator-level pre-embedding mechanism, implemented on CityFlow via LibTorch, enabling per-vehicle combinations of rule-based and imitation-learning–based driving policies. The approach achieves high fidelity in reproducing CityFlow and SUMO behaviors, while maintaining near-rule-based efficiency and enabling diverse, per-vehicle behavior configurations. This has strong practical implications for scalable, data-driven policy learning and city-wide traffic analysis. The authors also provide implementation details and demonstrations on large-scale networks, with plans to release the code publicly.

Abstract

Traffic simulation is an essential tool for transportation infrastructure planning, intelligent traffic control policy learning, and traffic flow analysis. Its effectiveness relies heavily on the realism of the simulators used. Traditional traffic simulators, such as SUMO and CityFlow, are often limited by their reliance on rule-based models with hyperparameters that oversimplify driving behaviors, resulting in unrealistic simulations. To enhance realism, some simulators have provided Application Programming Interfaces (APIs) to interact with Machine Learning (ML) models, which learn from observed data and offer more sophisticated driving behavior models. However, this approach faces challenges in scalability and time efficiency as vehicle numbers increase. Addressing these limitations, we introduce CityFlowER, an advancement over the existing CityFlow simulator, designed for efficient and realistic city-wide traffic simulation. CityFlowER innovatively pre-embeds ML models within the simulator, eliminating the need for external API interactions and enabling faster data computation. This approach allows for a blend of rule-based and ML behavior models for individual vehicles, offering unparalleled flexibility and efficiency, particularly in large-scale simulations. We provide detailed comparisons with existing simulators, implementation insights, and comprehensive experiments to demonstrate CityFlowER's superiority in terms of realism, efficiency, and adaptability.
Paper Structure (12 sections, 4 figures, 1 table)

This paper contains 12 sections, 4 figures, 1 table.

Figures (4)

  • Figure 1: Comparison on CityFlowER of embedding ML models vs rule-based method and interaction-based method in original CityFlow for realistic simulations. The original simulator is implemented in C++ for efficiency. Note that the $\textit{MLs}$ can be any vehicle behavior models, e.g., Car Following Model, Lane Changing Model, etc.
  • Figure 2: The vehicles behavior comparison of CityFlowER-pink and Cityflow-grey on example vehicles (a$\sim$f). Left: the speed changes over time. Right: The lane changes over time.
  • Figure 3: Speedup of SUMO, CityFlow and CityFlowER
  • Figure 4: The diverse behaviors of vehicles controlled by different models in CityFlowER. The figure shows a snapshot of traffic flow at time $t$. Since $V_1$ and $V_2$ are specified with two different behavior policies, they behave differently in the following time steps even though under a similar driving situation (distance with lead vehicle, moving velocity, and lane capacity).