java.lang.Object
org.maxicp.search.AbstractSearchMethod<Runnable>
org.maxicp.search.RunnableSearchMethod
org.maxicp.search.DFSearch
- All Implemented Interfaces:
SearchMethod
Depth-First Search Branch and Bound implementation
-
Nested Class Summary
Nested classes/interfaces inherited from class org.maxicp.search.AbstractSearchMethod
AbstractSearchMethod.IntRef -
Field Summary
Fields inherited from class org.maxicp.search.AbstractSearchMethod
branching, failureListeners, sm, solutionListeners -
Constructor Summary
ConstructorsConstructorDescriptionDFSearch(ModelProxy modelProxy, Supplier<Runnable[]> branching) DFSearch(StateManager sm, Supplier<Runnable[]> branching) -
Method Summary
Modifier and TypeMethodDescriptionoptimize(Objective obj, DFSListener dfsListener) optimizeSubjectTo(Objective objToTighten, DFSListener dfsListener, Predicate<SearchStatistics> limit, Runnable subjectTo) voidsetDFSListener(DFSListener listener) solve(DFSListener dfsListener) Start the solving process with a given listener of the search process.protected voidstartSolve(SearchStatistics statistics, Predicate<SearchStatistics> limit, Runnable onNodeVisit) Start the solving process.Methods inherited from class org.maxicp.search.AbstractSearchMethod
allFixed, notifyFailure, notifySolution, onFailure, onSolution, optimize, optimize, optimize, optimize, optimizeSubjectTo, optimizeSubjectTo, replay, replaySubjectTo, replaySubjectTo, replaySubjectTo, solve, solve, solve, solveSubjectToMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.maxicp.search.SearchMethod
onFailure, onSolution
-
Constructor Details
-
DFSearch
-
DFSearch
-
-
Method Details
-
setDFSListener
-
startSolve
protected void startSolve(SearchStatistics statistics, Predicate<SearchStatistics> limit, Runnable onNodeVisit) Description copied from class:AbstractSearchMethodStart the solving process.This method must be implemented by subclasses and do the heavy work. It must call notifySolution/notifyFailure when a solution is found or a failure occurs.
- Specified by:
startSolvein classAbstractSearchMethod<Runnable>- Parameters:
statistics-limit-onNodeVisit- a closure to execute at each node visit
-
solve
Description copied from class:AbstractSearchMethodStart the solving process with a given listener of the search process.- Overrides:
solvein classAbstractSearchMethod<Runnable>- Parameters:
dfsListener- a listener of the search process- Returns:
- an object with the statistics on the search
-
optimize
-
optimizeSubjectTo
public SearchStatistics optimizeSubjectTo(Objective objToTighten, DFSListener dfsListener, Predicate<SearchStatistics> limit, Runnable subjectTo)
-