mamut_routing_tools.bks_campaign.harvest¶
Baseline, harvest and reports of a campaign.
write_baselinefreezes the stored BKS of every selected instance before the campaign (baseline.csv) and refuses to overwrite it: gains are measured against what was published, not against the campaign's own writes.harvestis the only step that writes BKS files, and it records what the store did even when it does not finish (a store error, a store process that died, Ctrl-C): BKS written before the failure are in the history. It sets aside the runs whose instance file changed. For each instance and objective, it reprices the distinct archived routes under the current exact profile, including routes checked by an earlier release. With a verified manifest it retains the TD arcs used by those routes. The lowest exact objective wins, with the first run key breaking ties. If the frozen baseline BKS bytes remain available, harvest also reprices its routes and offers a winner that matches or beats it. Otherwise it offers the winner directly.--offer-allskips the baseline filter. The store re-validates the selected routes, compares exact binary64 costs and keeps the incumbent on a tie. Every harvest is kept inharvests/<NNNN>-<time>.json;harvest.jsonis the latest one.write_reportswritesledger.csv(one row per run;bks_actionis what the store did with the run in any harvest,createdover a laterkept_existing) andcross-solver.csv(per instance: best per kind, gap to the best, seed spread), ranked by the checker cost recorded at run time.
write_baseline
¶
Snapshot the stored BKS of the selected instances into baseline.csv.
Source code in MAMUT-routing-tools/src/mamut_routing_tools/bks_campaign/harvest.py
harvest
¶
harvest(
spec: CampaignSpec,
*,
offer_all: bool = False,
dry_run: bool = False,
workers: int = 1,
) -> list[dict[str, Any]]
Offer each instance's best run to the BKS store (the campaign's only writer).
Source code in MAMUT-routing-tools/src/mamut_routing_tools/bks_campaign/harvest.py
harvest_history
¶
Every recorded harvest, oldest first: {"harvested": time, "results": [...]}.
Source code in MAMUT-routing-tools/src/mamut_routing_tools/bks_campaign/harvest.py
write_reports
¶
ledger.csv (one row per run) and cross-solver.csv (per instance and objective).