Solution_ - the solution type, the class with the PlanningSolution annotationpublic class BestSolutionChangedEvent<Solution_> extends EventObject
best solution changes during solving.
Delivered in the solver thread (which is the thread that calls Solver.solve(Solution_)).source| Constructor and Description |
|---|
BestSolutionChangedEvent(Solver<Solution_> solver,
long timeMillisSpent,
Solution_ newBestSolution,
Score newBestScore) |
| Modifier and Type | Method and Description |
|---|---|
Score |
getNewBestScore()
Returns the
Score of the getNewBestSolution(). |
Solution_ |
getNewBestSolution()
Note that:
In real-time planning, not all
ProblemFactChanges might be processed:
check isEveryProblemFactChangeProcessed(). |
long |
getTimeMillisSpent() |
boolean |
isEveryProblemFactChangeProcessed() |
boolean |
isNewBestSolutionInitialized()
Deprecated.
Use
getNewBestScore()'s Score.isSolutionInitialized() instead. Will be removed in 8.0. |
getSource, toStringpublic long getTimeMillisSpent()
>= 0, the amount of millis spent since the Solver started
until getNewBestSolution() was foundpublic Solution_ getNewBestSolution()
ProblemFactChanges might be processed:
check isEveryProblemFactChangeProcessed().PlanningSolution might be uninitialized: check Score.isSolutionInitialized().PlanningSolution might be infeasible: check FeasibilityScore.isFeasible().public Score getNewBestScore()
Score of the getNewBestSolution().
This is useful for generic code, which doesn't know the type of the PlanningSolution
to retrieve the Score from the getNewBestSolution() easily.
public boolean isEveryProblemFactChangeProcessed()
Solver.isEveryProblemFactChangeProcessed()Solver.isEveryProblemFactChangeProcessed()@Deprecated public boolean isNewBestSolutionInitialized()
getNewBestScore()'s Score.isSolutionInitialized() instead. Will be removed in 8.0.Copyright © 2006–2019 JBoss by Red Hat. All rights reserved.