|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.drools.planner.core.solver.AbstractSolver
public abstract class AbstractSolver
Abstract superclass for Solver.
Solver,
DefaultLocalSearchSolver| Field Summary | |
|---|---|
protected BestSolutionRecaller |
bestSolutionRecaller
|
protected org.slf4j.Logger |
logger
|
protected Long |
randomSeed
|
protected SolverEventSupport |
solverEventSupport
|
protected StartingSolutionInitializer |
startingSolutionInitializer
|
protected AtomicBoolean |
terminatedEarly
|
| Constructor Summary | |
|---|---|
AbstractSolver()
|
|
| Method Summary | |
|---|---|
void |
addEventListener(SolverEventListener eventListener)
|
abstract AbstractSolverScope |
getAbstractSolverScope()
|
Solution |
getBestSolution()
|
ScoreDefinition |
getScoreDefinition()
|
StartingSolutionInitializer |
getStartingSolutionInitializer()
|
long |
getTimeMillisSpend()
TODO timeMillisSpend should not continue to increase after the solver has been terminated |
boolean |
isTerminatedEarly()
This method is thread-safe. |
void |
removeEventListener(SolverEventListener eventListener)
|
void |
setBestSolutionRecaller(BestSolutionRecaller bestSolutionRecaller)
|
void |
setRandomSeed(long randomSeed)
|
void |
setRuleBase(org.drools.RuleBase ruleBase)
|
void |
setScoreCalculator(ScoreCalculator scoreCalculator)
|
void |
setScoreDefinition(ScoreDefinition scoreDefinition)
|
void |
setStartingSolution(Solution startingSolution)
|
void |
setStartingSolutionInitializer(StartingSolutionInitializer startingSolutionInitializer)
|
void |
solve()
Solves the planning problem. |
protected abstract void |
solveImplementation()
|
void |
solvingStarted(AbstractSolverScope abstractSolverScope)
|
boolean |
terminateEarly()
Notifies the solver that it should stop at its earliest convenience. |
| 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 final AtomicBoolean terminatedEarly
protected Long randomSeed
protected StartingSolutionInitializer startingSolutionInitializer
protected BestSolutionRecaller bestSolutionRecaller
| Constructor Detail |
|---|
public AbstractSolver()
| Method Detail |
|---|
public void setRandomSeed(long randomSeed)
public void setRuleBase(org.drools.RuleBase ruleBase)
public ScoreDefinition getScoreDefinition()
getScoreDefinition in interface Solverpublic void setScoreDefinition(ScoreDefinition scoreDefinition)
public void setScoreCalculator(ScoreCalculator scoreCalculator)
public StartingSolutionInitializer getStartingSolutionInitializer()
public void setStartingSolutionInitializer(StartingSolutionInitializer startingSolutionInitializer)
public void setBestSolutionRecaller(BestSolutionRecaller bestSolutionRecaller)
public void setStartingSolution(Solution startingSolution)
setStartingSolution in interface SolverstartingSolution - never nullpublic Solution getBestSolution()
getBestSolution in interface Solverpublic long getTimeMillisSpend()
Solver
getTimeMillisSpend in interface Solverpublic abstract AbstractSolverScope getAbstractSolverScope()
public boolean terminateEarly()
SolverSolver.solve() to actually return.
This method is thread-safe.
terminateEarly in interface SolverSolver.isTerminatedEarly(),
Future.cancel(boolean)public boolean isTerminatedEarly()
Solver
isTerminatedEarly in interface SolverFuture.isCancelled()public final void solve()
SolverSolver early, call Solver.terminateEarly().
solve in interface SolverSolver.terminateEarly()protected abstract void solveImplementation()
public void solvingStarted(AbstractSolverScope abstractSolverScope)
public void addEventListener(SolverEventListener eventListener)
addEventListener in interface SolvereventListener - never nullpublic void removeEventListener(SolverEventListener eventListener)
removeEventListener in interface SolvereventListener - never null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||