mamut_routing_tools.bks_campaign.plan¶
From a campaign spec to the list of runs still to do.
Every (instance, run entry, seed) becomes a task with its budget, objective
and run key. Tasks whose record already exists are done (resumption) unless the
instance file changed since that run (stale: they run again), tasks a solver
cannot take are listed with the reason instead of failing at run time, and
unavailable solvers are reported once. A key listed twice (repeated seeds, two
identical run entries) is planned once. Longest budgets go first so the tail
is short.
warm_start = "best" runs start from the campaign's best result so far, so
they are planned after every other run and the runner starts each one only
once the other runs of its instance and objective have finished. Their start
routes are looked up at that moment (best_known_routes), not here: a plan
made before the campaign ran would otherwise freeze the stored BKS as their
start.
Task
dataclass
¶
Task(
key: str,
campaign: str,
out: str,
instance_id: str,
instance_name: str,
instance_path: str,
num_customers: int,
problem_type: str,
objective: str,
kind: str,
solver: str,
seed: int,
time_limit_s: int,
memory_gb: float,
solvers_config: str | None = None,
options: dict[str, Any] = dict(),
warm_start: str = "none",
nice: int | None = None,
)
group
property
¶
What a warm start waits for: the other runs of this instance and objective.
default_memory_gb
¶
Rough RSS per run, from the Mamut2026 campaigns (PyVRP 1.6 GB at n = 4000; AILS-II -Xmx4g).
Source code in MAMUT-routing-tools/src/mamut_routing_tools/bks_campaign/plan.py
select_instances
¶
The instances the spec selects (DiscoveredBenchmarkInstance), static and TD alike.
Source code in MAMUT-routing-tools/src/mamut_routing_tools/bks_campaign/plan.py
archived_cost
¶
Recorded checker cost. Older campaign records kept only its display.
Source code in MAMUT-routing-tools/src/mamut_routing_tools/bks_campaign/plan.py
objective_rank
¶
Sort key of a solution under objective: fleet first for HierarchicalVehicleCost.
Source code in MAMUT-routing-tools/src/mamut_routing_tools/bks_campaign/plan.py
best_known_routes
¶
best_known_routes(
out: Path,
instance_path: Path,
instance_id: str,
objective: Any,
instance_sha256: str | None = None,
*,
archive: ArchiveIndex | None = None,
) -> tuple[list[list[int]] | None, str | None]
Routes of the best valid archived run or the stored BKS (warm starts), with their origin.
Runs of an older version of the instance file are ignored; "best" follows the objective
(fewer routes first under HierarchicalVehicleCost). Without archive, only the records
of this instance and objective are read from out (a worker about to start); the planner
passes its one-pass index (_valid_runs_by_group) instead.
Source code in MAMUT-routing-tools/src/mamut_routing_tools/bks_campaign/plan.py
build_plan
¶
build_plan(
spec: CampaignSpec,
*,
only: str | None = None,
retry_failed: bool = False,
) -> CampaignPlan
Expand the spec into tasks, skipping done runs and unsupported (instance, solver) pairs.
Source code in MAMUT-routing-tools/src/mamut_routing_tools/bks_campaign/plan.py
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 | |