How 210041258/cityflow-branch works
CityFlow is a microscopic traffic simulator with a C++ runtime and Python-facing API, surrounded by Python tools for network/scenario generation, replay visualization, and traffic-control or active-learning studies. The principal workflow is to load road-network and flow configuration, advance vehicles through the simulated network, and expose simulation state or replay output. The graph includes major research and tooling branches visible in the tree; with no README and incomplete excerpts, some subsystem links are intentionally omitted.
Main entry points: engine.cpp Simulation engine · roadnet.cpp Road network · vehicle.cpp Vehicle dynamics · cityflow.cpp Python API
Components 24
Simulation runtime
- Python API
src/cityflow.cpp - Simulation engine
src/engine/engine.cpp - State archive
src/engine/archive.cpp - Vehicle flows
src/flow/flow.cpp - Road network
src/roadnet/roadnet.cpp - Traffic lights
src/roadnet/trafficlight.cpp - Vehicle dynamics
src/vehicle/vehicle.cpp - Route planning
src/vehicle/router.cpp - Lane changing
src/vehicle/lanechange.cpp - Geometry and JSON
src/utility/utility.cpp - Float formatting
extern/milo/dtoa_milo.h
Network and scenarios
- Grid to roadnet
tools/generator/generate_json_from_grid.py - Scenario generation
- Network converters
tools/converter
Traffic research
- Traffic-control studies
cases-study/traffic_control_algorithm.py - Control extensions
cityflow_features - Synthetic datasets
cases-study/synthetic_dataset.py - Synthetic prediction
cases-study/synth_to_pred.py - Active learning
cases-study/bayesian_active_learning.py
Replay and visualization
- Replay simulation
simulation/frontend_replay/replay_simu.py - Replay viewer
frontend/script.js - Replay conversion
simulation/frontend_replay/init_replay/replay - Replay download
frontend/download_replay.py
Other components
- Simulator user
Connections 16
- Simulator user → Python API: uses
src/cityflow.cpp - Python API → Simulation engine: exposes
src/cityflow.cpp - Python API → State archive: uses
src/cityflow.cpp - Simulation engine → Vehicle flows: manages
- Simulation engine → Road network: loads and updates
src/engine/engine.cpp - Simulation engine → Vehicle dynamics: updates
src/engine/engine.cpp - Road network → Vehicle dynamics: references
src/roadnet/roadnet.cpp - Road network → Traffic lights: uses
- Vehicle dynamics → Route planning: delegates routing
- Vehicle dynamics → Lane changing: delegates lane changes
- Route planning → Road network: queries lanes and roads
src/vehicle/router.cpp - Simulation engine → Geometry and JSON: uses
src/engine/engine.cpp - Geometry and JSON → Float formatting: formats floats
- Scenario generation → Grid to roadnet: uses
- Synthetic prediction → Synthetic datasets: imports dataset
cases-study/synth_to_pred.py - Replay simulation → Replay conversion: converts replay