v0.0.3
Upstream moved to PackingSolver 2a598481
- Anytime single-bin
boxstacks. Upstream fontanf/packingsolver#578 turns the sequential onedimensional rectangle algorithm into an anytime variant: under a time limit the solve no longer returns the truncated result of one fixed-size pass but grows its queues level by level and always holds the best complete solution found so far. On the 40' container of the examples the 10 s result went from about half the cargo to 1022 of 1036 items.
New API
progress_callback(#2) onbox.solve/boxstacks.solve: called on every improvement with an immutableProgressEvent(time, items, bins, profit, cost, upstream's label); returningFalsestops the solve (result.run.stop_reason == 'callback'). Exceptions raised in the callback propagate unchanged.stop_when_unimproved_for/stop_when_unimproved_after(#3): end an anytime solve once no improvement has arrived for the given number of seconds, optionally not before a given time;result.run.stop_reason == 'unimproved'.recommend_time_budget(instance, solver, alpha=None, speed=1.0)(#4) returns aTimeBudget— atime_limitthat is a loose upper bound plus matching stall-stop knobs — from a model fitted on 3158 recorded anytime curves, one interpretable formula per upstream algorithm path (algorithm_pathreplicates upstream's automatic selection).alphaweighs quality against waiting (4 balanced, 8 thorough; default 4 forbox, 8 forboxstacks),speedrescales for the machine. Also exported:DEFAULT_ALPHA,instance_features,count_stacks. The campaign, its figures and a replay of stopping policies live inexperiments/time_budget/; the docs gain Explanations / How the time budget is estimated and a how-to section.
Compatibility
- No breaking change: calls without the new keyword arguments behave as in 0.0.2, apart from the upstream anytime improvement above.
Wheels: CPython 3.7 to 3.14 on Linux x86_64 / aarch64, Windows AMD64 / ARM64, macOS arm64 / x86_64, built with PACKINGSOLVER_USE_HIGHS=ON, as before.