Package org.ddolib.lns.core.solver
Class LNSSolver<T>
java.lang.Object
org.ddolib.lns.core.solver.LNSSolver<T>
- All Implemented Interfaces:
Solver
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the set of decisions that lead to the best solution found by this solver, if any.minimize(Predicate<SearchStatistics> limit, BiConsumer<int[], SearchStatistics> onSolution) Minimizes the objective function according to the solver strategy.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ddolib.common.solver.Solver
constructSolution
-
Constructor Details
-
LNSSolver
-
-
Method Details
-
minimize
public Solution minimize(Predicate<SearchStatistics> limit, BiConsumer<int[], SearchStatistics> onSolution) Description copied from interface:SolverMinimizes the objective function according to the solver strategy.- Specified by:
minimizein interfaceSolver- Parameters:
limit- aPredicatethat can limit or stop the search based on currentSearchStatisticsonSolution- aBiConsumerinvoked on each new solution found; receives the solution array and current statistics- Returns:
- the statistics of the search after completion
-
bestValue
-
bestSolution
Description copied from interface:SolverReturns the set of decisions that lead to the best solution found by this solver, if any.- Specified by:
bestSolutionin interfaceSolver- Returns:
- an
Optionalcontaining the set ofDecisionobjects representing the best solution, or empty if no solution exists
-