Add files using upload-large-folder tool
Browse filesFiles changed (50)
- README.md+34
- cell_link_edges.jsonAdded+15
- data/base_s3/scenario.json+21
- data/c1_002/scenario.json+21
- data/c1_003/scenario.json+21
- data/c1_006/scenario.json+21
- data/c1_010/scenario.json+21
- data/c1_018/scenario.json+21
- data/c1_023/scenario.json+21
- data/c1_024/scenario.json+21
- data/c1_029/scenario.json+21
- data/c1_030/scenario.json+21
- data/c1_035/scenario.json+21
- data/c1_036/scenario.json+21
- data/c1_037/scenario.json+21
- data/c1_042/scenario.json+21
- data/c1_045/scenario.json+21
- data/c1_052/scenario.json+21
- data/c1_053/scenario.json+21
- data/c1_054/scenario.json+21
- data/c1_055/scenario.json+21
- data/c1_056/scenario.json+21
- data/c2_007/scenario.json+21
- data/c2_008/scenario.json+21
- data/c2_012/scenario.json+21
- data/c2_013/scenario.json+21
- data/c2_014/scenario.json+21
- data/c2_015/scenario.json+21
- data/c2_022/scenario.json+21
- data/c2_031/scenario.json+21
- data/c2_032/scenario.json+21
- data/c2_033/scenario.json+21
- data/c2_037/scenario.json+21
- data/c2_038/scenario.json+21
- data/c2_042/scenario.json+21
- data/c2_043/scenario.json+21
- data/c2_046/scenario.json+21
- data/c2_049/scenario.json+21
- data/c2_050/scenario.json+21
- data/c2_055/scenario.json+21
- data/c3_000/scenario.json+21
- data/c3_004/scenario.json+21
- data/c3_005/scenario.json+21
- data/c3_008/scenario.json+21
- data/c3_011/scenario.json+21
- data/c3_013/scenario.json+21
- data/c3_016/scenario.json+21
- data/c3_022/scenario.json+21
- data/c3_026/scenario.json+21
- torch_dataset.py+92-3
61 unmodified lines626364656667686970717273747576777879808182838485868788899091929364 unmodified lines15815916016116216316416516616716816917017161 unmodified lines `base_s0` over the union of both sparse key sets; rows with zero change omitted- `scorestats.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.parquet` additionally has `work_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`, `weight`- `cells.parquet` — regular 500 m grid over the network bounding box (grid definition in `scenario.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 first `home` activity, so agents cut by the scenario cutter (only `outside` activities) and freight agents are not residents. Source: the scenario's `output_plans.xml.gz` (plans after replanning, consistent with the measured loads; recorded in `scenario.json: demand.source`).- `od_cells.parquet` — `orig_cell, dest_cell, mode, trips` (sparse, trips > 0; cell −1 = outside the grid). `mode` is 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 minus `base_s0`.- `../cell_link_edges.parquet` (ONCE at the dataset root, identical for all scenarios): `cell_id, link_id, dist_m` for every pair with |cell centre − link midpoint| ≤ radius (see `cell_link_edges.json`).
## Operations
```bash64 unmodified linesloader = 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-linkpairs; `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 cellsinside 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) andNaN → 1. With `car_only=False` all 188 590 links are used. The network is the123456789101112131415{ "distance": "cell centre - link midpoint", "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "radius_m": 5000.0, "rows": 58881713}2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 0, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 1, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 1, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 1, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 1, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 1, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 1, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 1, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 1, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 1, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 1, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 1, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 1, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 1, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 1, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 1, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 1, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 1, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 1, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 1, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,21 unmodified lines22232425262728293031323334353637383940414243444546474821 unmodified lines "class": 2, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,23 unmodified lines24252627282930313233343536373839404142434445464748495023 unmodified lines "class": 2, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,12 unmodified lines13141516171819202122232425262728293031323334353637383912 unmodified lines "class": 2, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,19 unmodified lines20212223242526272829303132333435363738394041424344454619 unmodified lines "class": 2, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,12 unmodified lines13141516171819202122232425262728293031323334353637383912 unmodified lines "class": 2, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,16 unmodified lines17181920212223242526272829303132333435363738394041424316 unmodified lines "class": 2, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,20 unmodified lines21222324252627282930313233343536373839404142434445464720 unmodified lines "class": 2, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,8 unmodified lines910111213141516171819202122232425262728293031323334358 unmodified lines "class": 2, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,14 unmodified lines15161718192021222324252627282930313233343536373839404114 unmodified lines "class": 2, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,17 unmodified lines18192021222324252627282930313233343536373839404142434417 unmodified lines "class": 2, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,20 unmodified lines21222324252627282930313233343536373839404142434445464720 unmodified lines "class": 2, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,13 unmodified lines14151617181920212223242526272829303132333435363738394013 unmodified lines "class": 2, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,16 unmodified lines17181920212223242526272829303132333435363738394041424316 unmodified lines "class": 2, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,12 unmodified lines13141516171819202122232425262728293031323334353637383912 unmodified lines "class": 2, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,23 unmodified lines24252627282930313233343536373839404142434445464748495023 unmodified lines "class": 2, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,10 unmodified lines11121314151617181920212223242526272829303132333435363710 unmodified lines "class": 2, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,17 unmodified lines18192021222324252627282930313233343536373839404142434417 unmodified lines "class": 2, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,9 unmodified lines1011121314151617181920212223242526272829303132333435369 unmodified lines "class": 2, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19320, "n_trips": 68521, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 3, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 9820, "n_trips": 34543, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 200.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.005,2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 3, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 38756, "n_trips": 136982, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 50.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.02,2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 3, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19384, "n_trips": 68442, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 3, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 38756, "n_trips": 136982, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 50.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.02,2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 3, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19305, "n_trips": 68255, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 3, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 9704, "n_trips": 34190, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 200.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.005,2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 3, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 38756, "n_trips": 136982, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 50.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.02,2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 3, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 38756, "n_trips": 136982, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 50.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.02,2 unmodified lines345678910111213141516171819202122232425262728292 unmodified lines "class": 3, "closed_capacity": 1.0, "closed_freespeed": 1.0, "demand": { "cell_link_edges": "../cell_link_edges.parquet", "cell_link_radius_m": 5000.0, "cell_size_m": 500.0, "grid": { "cell_id": "iy * nx + ix", "cell_size_m": 500.0, "crs": "EPSG:2056", "n_cells": 13786, "nx": 113, "ny": 122, "x0": 2667500.0, "y0": 1222500.0 }, "n_persons": 19319, "n_trips": 68330, "source": "output_plans", "source_file": "output_plans.xml.gz", "status": "ok", "weight": 100.0 }, "eqasim_commit": "acf065f", "extent_prefix": "zurich_", "flowCapacityFactor": 0.01,14 unmodified lines1516171819202122232425262730 unmodified lines5859605461626364654 unmodified lines707172737475767715 unmodified lines9394959697989984 unmodified lines1841851861871761881891901912 unmodified lines1941951961971981992002012021872032042052061 unmodified line20820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227316 unmodified lines29029129229329429529629729829930030130230330430530630730830931031131214 unmodified lines sample.y_base [E, 24] same quantity in base_s0 (for delta losses); absent for baselines sample.scenario dict scenario.json (class, seeds, perturbation lists, sample_rate ...) sample.link_ids np.array of MATSim link ids (E,) with with_cells=True (default) additionally, from the demand tables: sample.cell_x [C, 12] cx, cy (normalised like x/y) + the 10 weighted cell counts (log1p) sample.cell_pos [C, 2] raw cell centres (EPSG:2056) sample.cell_link_index [2, M] (cell idx, edge idx) pairs within cell_link_max_dist (default: all, 5 km -> M = 57 M) sample.cell_link_dist [M] distance in m sample.od_index [2, K] (orig cell, dest cell) pairs with trips (cells inside the grid only) sample.od_trips [K, 3] all trips, car trips, AM-peak trips (weighted to 100 %)
Requirements: numpy, pandas, pyarrow, torch. Optional: torch_geometric, scipy(nearest-node assignment of persons; without scipy the two population node30 unmodified lines
def __init__(self, root, ids=None, classes=None, targets="vc_ratio", car_only=True, baseline_id="base_s0", with_baseline=True, clip_congestion=50.0, cache=True, as_pyg=True): clip_congestion=50.0, cache=True, as_pyg=True, with_cells=True, cell_link_max_dist=None): self.root = root self.data_dir = os.path.join(root, "data") self.targets = [targets] if isinstance(targets, str) else list(targets)4 unmodified lines self.cache = cache self.cache_dir = os.path.join(root, "cache_torch") self._pyg = _load_pyg() if as_pyg else None self.with_cells = with_cells and os.path.exists(os.path.join(root, "cell_link_edges.parquet")) self.cell_link_max_dist = cell_link_max_dist # e.g. 2000 -> only pairs within 2 km
man_path = os.path.join(root, "manifest.parquet") if os.path.exists(man_path):15 unmodified lines
self._build_static() self._base_y = None self._cell_static = None
# ------------------------------------------------------------------ static def _build_static(self):84 unmodified lines cp = self._cache_path(sid) if self.cache and os.path.exists(cp): z = np.load(cp) if not self.with_cells or "cell_x" in z: return z["x"], z["edge_attr"], z["y"] return z["x"], z["edge_attr"], z["y"] sdir = os.path.join(self.data_dir, sid) spec = json.load(open(os.path.join(sdir, "scenario.json"))) links = pd.read_parquet(os.path.join(sdir, "links.parquet"))2 unmodified lines x = np.concatenate([self.node_xy, self._node_pop(persons, spec["sample_rate"])], axis=1) ea = self._edge_attr(links) y = self._dense_targets(lh) extra = {} if self.with_cells: cell_x, cell_pos, od_index, od_trips = self._cell_arrays(sid) extra = dict(cell_x=cell_x, cell_pos=cell_pos, od_index=od_index, od_trips=od_trips) if self.cache: os.makedirs(self.cache_dir, exist_ok=True) np.savez_compressed(cp, x=x, edge_attr=ea, y=y) np.savez_compressed(cp, x=x, edge_attr=ea, y=y, **extra) return x, ea, y
def base_targets(self):1 unmodified line self._base_y = self._load_arrays(self.baseline_id)[2] return self._base_y
# ---------------------------------------------------------------- cells CELL_COLS = ["residents", "residents_employed", "residents_car_available", "residents_age_0_17", "residents_age_18_64", "residents_age_65plus", "jobs", "edu_places", "trips_origin", "trips_dest"]
def cell_static(self): """(cell idx, edge idx) pairs + distance within cell_link_max_dist (identical for all scenarios). First call reads the 59 M-row parquet via pyarrow and stores compact int32 arrays in cache_torch/; later calls take ~1 s.""" if self._cell_static is not None: return self._cell_static tag = "car" if self.car_only else "all" md = self.cell_link_max_dist cp = os.path.join(self.cache_dir, "cell_link_static_%s_%s.npz" % (tag, "all" if md is None else int(md))) if self.cache and os.path.exists(cp): z = np.load(cp) self._cell_static = (z["index"], z["dist"]) return self._cell_static import pyarrow.parquet as pq tb = pq.read_table(os.path.join(self.root, "cell_link_edges.parquet")) cells, pos, dist = [], [], [] for i in range(tb.num_columns and len(tb.column("link_id").chunks)): lc = tb.column("link_id").chunk(i) if hasattr(lc, "dictionary"): cat_pos = self._link_index.get_indexer(np.asarray(lc.dictionary).astype(str)) p_ = cat_pos[np.asarray(lc.indices)] else: p_ = self._link_index.get_indexer(np.asarray(lc).astype(str)) c_ = np.asarray(tb.column("cell_id").chunk(i)).astype(np.int32) d_ = np.asarray(tb.column("dist_m").chunk(i)).astype(np.float32) keep = p_ >= 0 if md is not None: keep &= d_ <= md cells.append(c_[keep]); pos.append(p_[keep].astype(np.int32)); dist.append(d_[keep]) index = np.stack([np.concatenate(cells), np.concatenate(pos)]) dist = np.concatenate(dist) if self.cache: os.makedirs(self.cache_dir, exist_ok=True) np.savez(cp, index=index, dist=dist) self._cell_static = (index, dist) return self._cell_static
def _cell_arrays(self, sid): sdir = os.path.join(self.data_dir, sid) c = pd.read_parquet(os.path.join(sdir, "cells.parquet")) xy = c[["cx", "cy"]].values cell_x = np.concatenate([((xy - self._xy_mean) / self._xy_std), np.log1p(c[self.CELL_COLS].values)], axis=1).astype(np.float32) od = pd.read_parquet(os.path.join(sdir, "od_cells.parquet")) am = pd.read_parquet(os.path.join(sdir, "od_cells_am.parquet")) od = od[(od.orig_cell >= 0) & (od.dest_cell >= 0)] am = am[(am.orig_cell >= 0) & (am.dest_cell >= 0)] g = od.groupby(["orig_cell", "dest_cell"]) tot = g.trips.sum() car = od[od["mode"].astype(str) == "car"].groupby(["orig_cell", "dest_cell"]).trips.sum() amt = am.groupby(["orig_cell", "dest_cell"]).trips.sum() tab = pd.DataFrame({"all": tot, "car": car, "am": amt}).fillna(0.0) od_index = np.array(list(tab.index), dtype=np.int64).T.reshape(2, -1) return cell_x, xy.astype(np.float32), od_index, tab.values.astype(np.float32)
# ------------------------------------------------------------------ API def __len__(self): return len(self.ids)16 unmodified lines } if self.with_baseline and sid != self.baseline_id: d["y_base"] = torch.from_numpy(self.base_targets()) if self.with_cells: z = np.load(self._cache_path(sid)) if self.cache else None if z is not None and "cell_x" in z: cell_x, cell_pos, od_index, od_trips = z["cell_x"], z["cell_pos"], z["od_index"], z["od_trips"] else: cell_x, cell_pos, od_index, od_trips = self._cell_arrays(sid) cli, cld = self.cell_static() d.update(cell_x=torch.from_numpy(cell_x), cell_pos=torch.from_numpy(cell_pos), cell_link_index=torch.from_numpy(cli.astype(np.int64)), cell_link_dist=torch.from_numpy(cld), od_index=torch.from_numpy(od_index), od_trips=torch.from_numpy(od_trips)) if self._pyg is not None: data = self._pyg(x=d["x"], edge_index=d["edge_index"], edge_attr=d["edge_attr"], y=d["y"]) if "y_base" in d: data.y_base = d["y_base"] for k in ("cell_x", "cell_pos", "cell_link_index", "cell_link_dist", "od_index", "od_trips"): if k in d: setattr(data, k, d[k]) data.scenario_id = sid data.scenario_class = d["scenario_class"] data.scenario = specREADME.md+34
cell_link_edges.jsonAdded+15
data/base_s3/scenario.json+21
data/c1_002/scenario.json+21
data/c1_003/scenario.json+21
data/c1_006/scenario.json+21
data/c1_010/scenario.json+21
data/c1_018/scenario.json+21
data/c1_023/scenario.json+21
data/c1_024/scenario.json+21
data/c1_029/scenario.json+21
data/c1_030/scenario.json+21
data/c1_035/scenario.json+21
data/c1_036/scenario.json+21
data/c1_037/scenario.json+21
data/c1_042/scenario.json+21
data/c1_045/scenario.json+21
data/c1_052/scenario.json+21
data/c1_053/scenario.json+21
data/c1_054/scenario.json+21
data/c1_055/scenario.json+21
data/c1_056/scenario.json+21
data/c2_007/scenario.json+21
data/c2_008/scenario.json+21
data/c2_012/scenario.json+21
data/c2_013/scenario.json+21
data/c2_014/scenario.json+21
data/c2_015/scenario.json+21
data/c2_022/scenario.json+21
data/c2_031/scenario.json+21
data/c2_032/scenario.json+21
data/c2_033/scenario.json+21
data/c2_037/scenario.json+21
data/c2_038/scenario.json+21
data/c2_042/scenario.json+21
data/c2_043/scenario.json+21
data/c2_046/scenario.json+21
data/c2_049/scenario.json+21
data/c2_050/scenario.json+21
data/c2_055/scenario.json+21
data/c3_000/scenario.json+21
data/c3_004/scenario.json+21
data/c3_005/scenario.json+21
data/c3_008/scenario.json+21
data/c3_011/scenario.json+21
data/c3_013/scenario.json+21
data/c3_016/scenario.json+21
data/c3_022/scenario.json+21
data/c3_026/scenario.json+21
torch_dataset.py+92-3