|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ScoreDirector
The ScoreDirector hold the Solution
workingSolution and calculates the score for that Solution
.
Method Summary | |
---|---|
void |
afterAllVariablesChanged(Object entity)
|
void |
afterEntityAdded(Object entity)
|
void |
afterEntityRemoved(Object entity)
|
void |
afterProblemFactAdded(Object problemFact)
|
void |
afterProblemFactChanged(Object problemFact)
|
void |
afterProblemFactRemoved(Object problemFact)
|
void |
afterVariableChanged(Object entity,
String variableName)
|
void |
assertWorkingScore(Score workingScore)
Asserts that if the Score is calculated for the current workingSolution,
it would be equal to the parameter workingScore. |
void |
beforeAllVariablesChanged(Object entity)
|
void |
beforeEntityAdded(Object entity)
|
void |
beforeEntityRemoved(Object entity)
|
void |
beforeProblemFactAdded(Object problemFact)
|
void |
beforeProblemFactChanged(Object problemFact)
|
void |
beforeProblemFactRemoved(Object problemFact)
|
void |
beforeVariableChanged(Object entity,
String variableName)
|
Score |
calculateScore()
Calculates the Score and updates the workingSolution accordingly. |
void |
dispose()
Needs to be called after use because some implementations needs to clean up their resources. |
long |
getCalculateCount()
|
ScoreDefinition |
getScoreDefinition()
|
ScoreDirectorFactory |
getScoreDirectorFactory()
|
SolutionDescriptor |
getSolutionDescriptor()
|
Object |
getTrailingEntity(PlanningVariableDescriptor chainedVariableDescriptor,
Object planningValue)
|
List<Object> |
getWorkingPlanningEntityList()
|
Solution |
getWorkingSolution()
The Solution that is used to calculate the Score . |
boolean |
isWorkingSolutionInitialized()
|
void |
setWorkingSolution(Solution workingSolution)
The workingSolution must never be the same instance as the bestSolution, it should be a (un)changed clone. |
Method Detail |
---|
ScoreDirectorFactory getScoreDirectorFactory()
SolutionDescriptor getSolutionDescriptor()
ScoreDefinition getScoreDefinition()
Solution getWorkingSolution()
Solution
that is used to calculate the Score
.
Because a Score
is best calculated incrementally (by delta's),
the ScoreDirector
needs to be notified when it's workingSolution changes.
If the Solution
has been changed since calculateScore()
has been called,
the Solution.getScore()
of this Solution
won't be correct.
void setWorkingSolution(Solution workingSolution)
workingSolution
- never nullvoid beforeEntityAdded(Object entity)
void afterEntityAdded(Object entity)
void beforeAllVariablesChanged(Object entity)
void afterAllVariablesChanged(Object entity)
void beforeVariableChanged(Object entity, String variableName)
void afterVariableChanged(Object entity, String variableName)
void beforeEntityRemoved(Object entity)
void afterEntityRemoved(Object entity)
void beforeProblemFactAdded(Object problemFact)
void afterProblemFactAdded(Object problemFact)
void beforeProblemFactChanged(Object problemFact)
void afterProblemFactChanged(Object problemFact)
void beforeProblemFactRemoved(Object problemFact)
void afterProblemFactRemoved(Object problemFact)
List<Object> getWorkingPlanningEntityList()
boolean isWorkingSolutionInitialized()
Score calculateScore()
Score
and updates the workingSolution accordingly.
Score
of the working solutionlong getCalculateCount()
Object getTrailingEntity(PlanningVariableDescriptor chainedVariableDescriptor, Object planningValue)
chainedVariableDescriptor
- never null, must be PlanningVariableDescriptor.isChained()
true
and known to the SolutionDescriptor
planningValue
- sometimes null
void assertWorkingScore(Score workingScore)
Score
is calculated for the current workingSolution,
it would be equal to the parameter workingScore.
Furthermore, if the assert fails, a score corruption analysis might be included in the exception message.
workingScore
- never nullScoreDirectorFactory.assertScore(Solution)
void dispose()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |