Package io.github.nhtc2005.alns.stopping
Interface StoppingCriterion<S extends Solution<S>>
- Type Parameters:
S- the solution type
- All Known Implementing Classes:
AnyOfStoppingCriterion,MaxIterations,MaxRuntime,NoImprovement
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Decides whether an ALNS search should stop before the next iteration.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidreset()Restores initial state before a solve begins.booleanshouldStop(StoppingContext<S> context) Checks whether the search should stop, including before the first iteration.
-
Method Details
-
shouldStop
Checks whether the search should stop, including before the first iteration.Implementations may update their own state but must not modify solutions in the context.
- Parameters:
context- the non-null search context- Returns:
trueto stop;falseto begin another iteration
-
reset
default void reset()Restores initial state before a solve begins.The default implementation does nothing.
-