|
||||||||||
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 Solver
public 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 Solver
startingSolution
- never nullpublic Solution getBestSolution()
getBestSolution
in interface Solver
public long getTimeMillisSpend()
Solver
getTimeMillisSpend
in interface Solver
public abstract AbstractSolverScope getAbstractSolverScope()
public boolean terminateEarly()
Solver
Solver.solve()
to actually return.
This method is thread-safe.
terminateEarly
in interface Solver
Solver.isTerminatedEarly()
,
Future.cancel(boolean)
public boolean isTerminatedEarly()
Solver
isTerminatedEarly
in interface Solver
Future.isCancelled()
public final void solve()
Solver
Solver
early, call Solver.terminateEarly()
.
solve
in interface Solver
Solver.terminateEarly()
protected abstract void solveImplementation()
public void solvingStarted(AbstractSolverScope abstractSolverScope)
public void addEventListener(SolverEventListener eventListener)
addEventListener
in interface Solver
eventListener
- never nullpublic void removeEventListener(SolverEventListener eventListener)
removeEventListener
in interface Solver
eventListener
- never null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |