|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Solution<S extends Score>
A Solution represents a problem and a possible solution of that problem. A possible solution does not need to optimal or even feasible. A Solution does not even have to be initialized with a possible solution.
A Solution is mutable. Drools Planner will continuously modify the same solution for scalability reasons and clone it to recall the best solution.
Method Summary | |
---|---|
Solution<S> |
cloneSolution()
Called by the Solver when the solution needs to be cloned,
for example to store a clone of the current solution as the best solution. |
Collection<? extends Object> |
getFacts()
Called by the Solver when the solution needs to be asserted into an empty WorkingMemory. |
S |
getScore()
Returns the Score of this Solution. |
void |
setScore(S score)
Called by the Solver when the Score of this Solution has been calculated. |
Method Detail |
---|
S getScore()
void setScore(S score)
Solver
when the Score of this Solution has been calculated.
score
- null if the Solution has changed and the new Score has not yet been recalculatedCollection<? extends Object> getFacts()
Solver
when the solution needs to be asserted into an empty WorkingMemory.
These facts can be used by the score rules.
Solution<S> cloneSolution()
Solver
when the solution needs to be cloned,
for example to store a clone of the current solution as the best solution.
A clone must also shallow copy the score.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |