public interface InnerScoreDirector extends ScoreDirector
| Modifier and Type | Method and Description |
|---|---|
void |
assertExpectedWorkingScore(Score expectedWorkingScore,
Object completedAction)
Asserts that if the
Score is calculated for the current workingSolution
in the current ScoreDirector (with possibly incremental calculation residue),
it is equal to the parameter expectedWorkingScore. |
void |
assertVariableListenersDoNotAffectWorkingScore(Score expectedWorkingScore)
Asserts that if all
VariableListeners are forcibly triggered,
and therefore all shadow variables are updated if needed,
that the Score calculated for the workingSolution afterwards
is equal to the parameter expectedWorkingScore. |
void |
assertWorkingScoreFromScratch(Score workingScore,
Object completedAction)
Asserts that if the
Score is calculated for the current workingSolution
in a fresh ScoreDirector (with no incremental calculation residue),
it is equal to the parameter workingScore. |
ScoreDirector |
clone()
Clones this
ScoreDirector and its workingSolution. |
Solution |
cloneSolution(Solution originalSolution) |
Solution |
cloneWorkingSolution() |
int |
countWorkingSolutionUninitializedVariables() |
long |
getCalculateCount() |
ScoreDefinition |
getScoreDefinition() |
InnerScoreDirectorFactory |
getScoreDirectorFactory() |
SolutionDescriptor |
getSolutionDescriptor() |
SupplyManager |
getSupplyManager() |
Object |
getTrailingEntity(GenuineVariableDescriptor chainedVariableDescriptor,
Object planningValue) |
int |
getWorkingEntityCount() |
List<Object> |
getWorkingEntityList() |
long |
getWorkingEntityListRevision() |
int |
getWorkingValueCount() |
boolean |
isWorkingEntityListDirty(long expectedWorkingEntityListRevision) |
void |
resetCalculateCount() |
void |
setAllChangesWillBeUndoneBeforeStepEnds(boolean allChangesWillBeUndoneBeforeStepEnds)
Do not waste performance by propagating changes to step (or higher) mechanisms.
|
afterEntityAdded, afterEntityRemoved, afterProblemFactAdded, afterProblemFactChanged, afterProblemFactRemoved, afterVariableChanged, afterVariableChanged, beforeEntityAdded, beforeEntityRemoved, beforeProblemFactAdded, beforeProblemFactChanged, beforeProblemFactRemoved, beforeVariableChanged, beforeVariableChanged, calculateScore, changeVariableFacade, dispose, getConstraintMatchTotals, getWorkingSolution, isConstraintMatchEnabled, setWorkingSolutionlong getWorkingEntityListRevision()
isWorkingEntityListDirty(long) later onboolean isWorkingEntityListDirty(long expectedWorkingEntityListRevision)
expectedWorkingEntityListRevision - anInnerScoreDirectorFactory getScoreDirectorFactory()
SolutionDescriptor getSolutionDescriptor()
ScoreDefinition getScoreDefinition()
Solution cloneWorkingSolution()
Solution cloneSolution(Solution originalSolution)
originalSolution - never nullint getWorkingEntityCount()
>= 0List<Object> getWorkingEntityList()
int getWorkingValueCount()
>= 0int countWorkingSolutionUninitializedVariables()
long getCalculateCount()
void resetCalculateCount()
SupplyManager getSupplyManager()
ScoreDirector clone()
ScoreDirector and its workingSolution.
Use ScoreDirector.getWorkingSolution() to retrieve the workingSolution of that clone.
This is heavy method, because it usually breaks incremental score calculation. Use it sparingly. Therefore it's best to clone lazily by delaying the clone call as long as possible.
Object getTrailingEntity(GenuineVariableDescriptor chainedVariableDescriptor, Object planningValue)
chainedVariableDescriptor - never null, must be GenuineVariableDescriptor.isChained() true
and known to the SolutionDescriptorplanningValue - sometimes nullvoid setAllChangesWillBeUndoneBeforeStepEnds(boolean allChangesWillBeUndoneBeforeStepEnds)
allChangesWillBeUndoneBeforeStepEnds - true if all changes will be undonevoid assertExpectedWorkingScore(Score expectedWorkingScore, Object completedAction)
Score is calculated for the current workingSolution
in the current ScoreDirector (with possibly incremental calculation residue),
it is equal to the parameter expectedWorkingScore.
Used to assert that skipping ScoreDirector.calculateScore() (when the score is otherwise determined) is correct.
expectedWorkingScore - never nullcompletedAction - sometimes null, when assertion fails then the completedAction's Object.toString()
is included in the exception messagevoid assertVariableListenersDoNotAffectWorkingScore(Score expectedWorkingScore)
VariableListeners are forcibly triggered,
and therefore all shadow variables are updated if needed,
that the Score calculated for the workingSolution afterwards
is equal to the parameter expectedWorkingScore.
Used to assert that the shadow variables' state is consistent with the genuine variables' state.
expectedWorkingScore - never nullvoid assertWorkingScoreFromScratch(Score workingScore, Object completedAction)
Score is calculated for the current workingSolution
in a fresh ScoreDirector (with no incremental calculation residue),
it is equal to the parameter workingScore.
Furthermore, if the assert fails, a score corruption analysis might be included in the exception message.
workingScore - never nullcompletedAction - sometimes null, when assertion fails then the completedAction's Object.toString()
is included* in the exception messageInnerScoreDirectorFactory.assertScoreFromScratch(Solution)Copyright © 2006–2015 JBoss by Red Hat. All rights reserved.