transito-analyzer

How the simulation works

transito-analyzer is a browser-based microscopic traffic simulation over the real OpenStreetMap Road Network of a Region you choose. This page states the data pipeline, the Vehicle model, the Signal rules, the metrics and the limitations, with the exact default values the engine uses.

What the simulator is

A Region is a circle of real-world territory, defined by a centre and a radius of up to 3 km, that you pick on a map. The simulator builds the Region's Road Network from OpenStreetMap, lets Vehicles in through its Entries and moves every one of them individually, ten times per simulated second, inside your browser.

It is free, needs no account and sends nothing about you to a server beyond the Region you asked for. The engine is open source; its version is shown below so results can be reproduced.

Open the simulator

Data: how a Region becomes a Road Network

The Road Network is the directed graph of streets inside the Region: Segments joined at Intersections. The server queries the Overpass API for the OpenStreetMap ways tagged highway=* with one of the Road Classes in the table below, dropping areas, private roads and ways closed to motor vehicles; service roads are kept only when untyped or alleys.

Each way becomes one Segment per direction of travel: oneway decides the directions (motorways and roundabouts default to one-way), lanes gives the lane count (two by default on motorways, trunks and primaries, one elsewhere) and maxspeed the free-flow speed. When maxspeed is missing the default depends on the country of the Region's centre: Brazil's Código de Trânsito Brasileiro defaults, or SUMO's urban defaults elsewhere. Nodes tagged highway=traffic_signals become Signals; stop and give_way become yield rules; turn-restriction relations become Turn Restrictions.

Segments that cross the Region boundary become Entries (inbound) and Exits (outbound). The server caches each built Road Network for 30 days, so a Region you share loads from the cache. The payload carries its licence metadata: it is a derivative database of OpenStreetMap under the Open Database License.

Road Classes kept, their default free-flow speeds and the preset Flow per lane at an Entry
Road ClassDefault speed, BrazilDefault speed, elsewherePreset Flow per lane
motorway100 km/h100 km/h1,200/h
trunk80 km/h50 km/h900/h
primary60 km/h50 km/h600/h
secondary60 km/h50 km/h400/h
tertiary40 km/h50 km/h250/h
unclassified30 km/h50 km/h80/h
residential30 km/h50 km/h80/h
living_street20 km/h20 km/h30/h
service20 km/h20 km/h20/h

The _link classes (ramps and slip roads) inherit their parent class's preset Flow; in Brazil their default speed is the parent's minus 20 %.

Vehicle model

Each Vehicle follows the Intelligent Driver Model (IDM, Treiber, Hennecke and Helbing, 2000) in its improved form (Treiber and Kesting, 2013, section 11.3.6). The acceleration depends on the Vehicle's own speed v, its desired speed v₀, the gap s to the leader and the approach rate Δv:

a_IDM = a · [1 − (v / v₀)^δ − (s* / s)²], with s*(v, Δv) = s₀ + max(0, v·T + v·Δv / (2·√(a·b)))

The desired speed is the Segment's speed limit times a per-Vehicle factor drawn once from a normal distribution with mean 1 and standard deviation 0.1, clipped to 0.8–1.2. Positions advance with a ballistic update and an exact-stop rule every 0.1 simulated seconds. Each Segment holds one queue per lane of its lanes tag: a Vehicle picks a lane once per Segment, so more lanes insert and hold more Vehicles, but nobody ever changes lanes.

IDM parameters, fixed for every Vehicle
ParameterValue
Desired time headway T1.2 sec
Minimum standstill gap s₀2 m
Maximum acceleration a1.5 m/s²
Comfortable deceleration b2 m/s²
Acceleration exponent δ4
Vehicle length5 m
Hard braking limit9 m/s²
Deceleration a driver accepts to stop at amber or to yield4 m/s²
Time step0.1 sec

Flow and Intensity

A Flow is the rate of Vehicles entering through one Entry, in vehicles per hour. Its preset is the Road Class value from the table above times the Entry's lane count; you can override any Entry between 0 and 2,000/h per lane. A single lane passes about 1,900/h at saturation, so the simulator warns when the Entries' Flows exceed what they can admit.

Intensity is the global multiplier applied to every Flow, from 0.1 to 3 in steps of 0.05. The presets are metropolitan-peak values, so the default Intensity is computed per Region from its radius, the sum of its Entry presets and its Signal density, aiming at a Region that is busy but not gridlocked. The night, normal and peak presets are 0.5, 1 and 1.5 times that default.

Routes are chosen once at birth on free-flow travel time plus Movement penalties (left turn 8 sec, right turn 3 sec, U-turn 30 sec, each Signal 15 sec, each signed yield 5 sec), honouring Turn Restrictions; four cost variants perturbed by ±10% spread the Vehicles over parallel Segments. Sixty per cent of Vehicles are born at Entries and sixty per cent end at Exits; the through-traffic share slider moves both. A Vehicle born with no room waits in its Origin's virtual queue, which is reported separately and never counted as Delay.

Intersections and Signals

Right of way at unsignalised Intersections follows SUMO's priority classes: the higher Road Class goes first; equal classes with a speed difference above 10 km/h treat the faster road as major; otherwise right before left. OpenStreetMap stop and give_way tags force a yield, and traffic already on a roundabout wins. A yielding Vehicle waits while a prioritised Vehicle would reach the conflict point before it has cleared, with the accepted gap shrinking as the wait grows, down to any collision-safe gap after 1.5 min. No Vehicle enters an Intersection unless there is room for it on the far side.

