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 |
assertShadowVariablesAreNotStale(Score expectedWorkingScore,
Object completedAction)
Asserts that if all
VariableListener s are forcibly triggered,
and therefore all shadow variables are updated if needed,
that none of the shadow variables of the workingSolution change,
Then also asserts 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() |
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, setWorkingSolution, triggerVariableListeners
long 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()
>= 0
List<Object> getWorkingEntityList()
int getWorkingValueCount()
>= 0
int 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.
void 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 assertShadowVariablesAreNotStale(Score expectedWorkingScore, Object completedAction)
VariableListener
s are forcibly triggered,
and therefore all shadow variables are updated if needed,
that none of the shadow variables of the workingSolution
change,
Then also asserts 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 nullcompletedAction
- sometimes null, when assertion fails then the completedAction's Object.toString()
is included in the exception messagevoid 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–2016 JBoss by Red Hat. All rights reserved.