-
- All Superinterfaces:
Handler
- All Known Implementing Classes:
TimeoutOptimizationHandler
public interface OptimizationHandler extends Handler
Interface for an optimization handler.- Since:
- 2.1.0
- Version:
- 2.1.0
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleanaborted()Returns whether the computation was aborted by the handler.default booleanfoundBetterBound(Supplier<Assignment> currentResultProvider)This method is called when the solver found a better bound for the optimization.SATHandlersatHandler()Returns a SAT handler which can be used to cancel internal SAT calls of the optimization function.static SATHandlersatHandler(OptimizationHandler handler)Returns a SAT handler if the optimization handler is notnull.
-
-
-
Method Detail
-
satHandler
SATHandler satHandler()
Returns a SAT handler which can be used to cancel internal SAT calls of the optimization function.- Returns:
- a SAT handler
-
aborted
default boolean aborted()
Description copied from interface:HandlerReturns whether the computation was aborted by the handler.
-
foundBetterBound
default boolean foundBetterBound(Supplier<Assignment> currentResultProvider)
This method is called when the solver found a better bound for the optimization.- Parameters:
currentResultProvider- a provider for the current result, can be used to examine the current result or to use this result if the optimization should be aborted- Returns:
trueif the optimization process should be continued, otherwisefalse
-
satHandler
static SATHandler satHandler(OptimizationHandler handler)
Returns a SAT handler if the optimization handler is notnull.- Parameters:
handler- the optimization handler- Returns:
- The SAT handler if the optimization handler is not
null, otherwisenull
-
-