|
OptaPlanner core 6.2.0.Beta3 | |||||||||
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 be optimal or even feasible. A Solution's variables do not even have to be initialized.
A Solution is mutable. For scalability reasons, the same Solution instance, called the working solution, is continuously modified. It's cloned to recall the best solution. This annotation described declarative properties of the planning solution. The planning solution class must implement this interface which is needed to get/set state. But the planning solution class must also be annotated withPlanningSolution
describes declarative properties.
Method Summary | |
---|---|
Collection<? extends Object> |
getProblemFacts()
Called by the DroolsScoreDirector when the Solution needs to be inserted
into an empty KieSession . |
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()
Score
of this Solution.
Score
is dirty the new Score
has not yet been recalculatedvoid 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> getProblemFacts()
DroolsScoreDirector
when the Solution
needs to be inserted
into an empty KieSession
.
These facts can be used by the score rules.
They don't change during planning (except through ProblemFactChange
events).
Do not include the planning entities as problem facts:
they are automatically inserted into the KieSession
if and only if they are initialized.
When they are initialized later, they are also automatically inserted.
|
OptaPlanner core 6.2.0.Beta3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |