Version 3.0.0
Changelog:
Generalised stopping criteria (thanks @leonlan!) . Whereas previously only a maximum number of iterations was supported, you can now also use a maximum runtime.
Stopping criteria are available in alns.stop
, and should be passed as the stop
argument to ALNS.iterate
. The stop
argument replaces iterations
.
Take the following example, using 10_000 iterations:
alns.iterate(..., iterations=10_000)
You would now write this as
from alns.stop import MaxIterations
alns.iterate(..., stop=MaxIterations(10_000))
In addition, alns.stop.MaxRuntime
lets you set a maximum runtime (in seconds). You can also write your own stopping criterion, by inheriting from alns.stop.StoppingCriterion
.
With the addition of stopping criteria, the old usage of the criteria
module for acceptance criteria has become imprecise. This is why alns.criteria
is now accessible as alns.accept
. To simplify the module names further, alns.weight_schemes
has been renamed to alns.weights
.
ALNS now has a code style: black! The style is now consistent, and will be enforced through the CI pipeline.
Example notebooks and documentation have been updated to the new usage.