A Signal is a traffic light imported from OpenStreetMap. Its default Cycle lasts 1.5 min with two Phases by axis, the green split proportional to each axis's Road Class rank and lane count, a fixed 3 sec amber and 2 sec all-red, and left turns yielding to opposing through traffic. Consecutive Signals along one road open together. You can set each Signal's Cycle between 30 sec and 3 min and its split between 20% and 80%; edits apply at the next Cycle start.

Gridlock valve: a Vehicle stopped at a stop line for more than 5 min is removed and counted as teleported, as SUMO does. The HUD shows the count as a diagnostic; its Delay is never attributed to a Bottleneck.

Metrics and the Bottleneck ranking

Congestion is how far a Segment's current mean speed falls below its free-flow speed: the ratio colours the map green at 80% or above, yellow down to 50%, orange down to 30% and red below that, smoothed with a 30-second moving average.

Delay is the extra time a Vehicle spends beyond what free-flow speed would take, measured against its own desired speed capped by the Segment's, so a slow driver is not a Bottleneck. Delay accrued while stopped or crawling below 5 km/h in a contiguous chain reaching a stop line is charged to that Intersection; the rest stays on the Segment.

A Queue is the contiguous line of stopped or crawling Vehicles ending at an Intersection's stop line. The ranking reports its maximum over the window in Vehicles and in metres on the longest lane.

Spillback is a Queue whose tail leaves no room for another Vehicle at the start of its Segment, so the upstream Intersection's Movements are blocked. It is flagged, never on an Entry.

A Bottleneck is a Segment or Intersection ranked among the most congested in the Region. The ranking covers a sliding window of the last 10 min of simulated time, refreshed every 10 s, and starts after warm-up: at least 5 min of simulated time and a Vehicle count changing less than 5% per minute. Rows are ordered by total Delay in vehicle-hours; the columns are Delay per Vehicle, speed ratio, Vehicles per hour, maximum Queue and the Spillback flag. The top 10 are shown, expandable to 25. Intersections on the Region boundary are never ranked.

Worked examples: the golden scenarios

The engine's test suite runs synthetic Road Networks whose answers are known from traffic theory. They double as a sanity check you can reason about:

  • A straight single-lane road at 50 km/h saturates at about 1 900 veh/h: twelve seeds measured 1 912–1 917 veh/h, against 1 750 at 40 km/h and 2 035 at 60 km/h. That is the capacity behind the over-capacity warning.
  • A Signal with a 50 % green split passes about half of that saturation Flow on each axis, and the Queue builds upstream of its stop line only.
  • An empty street yields zero Delay; a Vehicle driving alone at its desired speed is never charged anything.
  • Delay inside a Queue is charged to the Intersection it ends at, not to the Segment, so the ranking points at the Intersection that needs a different Cycle rather than at the Segment behind it.

Limitations

Treat the results as a picture of where a Road Network tends to queue up, not as a traffic study:

  • A Vehicle keeps its lane: no lane changing, overtaking or weaving.
  • No pedestrians, cyclists, buses, parking manoeuvres, incidents or weather.
  • Signals run fixed-time plans; there is no actuation, coordination offsets or adaptive control beyond the defaults and your edits.
  • Demand comes from Road Class presets, not from counts or origin–destination surveys; routes are fixed at birth and drivers never re-route.
  • The Road Network is only as good as OpenStreetMap: a missing one-way tag, lane count or Signal changes the result. Fix the map and the Region rebuilds after the cache expires.
  • Regions are capped at 3 km of radius (2 km on a phone) and the Vehicle count at the device's budget; past it, new Vehicles wait in the virtual queue.

How it compares with SUMO and MATSim

SUMO (Eclipse Foundation) and MATSim are the reference open-source simulators. The table states the factual differences; they are the right tools for a study, this one is for looking at a neighbourhood in a minute.

AspectSUMOMATSimtransito-analyzer
Runs inDesktop or server (C++), with a GUIServer (Java), batch runsThe browser, in a Web Worker
Traffic modelMicroscopic, several car-following models, multi-lane with lane changingMesoscopic queue model with agents following daily plansMicroscopic IDM, one lane per direction, no lane changing
Typical scaleCorridors to whole citiesWhole regions, millions of agentsOne Region of up to 3 km radius, a few thousand Vehicles
Demand inputCounts, origin–destination matrices, routesSynthetic population with activity plansFlow presets per Road Class, one Intensity knob
LicenceEPL-2.0 / GPL-2.0GPL-2.0See the Licences page

Reproducibility

All randomness comes from one seeded generator; the seed is 42 unless a shared link carries another. The same Road Network, settings and seed produce a bit-identical run on any device, and Reset restarts from the same seed with the current settings. A shared link holds the Region centre, radius and seed, so a result can be checked by anyone.

Engine version 0.0.0, Road Network builder version 0.0.0.

Sources

  1. Treiber, M., Hennecke, A. and Helbing, D. (2000). Congested traffic states in empirical observations and microscopic simulations. Physical Review E, 62, 1805.
  2. Treiber, M. and Kesting, A. (2013). Traffic Flow Dynamics: Data, Models and Simulation. Springer.
  3. OpenStreetMap wiki: Key:highway
  4. OpenStreetMap wiki: Key:oneway, Key:lanes, Key:maxspeed
  5. OpenStreetMap wiki: Relation:restriction
  6. Eclipse SUMO documentation: netconvert and the OSM import type map
  7. MATSim: The Multi-Agent Transport Simulation (Horni, Nagel and Axhausen, 2016)
  8. Brazil, Lei 9.503/1997 (Código de Trânsito Brasileiro), art. 61

Last updated