This project provides tools to create SUMO (Simulation of Urban MObility) traffic scenarios using real-world traffic volume data. It processes traffic count data and generates SUMO-compatible simulation files. This is a project associated with ICCPS 2025 Poster submission. We will update the bibtex citation once the paper is published.
.
├── data/
│ └── sampled_intersections_volume_2022-2025.csv # Traffic turning movement counts (TMC)
├── SUMO_files/
│ ├── SR1-3.net.xml # Road network definition
│ ├── SR1-3.rou.xml # Base routes definitions
│ ├── SR1-3_timing.add.xml # Traffic signal timing and plan (actuated type)
│ ├── SR1-3.sumocfg # Simulation configuration
│ ├── SR1-3-NEMA.net.xml # Road network definition for NEMA-standard signal control
│ ├── SR1-3_timing-NEMA.add.xml # Traffic signal timing and plan (NEMA type)
│ ├── SR1-3-NEMA.sumocfg # Simulation configuration for NEMA-standard signal control
│ ├── SR1-3_volume.xml # Volume data converted from TMC csv file
│ ├── SR1-3_volume_trips.xml # Vehicle trips generated from volume and routes by routeSampler.py
│ └── routeSampler.py # Route sampling utility function
├── csv_to_volume_xml.py # Data conversion script. Convert from TMC csv file to SUMO volume and trips files during selected time period
├── daily_vehicle_count.py # Daily vehicle count visualization
├── TOD_volume.py # Time of day volume visualization
└── requirements.txt # Python dependencies
- the two .net.xml files are identical except that preloaded signal type is NEMA for SR1-3-NEMA.net.xml.
- Data Conversion:
csv_to_volume_xml.py
processes the raw data and generates SUMO volume and trips files. Use command line arguments to run the script:
Input:
python csv_to_volume_xml.py \
--csv_input data/sampled_intersections_volume_2022-2025.csv \ # TMC csv file
--route_file SUMO_files/SR1-3.rou.xml \ # SUMO input route file
--output SUMO_files/SR1-3_volume.xml \ # SUMO output volume file
--start "2024-01-01 00:00:00-05:00" \ # Start date and time
--end "2024-01-01 23:59:59-05:00" \ # End date and time
Note: We recommend the time period to be less than 1 week in each scenario. The processing time and simulation speed will be affected as the time period increases.
Output:
SUMO_files/SR1-3_volume.xml # SUMO volume file
SUMO_files/SR1-3_volume_trips.xml # SUMO trips file
Besides, following configuration files are updated with the new volume and trips data:
SUMO_files/SR1-3.sumocfg # actuated signal configuration
SUMO_files/SR1-3-NEMA.sumocfg # NEMA-standard signal configuration
- Route Sampling: The script automatically calls
routeSampler.py
to generate realistic vehicle trips based on the volume data. The route sampler:
- Matches traffic counts from real data
- Preserves turn ratios at intersections
- Generates time-distributed vehicle trips
- Python 3.10+ (tested in Python 3.12.4)
- SUMO 1.20.0
- Python packages listed in
requirements.txt
Install dependencies:
pip install -r requirements.txt
- Process the volume data:
python csv_to_volume_xml.py [arguments]
- Run SUMO with either actuated or NEMA configuration:
# actuated configuration
sumo-gui -c SUMO_files/SR1-3.sumocfg
# NEMA-standard configuration
sumo-gui -c SUMO_files/SR1-3-NEMA.sumocfg
The simulation can be configured through either SR1-3.sumocfg
or SR1-3-NEMA.sumocfg
(for NEMA-standard signal control), which specify:
SR1-3.net.xml
orSR1-3-NEMA.net.xml
: Road network definitionSR1-3_volume_trips.xml
: Generated vehicle trips based on volume data. This is automatically updated bycsv_to_volume_xml.py
after new trips file is generated.SR1-3_timing.add.xml
: Traffic signal timing plans
SR1-3-output-stats.xml
orSR1-3-NEMA-output-stats.xml
: Traffic performance metrics including:- Vehicle counts
- Average speed
- Wait time and travel time
- Departure delay
For SUMO traffic signal types, please refer to: https://sumo.dlr.de/docs/Simulation/Traffic_Lights.html https://sumo.dlr.de/docs/Simulation/NEMA.html
For more information about route sampling, please refer to: https://sumo.dlr.de/docs/Tools/Turns.html