The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
Error code: JobManagerCrashedError
Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
cell_id int32 | link_id string | dist_m float32 |
|---|---|---|
13 | 966452 | 4,806.92334 |
13 | 1058744 | 4,835.604492 |
13 | 846086 | 4,850.443359 |
13 | 1058745 | 4,876.729492 |
13 | 688205 | 4,895.687988 |
13 | 966451 | 4,902.327148 |
13 | 279937 | 4,906.191895 |
13 | 279936 | 4,910.522949 |
13 | 1127273 | 4,923.355957 |
13 | 506717 | 4,924.054199 |
13 | 688207 | 4,933.484863 |
13 | 1730836 | 4,955.120117 |
13 | 966495 | 4,988.671875 |
13 | 1730835 | 4,992.805176 |
14 | 966452 | 4,596.73584 |
14 | 1058744 | 4,628.780273 |
14 | 846086 | 4,640.766113 |
14 | 1058745 | 4,672.226074 |
14 | 688205 | 4,691.233398 |
14 | 966451 | 4,697.206543 |
14 | 279937 | 4,706.397949 |
14 | 279936 | 4,711.757324 |
14 | 506717 | 4,718.387695 |
14 | 1127273 | 4,724.326172 |
14 | 688207 | 4,733.842773 |
14 | 1730836 | 4,754.03125 |
14 | 966495 | 4,781.032715 |
14 | 1730835 | 4,789.603516 |
14 | 74010 | 4,823.223145 |
14 | 1112723 | 4,875.724121 |
14 | 74013 | 4,930.778809 |
14 | 380460 | 4,933.636719 |
14 | 380470 | 4,979.523926 |
15 | 966452 | 4,433.221191 |
15 | 1058744 | 4,468.572754 |
15 | 846086 | 4,477.345703 |
15 | 1058745 | 4,514.078125 |
15 | 688205 | 4,532.943848 |
15 | 966451 | 4,538.136719 |
15 | 279937 | 4,552.981934 |
15 | 506717 | 4,558.515137 |
15 | 279936 | 4,559.394531 |
15 | 1127273 | 4,571.55127 |
15 | 688207 | 4,580.312012 |
15 | 1730836 | 4,598.740234 |
15 | 966495 | 4,618.40918 |
15 | 1730835 | 4,631.683594 |
15 | 74010 | 4,663.036133 |
15 | 1112723 | 4,712.17041 |
15 | 74013 | 4,763.907715 |
15 | 380460 | 4,764.653809 |
15 | 380470 | 4,810.344727 |
15 | 74012 | 4,848.255371 |
15 | 380474 | 4,939.10498 |
15 | 468894 | 4,945.79248 |
16 | 966452 | 4,321.680176 |
16 | 1058744 | 4,360.123535 |
16 | 846086 | 4,365.379395 |
16 | 1058745 | 4,407.279297 |
16 | 688205 | 4,425.775879 |
16 | 966451 | 4,430.081055 |
16 | 506717 | 4,449.374512 |
16 | 279937 | 4,450.742188 |
16 | 279936 | 4,458.194824 |
16 | 1127273 | 4,469.776855 |
16 | 688207 | 4,477.63916 |
16 | 1730836 | 4,493.99707 |
16 | 966495 | 4,505.677246 |
16 | 1730835 | 4,523.791504 |
16 | 74010 | 4,552.397461 |
16 | 1112723 | 4,597.436035 |
16 | 380460 | 4,643.605957 |
16 | 74013 | 4,645.11084 |
16 | 380470 | 4,688.62207 |
16 | 74012 | 4,724.509766 |
16 | 380474 | 4,808.888184 |
16 | 468894 | 4,816.983887 |
16 | 74008 | 4,907.946289 |
16 | 468893 | 4,946.869629 |
16 | 468895 | 4,965.403809 |
17 | 966452 | 4,266.190918 |
17 | 1058744 | 4,307.34375 |
17 | 846086 | 4,308.879883 |
17 | 1058745 | 4,355.607422 |
17 | 688205 | 4,373.488281 |
17 | 966451 | 4,376.820313 |
17 | 506717 | 4,394.747559 |
17 | 279937 | 4,403.245117 |
17 | 279936 | 4,411.680664 |
17 | 1127273 | 4,422.524902 |
17 | 688207 | 4,429.361816 |
17 | 1730836 | 4,443.37793 |
17 | 966495 | 4,446.634277 |
17 | 1730835 | 4,469.550781 |
17 | 74010 | 4,494.96875 |
17 | 1112723 | 4,535.227051 |
17 | 380460 | 4,574.30127 |
17 | 74013 | 4,578.131836 |
17 | 380470 | 4,618.109375 |
17 | 74012 | 4,651.494629 |
gnn_dataset — MATSim training data for a GNN surrogate (Zurich cutout)
Runs many MATSim scenarios on Euler and stores per scenario a compact dataset (population, network, hourly link loads) as parquet. Nothing in the pipeline itself is modified; everything lives in this directory.
How it works
- Base (once) —
sbatch sbatch/build_base.sbatchruns the eqasim pipeline up tomatsim.cutter.runat 2 % (a generated copy ofconfig.yml, the original is untouched), cuts the canton of Zurich (extent/zurich_canton.shp, built from swissBOUNDARIES3D), and harvestszurich_*.xml.gz+ config + the eqasim jar into$SCRATCH/gnn_runs/base/. It also buildspool_persons.parquet(attributes + home municipality). The 2 % pool exists so that class-3 scenarios can draw 0.5 / 1 / 2 % samples without ever re-running the pipeline; the baseline is a fixed 1 % draw (pop_seed 0) of that pool. - Scenarios —
python generate_scenarios.pywritesscenarios/<id>/scenario.jsonfor the whole campaign, deterministic fromconfig.yaml: generator_seed. - Run —
python submit_array.py ...submits one Slurm array task per scenario (run_scenario.py): materialize (modified network / population XML- config overrides) →
RunSimulation→ extract parquets → deleteoutput_events.xml.gz+ITERS/→ copy parquets todata/<id>/.
- config overrides) →
- Manifest —
python build_manifest.py→manifest.parquet(status ok/failed/running, path, class, runtime, core-hours, error).
Scenario classes
| class | id | perturbation |
|---|---|---|
| 0 | base_s0..4 |
identical baseline, different MATSim seed (simulation variance) |
| 1 | c1_* |
1–5 closures of car links with capacity ≥ 1000 veh/h, never PT-carrying links. Variant: capacity → 0 (kept in the network: capacity 1 veh/h, freespeed 1 m/s so the router avoids it). Removing links crashes MATSim when routes reference them. |
| 2 | c2_* |
5–20 random car links, capacity × {0.5, 0.75, 1.5} (factor drawn per link) |
| 3 | c3_* |
other population seed and/or rate ∈ {0.5, 1, 2 %}; with p=0.5 also one random municipality scaled × {0.7, 1.3} (implemented as a differential draw rate inside that zone) |
flowCapacityFactor = rate, storageCapacityFactor = rate^0.75 (eqasim's rule),
both recorded in every scenario.json.
Per-scenario files (data/<id>/)
scenario.json— id, class, seed, matsim_seed, pop_seed, sample_rate, capacity factors, iterations, eqasim commit, all perturbation parameters, population selection statsnodes.parquet— node_id, x, ylinks.parquet— link_id, from_node, to_node, length, freespeed, capacity, lanes, modes,closed,capacity_factorpersons.parquet— person_id, home_x/y, home_zone (BFS), age, employed, car_available, has_license, main activity type + x/y, is_freightlink_hourly.parquet— link_id, hour, volume (scaled to 100 %), traveltime_avg, vc_ratio, congestion_index (fromlinkstats, averaged over the last 5 iterations). Sparse: only (link, hour) rows with volume > 0 are stored; a missing row means volume 0, free-flow travel time, vc_ratio 0, congestion_index 1. Compact dtypes (int8 hour, float32), zstd.delta_vs_baseline.parquet(class 1, 2) — Δ vc_ratio, Δ congestion_index vsbase_s0over the union of both sparse key sets; rows with zero change omittedscorestats.parquet— MATSim score trajectory (convergence check)
Demand tables (from the scenario's OWN population plans, build_demand.py;
all counts are weight = 1/sample_rate-weighted, i.e. scaled to 100 %):
persons.parquetadditionally haswork_x/y,edu_x/y(first work / education activity),n_legs(raw MATSim legs),n_trips(trips between non-interaction activities, the unit used by the OD tables),n_car_trips,weightcells.parquet— regular 500 m grid over the network bounding box (grid definition inscenario.json: demand.grid,cell_id = iy * nx + ix, EPSG:2056; identical for all scenarios). Per cell:cx, cy,residents,residents_employed,residents_car_available(carAvail always/sometimes),residents_age_0_17/18_64/65plus,jobs,edu_places,trips_origin,trips_dest. Empty cells are included (zeros). Home = the plan's firsthomeactivity, so agents cut by the scenario cutter (onlyoutsideactivities) and freight agents are not residents. Source: the scenario'soutput_plans.xml.gz(plans after replanning, consistent with the measured loads; recorded inscenario.json: demand.source).od_cells.parquet—orig_cell, dest_cell, mode, trips(sparse, trips > 0; cell −1 = outside the grid).modeis the trip's routingMode (car, pt, walk, bike, car_passenger, truck, outside).od_cells_am.parquet: same for departures 06:00–09:00.cells_delta_vs_baseline.parquet(class 3) — cell values minusbase_s0.../cell_link_edges.parquet(ONCE at the dataset root, identical for all scenarios):cell_id, link_id, dist_mfor every pair with |cell centre − link midpoint| ≤ radius (seecell_link_edges.json).
Operations
python generate_scenarios.py # after the base is ready
python submit_array.py base_s0 # baseline first
python -c "from gnnds.convergence import summarize; print(summarize('/cluster/scratch/rsahleanu/gnn_runs/base_s0/output/scorestats.csv'))"
python submit_array.py c1_000 # one test scenario -> runtime / core-h
python submit_array.py --class 1 # then the arrays
python submit_array.py --all --skip-done # (re)run everything not yet ok
python build_manifest.py
Resources per task are in config.yaml: resources (override with
--cores/--mem-mb/--time/--java-xmx/--max-parallel).
Campaign 2026-09-13 — results and caveats
155/155 scenarios ok (job array 14032547 + 14031605/06), 474 core-h total,
median 45 min per scenario on 4 cores (26–79 min), MaxRSS 7.5 GB.
manifest.parquet has runtime/core-hours/job id per scenario.
Convergence (scorestats.parquet, mean over all 155 runs of avg_executed):
−45.8 (it 0) → −25.4 (it 30) → −25.3 (it 60). Relative change over 5
iterations: 1.1 % at it 30, 0.4 % at it 40, ≤ 0.2 % from it 45 on. Innovation
is never switched off (fractionOfIterationsToDisableInnovation = Infinity),
so scores keep fluctuating by ~±0.2 % around the plateau. 60 iterations are
safe; ~45–50 would have sufficed.
Noise floor at 1 %. One sampled vehicle = 100 veh/h after scaling, i.e.
0.1 vc on a 1000 veh/h link. Seed-only differences (base_s1..4 vs base_s0)
give mean |Δvc| = 0.09 per (link, hour) and 36 % of link-hours differ by
0.1; single closures (class 1) give 0.105 / 43 %. The perturbation signal is therefore local and small relative to per-link-hour seed noise — use the five baseline seeds to estimate that noise, aggregate over hours/links, or train on
delta_vs_baselinewith an appropriate loss. 14 of the 173 closed links carry no traffic in the baseline (closure has no effect);scenario.json+links.parquet: closedidentify them.
Outliers. traveltime_avg / congestion_index can be extreme (up to
~10⁴×) on short links that gridlock in the QSim at this sample size (storage
capacity factor 0.032 → most links hold a single vehicle). Clip or winsorize
before training. PT-only links (pt_*, 2240 links, freespeed ∞) have
congestion_index = NaN; filter links.parquet: modes for car links.
Scratch. $SCRATCH/gnn_runs/<id>/ keeps the materialized inputs and the
non-event MATSim outputs (~200 MB each, 31 GB total); events and ITERS/ were
deleted. Everything needed for training is in data/ (4.3 GB).
Loading in PyTorch
torch_dataset.py turns every scenario into one graph sample (needs numpy,
pandas, pyarrow, torch; optional torch_geometric and scipy). Copy data/,
manifest.parquet and torch_dataset.py to the training machine, then:
from torch_dataset import GNNScenarioDataset
from torch.utils.data import DataLoader # or torch_geometric.loader.DataLoader
ds = GNNScenarioDataset("/path/to/gnn_dataset", targets="vc_ratio") # 155 scenarios
ds.build_cache() # once: parquet -> cache_torch/*.npz (a few s per scenario)
tr, va, te = ds.split(val_frac=0.15, test_frac=0.15, seed=0) # stratified by class
sample = ds[tr[0]]
# sample.x [92019, 4] node: x, y (normalised), n_home, n_activity (persons, scaled to 100 %)
# sample.edge_index [2, 181961] car links, from -> to
# sample.edge_attr [181961, 7] log_length, freespeed, log_capacity, lanes, closed, capacity_factor, capacity_eff
# sample.y [181961, 24] target per link and hour; sample.y_base = same for base_s0
# sample.scenario dict from scenario.json
loader = DataLoader([ds[i] for i in tr], batch_size=1, shuffle=True) # plain torch: returns dicts
With with_cells=True (default) every sample also carries the demand side:
cell_x [13786, 12] (normalised centre + log1p of the 10 cell counts),
cell_pos, cell_link_index [2, M] / cell_link_dist [M] (cell ↔ car-link
pairs; cell_link_max_dist=2000 keeps 9.1 M pairs instead of 57 M for 5 km),
od_index [2, K] / od_trips [K, 3] (all / car / AM-peak trips between cells
inside the grid). The cell ↔ link pairs are read once from
cell_link_edges.parquet and cached as npz.
targets may be a list (["vc_ratio", "congestion_index", "traveltime_avg"] →
y is [E, 72]); congestion_index is clipped at clip_congestion (50) and
NaN → 1. With car_only=False all 188 590 links are used. The network is the
same in every sample, so a model can cache edge_index.
- Downloads last month
- 323