Assumptions and data format — S5 viewer

Each assumption: value, reason, expected sensitivity, what would replace it. The viewer shows simulation outputs; it adds no traffic data of its own. The data contract is sim/VIEWER.md; this file records the exact format and the choices made while implementing it.

Files (exporter output)

python -m vhsim.viewer.export --net <net.xml> --run <run_dir> [--run <seed2> ...] --out <data_dir> --scenario S --condition C --year Y --growth G [--seed N] [--network-name NAME] [--begin s] [--end s] [--bookmark "HH:MM=label"] [--bookmarks file.json] [--pois pois.geojson] [--zones zones.geojson] [--junctions junctions.csv]

<data_dir>/index.json                  {version, networks: {name: "networks/<name>.json"},
                                        runs: [{id, scenario, network, condition, year, growth, seed, label, path}]}
<data_dir>/networks/<name>.json        one per network variant
<data_dir>/runs/<run_id>/meta.json     run_id = "<scenario>__<condition>__<year>-<growth>__s<seed>" (or "__mean")
<data_dir>/runs/<run_id>/lanes.bin.gz
<data_dir>/runs/<run_id>/edge_times.bin.gz

Several --run directories (seeds) are averaged into one run with seed mean (plain mean per lane/edge and interval; a seed with no vehicles on a lane is left out of that lane's speed and density mean). index.json is merged, so runs can be exported one at a time into the same folder.

Safety checks: the exporter refuses to replace networks/<name>.json with a network whose lane/edge ids differ (--force-network overrides; then re-export every run on it), refuses runs whose measured edges are mostly not in --net, and refuses seeds with different output periods. The viewer refuses a run whose network_hash, n_lanes or n_edges do not match the loaded network.

networks/.json (columnar: one array per field, index = position)

meta.json

run_id, label, network, network_hash, scenario, condition, year, growth, seed, begin_s, interval_s (900), n_intervals, n_lanes, n_edges, files {lanes, edge_times} (binary layouts, below), bookmarks [{t, label, kind: auto|scenario, detail}], series {delay_veh_h, waiting_veh_h, vehicles_mean, speed_ratio_mean} (one value per interval), summary {loaded, inserted, arrived, teleports, waiting, running, delay_veh_h_total, peak_interval_begin_s}, queue_threshold_vehicles, sources (run dirs), synthetic, notes, created.

Binary layout (both files)

gzip-compressed, little-endian, interval-major planes (value[t * n + i] for lane/edge i in interval t), each plane padded to a 4-byte boundary; decoded = raw * scale unless raw == missing. meta.files.*.planes lists {name, dtype, offset, scale, missing, unit, description}.

file plane dtype scale missing meaning
lanes waiting_s uint16 2 – seconds vehicles were halted on the lane in the interval, summed over vehicles (cap 131070 s ≈ 145 vehicles halted all interval)
lanes vehicles uint16 1 – vehicles entering the lane, incl. lane changes onto it (entered + departed + laneChangedTo); a vehicle can count on two lanes of one road
lanes speed_ratio uint8 1/254 255 time-weighted mean speed / lane limit (SUMO speedRelative), capped at 1; 255 = no vehicles
lanes density uint8 1 255 vehicles per km of lane (cap 254)
edge_times travel_time_s uint16 0.1 65535 SUMO edgeData traveltime; free-flow time where no vehicle; cap 6553.4 s; 65535 = impassable

Size: 6 bytes per lane-interval + 2 per edge-interval before gzip. Victor Harbor scale (~15k lanes, 96 intervals) is about 9 MB raw per run; gzip typically reduces it 5–10×. The sample (1,238 lanes, 76 intervals) is 120–140 kB per run.

V1. Edge travel time = SUMO edgeData traveltime, free-flow where empty

V1a. Sparse samples: less than one edge length travelled (added 22 Nov 2026)

V2. Travel time to a target: arrival-anchored searches, routes driven forward

V3. Snapping the target

V3b. Zone shading

V4. Automatic bookmarks (exporter, vhsim/viewer/bookmarks.py)

V5. Congestion colours

V6. Comparing scenarios

V7. Lane drawing offsets

V8. Sample data (sim/data/viewer/sample/, python -m vhsim.viewer.sample)

V9. External libraries

Residents' site (viewer/residents/)

R1. Trip times

R2. "About the same" band (grey)

R3. Day types

R4. Privacy

R5. Data the site loads

Base map (viewer/basemap/, vhsim/viewer/basemap.py, vhsim/viewer/terrain.py)

Provenance, licences and hand-placed labels: viewer/basemap/SOURCES.md. These choices only change how the map looks; no simulation result depends on them.

V10. Building heights (3-D buildings)

V11. Base-map generalisation

By Brent Jacobs · 22 November 2026