mamut_routing_tools.family.tw_synthesis¶
Stage-2 (VRPTW) synthesis of service times and time windows (v2, Stream 12').
The single implementation of the family's name-seeded synthesis (language-boundary tier 2). One service-time set exists per base, shared by every VRPTW instance and TDVRPTW subinstance. Three TW sets exist per base:
td-shared(the TD-paired set): route-centered over the static free-flow fastest travel times, seeded from the base name, shared verbatim (postbuild-tdrepair) by the plain VRPTW instance and every TDVRPTW subinstance. The v1 per-variant, TD-anchored synthesis is retired: anchoring windows on each traffic variant's own arrivals partially cancelled the traffic effect the family is built to measure.tight(static-only): same route-centered machinery and hence the same window centers astd-shared, but much narrower widths (a controlled width comparison over identical demand geometry).spread(static-only): window centers drawn uniformly over each customer's individually feasible interval, destroying the route structure (Solomon R-class flavor); widths follow thetd-shareddistribution.
The static-only sets are never audited under traffic and are not the TDVRPTW windows; they exist to widen the static VRPTW layer of the family.
Values are integer seconds (exact in binary64). Feasibility bounds at free
flow: a window [e, l] guarantees l >= t_0i (a vehicle leaving the
depot at the horizon start reaches the customer by l) and
l + s_i + t_i0 <= horizon end (starting service at l returns in
time). For td-shared, stage 3 (build-td) then certifies the complete
anchor routes under every traffic overlay and applies minimal shared deadline
lifts. The static-only sets are feasible by construction under the free-flow fastest
matrix (route-centered: the deterministic multi-route anchor serves everyone in-window;
spread: every customer is individually serveable, so singleton routes fit
the horizon) and receive no repair.
All randomness comes from random.Random seeded per base and TW set; the
windows are shipped data, never re-derived at load time.
synthesize_service_times
¶
Gaussian integer service times, mean ~1% of the horizon.
Source code in MAMUT-routing-tools/src/mamut_routing_tools/family/tw_synthesis.py
construct_anchor_routes
¶
construct_anchor_routes(
fastest: list[list[float]],
demands: list[int],
capacity: int,
service_times: list[int],
) -> tuple[list[list[int]], list[float]]
Build deterministic capacity-and-horizon-feasible TW anchor routes.
Every route starts at the depot at the horizon start. The next customer is the nearest unserved customer that respects capacity and still permits a direct return to the depot within the horizon. Ties break on customer index. The returned visit times are the free-flow arrivals independently simulated on those routes.
Source code in MAMUT-routing-tools/src/mamut_routing_tools/family/tw_synthesis.py
validate_static_anchor
¶
validate_static_anchor(
routes: list[list[int]],
fastest: list[list[float]],
demands: list[int],
capacity: int,
service_times: list[int],
time_windows: list[tuple[int, int]],
) -> None
Hard-check a static anchor certificate against its generated windows.
Source code in MAMUT-routing-tools/src/mamut_routing_tools/family/tw_synthesis.py
synthesize_time_windows
¶
synthesize_time_windows(
rng: Random,
fastest: list[list[float]],
service_times: list[int],
visit_times: list[float],
*,
width_ratio_mean: float = TW_WIDTH_RATIO_MEAN,
width_ratio_std: float = TW_WIDTH_RATIO_STD,
width_ratio_min: float = TW_WIDTH_RATIO_MIN,
width_ratio_max: float = TW_WIDTH_RATIO_MAX,
) -> list[tuple[int, int]]
Route-centered integer windows clamped to the free-flow feasibility bounds.
Defaults reproduce the td-shared set byte-for-byte; the tight set
passes the TIGHT_TW_WIDTH_RATIO_* parameters (same rng call sequence,
so identical seeds with identical widths give identical windows).
Source code in MAMUT-routing-tools/src/mamut_routing_tools/family/tw_synthesis.py
synthesize_time_windows_spread
¶
synthesize_time_windows_spread(
rng: Random,
fastest: list[list[float]],
service_times: list[int],
) -> list[tuple[int, int]]
Uniform-center integer windows (the static-only spread set).
Per customer, the width is drawn from the td-shared distribution and
the center uniformly over the customer's feasible interval (width first,
then center: the rng call order is part of the frozen policy). Clamping
is identical to the route-centered synthesis, so every window satisfies
the individual free-flow feasibility bounds by construction.