Modifier and Type | Field and Description |
---|---|
protected BasicPlumbingTermination |
basicPlumbingTermination |
protected BestSolutionRecaller |
bestSolutionRecaller |
protected boolean |
constraintMatchEnabledPreference |
protected EnvironmentMode |
environmentMode |
protected org.slf4j.Logger |
logger |
protected List<Phase> |
phaseList |
protected RandomFactory |
randomFactory |
protected InnerScoreDirectorFactory |
scoreDirectorFactory |
protected SolverEventSupport |
solverEventSupport |
protected DefaultSolverScope |
solverScope |
protected AtomicBoolean |
solving |
protected Termination |
termination |
Constructor and Description |
---|
DefaultSolver() |
protected final transient org.slf4j.Logger logger
protected SolverEventSupport solverEventSupport
protected EnvironmentMode environmentMode
protected RandomFactory randomFactory
protected boolean constraintMatchEnabledPreference
protected InnerScoreDirectorFactory scoreDirectorFactory
protected BasicPlumbingTermination basicPlumbingTermination
protected Termination termination
protected BestSolutionRecaller bestSolutionRecaller
protected AtomicBoolean solving
protected DefaultSolverScope solverScope
public EnvironmentMode getEnvironmentMode()
public void setEnvironmentMode(EnvironmentMode environmentMode)
public RandomFactory getRandomFactory()
public void setRandomFactory(RandomFactory randomFactory)
public boolean isConstraintMatchEnabledPreference()
public void setConstraintMatchEnabledPreference(boolean constraintMatchEnabledPreference)
public InnerScoreDirectorFactory getScoreDirectorFactory()
Solver
getScoreDirectorFactory
in interface Solver
public void setScoreDirectorFactory(InnerScoreDirectorFactory scoreDirectorFactory)
public void setBasicPlumbingTermination(BasicPlumbingTermination basicPlumbingTermination)
public void setTermination(Termination termination)
public BestSolutionRecaller getBestSolutionRecaller()
public void setBestSolutionRecaller(BestSolutionRecaller bestSolutionRecaller)
public DefaultSolverScope getSolverScope()
public Solution getBestSolution()
getBestSolution
in interface Solver
Solution
with a Score
null.public long getTimeMillisSpent()
getTimeMillisSpent
in interface Solver
public boolean isSolving()
Solver
isSolving
in interface Solver
Solver.solve(Solution)
method is still running.public boolean terminateEarly()
Solver
Solver.solve(Solution)
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
Solver
started.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 nullCollection.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(Solution planningProblem)
Solver
Solver
early, call Solver.terminateEarly()
.solve
in interface Solver
planningProblem
- never null, usually its planning variables are uninitializedSolver.terminateEarly()
public void outerSolvingStarted(DefaultSolverScope solverScope)
public void solvingStarted(DefaultSolverScope solverScope)
protected void runPhases()
public void solvingEnded(DefaultSolverScope solverScope)
public void outerSolvingEnded(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 addPhaseLifecycleListener(PhaseLifecycleListener phaseLifecycleListener)
public void removePhaseLifecycleListener(PhaseLifecycleListener phaseLifecycleListener)
Copyright © 2006–2015 JBoss by Red Hat. All rights reserved.