mamut_routing_lib.td.models¶
Pydantic models for time-dependent (TDVRPTW / TDVRP) benchmark instances.
TD instances have no static arc_costs matrix: travel is described by
per-arc arrival-time functions (ATFs) shipped in a sidecar file referenced by
the td block. The TDVRPTW variant carries service times and time windows;
the TDVRP variant keeps service times but has no time windows. Both share the
same ATF sidecar content.
AnyTDTravelModelRef
module-attribute
¶
AnyTDTravelModelRef = Annotated[TDArrivalFunctionsRef | TDIGPProfileRef | TDRoadGraphRef, Field(discriminator='model')]
AnyTDBenchmarkInstance
module-attribute
¶
TDArrivalFunctionsRef
¶
Bases: BaseModel
Reference to the ATF sidecar file of a TD instance.
atf_path is relative to the directory containing the instance file.
atf_sha256 is computed over the uncompressed canonical JSON bytes of
the sidecar, so it is stable across .json and .json.gz storage.
validate_atf_path
classmethod
¶
TDIGPProfileRef
¶
Bases: BaseModel
Compact IGP (Ichoua-Gendreau-Potvin 2003) time-dependent travel model.
Instead of shipping a consolidated ATF sidecar, the instance stores the
IGP data that fully determines it: contiguous time_periods (stored
absolute floats are canonical — never recomputed), a strictly positive
speeds matrix (num_categories x num_periods; FIFO by
construction), and a reference to the arc-category sidecar. The canonical
ATFs are materialized deterministically on load
(mamut_routing_lib.td.igp); atf_sha256 pins the materialized
canonical ATF bytes exactly as it would for a committed sidecar. See the
TD benchmark standard and the Lera2026 family design note.
validate_categories_path
classmethod
¶
validate_time_periods
classmethod
¶
Source code in MAMUT-routing-tools/MAMUT-routing-lib/src/mamut_routing_lib/td/models.py
validate_speeds
classmethod
¶
Source code in MAMUT-routing-tools/MAMUT-routing-lib/src/mamut_routing_lib/td/models.py
TDRoadGraphRef
¶
Bases: BaseModel
Compact road-network time-dependent travel model (format v2).
The instance references two sidecars, both collection-root-relative
and sha-pinned: the static road graph shared by every traffic subinstance
of the base (<base>.road.json.gz: trimmed subgraph with per-edge
free-flow speed_limit and vertex coordinates) and one traffic overlay
(<base>.traffic-<model>-<intensity>.json.gz: per-edge 24-bin speeds
aligned with the graph's edge order, clamped at free-flow). The canonical
ATFs are materialized deterministically on load
(mamut_routing_lib.td.roadgraph): pinned Dijkstra over the static
free-flow times, exact per-edge arrival functions from the overlay
speeds sampled exactly along the pinned paths on a fixed departure grid,
then deterministic decimation. sample_step and simplify_tolerance
are the authoritative materialization parameters and must equal the
values recorded in the road sidecar. atf_sha256 pins the materialized
canonical ATF bytes exactly as it would for a committed sidecar. See the
TD benchmark standard (road-graph v2).
BenchmarkInstanceTDVRPTW
¶
Bases: _TDInstanceValidationMixin
validate_time_window_lengths
classmethod
¶
Source code in MAMUT-routing-tools/MAMUT-routing-lib/src/mamut_routing_lib/td/models.py
BenchmarkInstanceTDVRP
¶
Bases: _TDInstanceValidationMixin