|
Drools Planner distribution 6.0.0.Alpha9 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.drools.planner.core.solver.DefaultSolver
public class DefaultSolver
Default implementation for Solver
.
Solver
Field Summary | |
---|---|
protected BasicPlumbingTermination |
basicPlumbingTermination
|
protected BestSolutionRecaller |
bestSolutionRecaller
|
protected org.slf4j.Logger |
logger
|
protected Long |
randomSeed
|
protected ScoreDirectorFactory |
scoreDirectorFactory
|
protected SolverEventSupport |
solverEventSupport
|
protected List<SolverPhase> |
solverPhaseList
|
protected DefaultSolverScope |
solverScope
|
protected AtomicBoolean |
solving
|
protected Termination |
termination
|
Constructor Summary | |
---|---|
DefaultSolver()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final transient org.slf4j.Logger logger
protected SolverEventSupport solverEventSupport
protected ScoreDirectorFactory scoreDirectorFactory
protected Long randomSeed
protected BasicPlumbingTermination basicPlumbingTermination
protected Termination termination
protected BestSolutionRecaller bestSolutionRecaller
protected List<SolverPhase> solverPhaseList
protected AtomicBoolean solving
protected DefaultSolverScope solverScope
Constructor Detail |
---|
public DefaultSolver()
Method Detail |
---|
public long getRandomSeed()
public void setRandomSeed(long randomSeed)
public ScoreDirectorFactory getScoreDirectorFactory()
getScoreDirectorFactory
in interface Solver
public void setScoreDirectorFactory(ScoreDirectorFactory scoreDirectorFactory)
public void setBasicPlumbingTermination(BasicPlumbingTermination basicPlumbingTermination)
public void setTermination(Termination termination)
public void setBestSolutionRecaller(BestSolutionRecaller bestSolutionRecaller)
public List<SolverPhase> getSolverPhaseList()
public void setSolverPhaseList(List<SolverPhase> solverPhaseList)
public void setPlanningProblem(Solution planningProblem)
setPlanningProblem
in interface Solver
planningProblem
- never nullpublic Solution getBestSolution()
getBestSolution
in interface Solver
Solution
with a Score
null.public long getTimeMillisSpend()
Solver
getTimeMillisSpend
in interface Solver
public SolutionDescriptor getSolutionDescriptor()
public DefaultSolverScope getSolverScope()
public boolean isSolving()
Solver
isSolving
in interface Solver
Solver.solve()
method is still running.public boolean terminateEarly()
Solver
Solver.solve()
to actually return.
This method is thread-safe.
terminateEarly
in interface Solver
Solver.isTerminateEarly()
,
Future.cancel(boolean)
public boolean isTerminateEarly()
Solver
isTerminateEarly
in interface Solver
Future.isCancelled()
public boolean addProblemFactChange(ProblemFactChange problemFactChange)
Solver
ProblemFactChange
to be processed.
As a side-effect, this restarts the Solver
, effectively resetting all Termination
s,
but not Solver.terminateEarly()
.
This method is thread-safe.
Follows specifications of BlockingQueue.add(Object)
with by default
a capacity of Integer.MAX_VALUE
.
addProblemFactChange
in interface Solver
problemFactChange
- never null
Collection.add(E)
)public boolean isEveryProblemFactChangeProcessed()
Solver
ProblemFactChange
s have been processed.
This method is thread-safe.
isEveryProblemFactChangeProcessed
in interface Solver
ProblemFactChange
s left to dopublic final void solve()
Solver
Solver
early, call Solver.terminateEarly()
.
solve
in interface Solver
Solver.terminateEarly()
public void solvingStarted(DefaultSolverScope solverScope)
protected void runSolverPhases()
public void solvingEnded(DefaultSolverScope solverScope)
public void addEventListener(SolverEventListener eventListener)
addEventListener
in interface Solver
eventListener
- never nullpublic void removeEventListener(SolverEventListener eventListener)
removeEventListener
in interface Solver
eventListener
- never nullpublic void addSolverPhaseLifecycleListener(SolverPhaseLifecycleListener solverPhaseLifecycleListener)
public void removeSolverPhaseLifecycleListener(SolverPhaseLifecycleListener solverPhaseLifecycleListener)
|
Drools Planner distribution 6.0.0.Alpha9 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |