Generate or convert a family¶
Generation lives in MAMUT-routing-tools, deliberately as a library: the CLI is per-instance
(generate single → derive-vrptw → derive-td), and a family is a per-campaign script calling the library so the
campaign's decisions are code under version control.
The Poryos2026 pipeline (mamut_routing_tools.family)¶
Per base instance (city × n × sampling method), three stages, each recorded in every artifact's generator block:
build_base(stagegenerate-base): full-city road graph, trimmed to the union of pinned free-flow fastest-path edges, both distance matrices, the indexed geo road cache; publishes the three slim CVRP metric instances (euclidean,shortest,fastest) plus thegeo,roadanddistances-*sidecars into the collection.derive_vrptw(stagederive-vrptw): name-seeded service times and time windows over the published fastest matrix; three TW sets (td-shared, the one the TD twins share;tightandspread, static only).build_td(stagebuild-td): aligns the six traffic overlays (bprandwavemodels × three intensities), materializes canonical ATFs, certifies anchor routes under every overlay, applies minimal shared deadline lifts, emits the twelve sha-pinned TD twins. Hard gates: the publisheddistances-fastestequals the road graph's free-flow times after rounding, and the post-lift audit holds for every overlay.
Naming and tree layout are in family/naming.py; family.materialize_distances rebuilds pinned matrices;
generation.bulk.generate_bulk_instances / preflight_rows drive many bases from a row table.
# the per-instance CLI, for one base
mamut-tools osm fetch-city Lyon --country France --profile generation --osm-dir work/osmdata # -> work/osmdata/Lyon.osm
mamut-tools generate single Lyon --osm-path work/osmdata/Lyon.osm --n 200 --output-dir work --vrptw
mamut-tools generate derive-td <folder> <base> --all # folder and base name as printed by `generate single`
The Mamut2026 design layer (mamut_routing_tools.campaign)¶
Before generating, decide which instances make a set worth reporting on:
city_profile: measure each city's road-network distortion from the Euclidean plane and stratify.poi_capacity: measure how many POI-only customers a city can supply (the 35 curated amenity categories).ladder: the size ladder (geometric n from 100 to 1000, one per rung) and rung → city → method assignment.design: enumerate a balanced candidate pool and evaluate cheaply (selection and demands, no matrices).select: max-min spread over the descriptor space under the coverage quotas ofquotas.py.
Then generation.single / family.build_base produce the artifacts. Record the plan files (profiles, capacities,
ladder) with the campaign script; the collection README documents the achieved coverage.
Converting an external distribution¶
conversion/blauth2024.py is the template: a pure relabeling (no numeric transformation, so the canonical bytes and
atf_sha256 pins are identical on any machine), the family contract spelled out in the module docstring (time unit,
horizon, depot window, service, capacity, fleet, objective and its constants), per-instance assertions for every
assumption, and a pointer to the design note. The command is `mamut-tools convert blauth2024