Chapter 17.1: SUMO Architecture

17.1.1 The SUMO Simulation Pipeline

SUMO (Simulation of Urban MObility) is an open-source, microscopic traffic simulation package developed by the German Aerospace Center (DLR). It simulates individual vehicles with sub-second time resolution on networks of arbitrary complexity. The full pipeline from real-world map data to simulation outputs is:

OSMnx (Python)        → download OpenStreetMap network as .osm.xml
  ↓
netconvert (SUMO)     → convert to SUMO .net.xml (topology + geometry)
  ↓
randomTrips.py (SUMO) → generate demand as .rou.xml (vehicle routes)
  ↓
sumo / sumo-gui       → run simulation
  ↓
TraCI (TCP)           → real-time control interface
  ↓
Outputs               → emission.xml, fcd.xml, queue.xml, tripinfo.xml

Each component is modular. The network can come from any source (OSM, Shapefile, VISUM). Demand can be generated from origin-destination matrices, count data, or real GPS traces. TraCI (Traffic Control Interface) provides a TCP socket through which external programs can query and modify the simulation state at every timestep.

Key File Formats

FileExtensionContents
Network.net.xmlEdges, lanes, junctions, connections, traffic lights
Routes.rou.xmlVehicle types, routes, departure times
Configuration.sumocfgSimulation parameters, input/output paths
Emissionsemission.xmlPer-vehicle CO2, NOx, PMx at each timestep
Floating Car Datafcd.xmlVehicle positions, speeds, angles at each timestep

17.1.2 Krauss Car-Following Model

SUMO’s default car-following model is the Krauss model, a stochastic extension of the Gipps model. At each simulation step, the vehicle computes a safe velocity \(v_{\text{safe}}\) that prevents collision under worst-case deceleration of the leader:

$$v_{\text{safe}} = v_{\text{lead}} + \frac{g - v_{\text{lead}}\,\tau}{v/b + \tau}$$

where:

  • \(v_{\text{lead}}\): speed of the leading vehicle
  • \(g\): bumper-to-bumper gap
  • \(\tau\): driver reaction time (default 1.0 s)
  • \(b\): maximum deceleration (default 4.5 m/s²)
  • \(v\): current speed of the following vehicle

The desired velocity is then:

$$v_{\text{des}} = \min(v_{\max}, v + a\,\Delta t, v_{\text{safe}})$$

The Krauss model adds stochastic dawdling: the actual velocity is \(v_{\text{actual}} = \max(0, v_{\text{des}} - \eta)\), where \(\eta \sim \text{Uniform}(0, \sigma\,a\,\Delta t)\) and \(\sigma \in [0,1]\) is the imperfection parameter.

17.1.3 Intelligent Driver Model (IDM)

The IDM (Treiber, Hennecke & Helbing, 2000) is a continuous-time car-following model widely used in traffic research. The acceleration is:

$$\frac{dv}{dt} = a\left[1 - \left(\frac{v}{v_0}\right)^\delta - \left(\frac{s^*(v, \Delta v)}{s}\right)^2\right]$$

where the desired gap function is:

$$s^*(v, \Delta v) = s_0 + v\,T + \frac{v\,\Delta v}{2\sqrt{a\,b}}$$

IDM parameters and their typical values:

ParameterSymbolTypical ValueMeaning
Desired speed\(v_0\)33.3 m/s (120 km/h)Free-flow desired speed
Time headway\(T\)1.5 sDesired time gap to leader
Min gap\(s_0\)2.0 mJam distance
Acceleration\(a\)1.4 m/s²Maximum comfortable acceleration
Deceleration\(b\)2.0 m/s²Comfortable deceleration
Exponent\(\delta\)4Free-flow acceleration exponent

17.1.4 HBEFA Emission Model

SUMO integrates the Handbook Emission Factors for Road Transport (HBEFA) through the PHEMlight engine. For each vehicle at each timestep, emissions are computed from the instantaneous speed \(v\) and acceleration \(a\):

$$P_{\text{norm}} = \frac{v \cdot (F_{\text{roll}} + F_{\text{air}} + F_{\text{accel}})}{P_{\text{rated}}}$$

where the forces are:

  • Rolling resistance: \(F_{\text{roll}} = c_r \cdot m \cdot g\)
  • Aerodynamic drag: \(F_{\text{air}} = \tfrac{1}{2}\rho_a c_d A_f v^2\)
  • Inertial force: \(F_{\text{accel}} = m \cdot a\)

Emission rates (g/s) are then interpolated from lookup tables indexed by \(P_{\text{norm}}\) for each pollutant species (CO₂, NOₓ, PMₓ, CO, HC). The key insight: emissions peak during acceleration events (high \(P_{\text{norm}}\)), making stop-and-go traffic far dirtier than free flow.

17.1.5 Python: Krauss vs IDM Car-Following

We implement both models from scratch and simulate a platoon of vehicles following a leader with a velocity perturbation. The spacing-velocity fundamental diagrams are compared.

Krauss vs IDM Car-Following Simulation

Python
script.py178 lines

Click Run to execute the Python code

Code will be executed with Python 3 on the server

17.1.6 Key Takeaways

  • SUMO simulates individual vehicles with Krauss (default) or IDM car-following, providing per-vehicle speed, position, and acceleration at sub-second resolution.
  • The Krauss safe velocity prevents collisions under reaction time delay; its stochastic dawdling reproduces realistic capacity drop.
  • IDM provides smooth, deterministic dynamics with physically interpretable parameters; the desired gap function \(s^*\) depends on both speed and relative speed.
  • HBEFA/PHEMlight converts instantaneous (v, a) into emission rates, showing that stop-and-go driving produces far more pollution than steady-state flow.
  • The pipeline OSMnx → netconvert → SUMO → TraCI provides a complete, controllable simulation environment for urban traffic.