public interface Solver
Modifier and Type | Method and Description |
---|---|
void |
addEventListener(SolverEventListener eventListener) |
boolean |
addProblemFactChange(ProblemFactChange problemFactChange)
Schedules a
ProblemFactChange to be processed. |
Solution |
getBestSolution() |
ScoreDirectorFactory |
getScoreDirectorFactory() |
long |
getTimeMillisSpend()
TODO timeMillisSpend should not continue to increase after the solver has been terminated
|
boolean |
isEveryProblemFactChangeProcessed()
Checks if all scheduled
ProblemFactChange s have been processed. |
boolean |
isSolving()
This method is thread-safe.
|
boolean |
isTerminateEarly()
This method is thread-safe.
|
void |
removeEventListener(SolverEventListener eventListener) |
void |
setPlanningProblem(Solution planningProblem) |
void |
solve()
Solves the planning problem.
|
boolean |
terminateEarly()
Notifies the solver that it should stop at its earliest convenience.
|
void setPlanningProblem(Solution planningProblem)
planningProblem
- never nullSolution getBestSolution()
long getTimeMillisSpend()
void solve()
Solver
early, call terminateEarly()
.terminateEarly()
boolean isSolving()
solve()
method is still running.boolean terminateEarly()
solve()
to actually return.
This method is thread-safe.isTerminateEarly()
,
Future.cancel(boolean)
boolean isTerminateEarly()
Future.isCancelled()
boolean addProblemFactChange(ProblemFactChange problemFactChange)
ProblemFactChange
to be processed.
As a side-effect, this restarts the Solver
, effectively resetting all Termination
s,
but not terminateEarly()
.
This method is thread-safe.
Follows specifications of BlockingQueue.add(Object)
with by default
a capacity of Integer.MAX_VALUE
.problemFactChange
- never nullCollection.add(E)
)boolean isEveryProblemFactChangeProcessed()
ProblemFactChange
s have been processed.
This method is thread-safe.ProblemFactChange
s left to dovoid addEventListener(SolverEventListener eventListener)
eventListener
- never nullvoid removeEventListener(SolverEventListener eventListener)
eventListener
- never nullScoreDirectorFactory getScoreDirectorFactory()
Copyright © 2006-2014 JBoss by Red Hat. All Rights Reserved.