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 |
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) |
boolean |
isWorkingSolutionInitialized() |
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
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()
List<Object> getWorkingEntityList()
int getWorkingValueCount()
int countWorkingSolutionUninitializedVariables()
boolean isWorkingSolutionInitialized()
workingSolution
is initializedlong getCalculateCount()
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 SolutionDescriptor
planningValue
- 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 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.