Interface ScoreDirector<Solution_>
- Type Parameters:
Solution_- the solution type, the class with thePlanningSolutionannotation
- All Known Subinterfaces:
InnerScoreDirector<Solution_,,Score_> RevertableScoreDirector<Solution_>,VariableDescriptorAwareScoreDirector<Solution_>
- All Known Implementing Classes:
AbstractScoreDirector,BavetConstraintStreamScoreDirector,EasyScoreDirector,IncrementalScoreDirector,VariableChangeRecordingScoreDirector
public interface ScoreDirector<Solution_>
The ScoreDirector holds the
working solution
and calculates the Score for it.-
Method Summary
Modifier and TypeMethodDescriptiondefault voidafterEntityAdded(Object entity) Deprecated, for removal: This API element is subject to removal in a future version.Calling this method by user code is not recommended and will lead to unforeseen consequences.default voidafterEntityRemoved(Object entity) Deprecated, for removal: This API element is subject to removal in a future version.Calling this method by user code is not recommended and will lead to unforeseen consequences.voidafterListVariableChanged(Object entity, String variableName, int fromIndex, int toIndex) voidafterListVariableElementAssigned(Object entity, String variableName, Object element) voidafterListVariableElementUnassigned(Object entity, String variableName, Object element) default voidafterProblemFactAdded(Object problemFact) Deprecated, for removal: This API element is subject to removal in a future version.Calling this method by user code is not recommended and will lead to unforeseen consequences.default voidafterProblemFactRemoved(Object problemFact) Deprecated, for removal: This API element is subject to removal in a future version.Calling this method by user code is not recommended and will lead to unforeseen consequences.default voidafterProblemPropertyChanged(Object problemFactOrEntity) Deprecated, for removal: This API element is subject to removal in a future version.Calling this method by user code is not recommended and will lead to unforeseen consequences.voidafterVariableChanged(Object entity, String variableName) default voidbeforeEntityAdded(Object entity) Deprecated, for removal: This API element is subject to removal in a future version.Calling this method by user code is not recommended and will lead to unforeseen consequences.default voidbeforeEntityRemoved(Object entity) Deprecated, for removal: This API element is subject to removal in a future version.Calling this method by user code is not recommended and will lead to unforeseen consequences.voidbeforeListVariableChanged(Object entity, String variableName, int fromIndex, int toIndex) voidbeforeListVariableElementAssigned(Object entity, String variableName, Object element) voidbeforeListVariableElementUnassigned(Object entity, String variableName, Object element) default voidbeforeProblemFactAdded(Object problemFact) Deprecated, for removal: This API element is subject to removal in a future version.Calling this method by user code is not recommended and will lead to unforeseen consequences.default voidbeforeProblemFactRemoved(Object problemFact) Deprecated, for removal: This API element is subject to removal in a future version.Calling this method by user code is not recommended and will lead to unforeseen consequences.default voidbeforeProblemPropertyChanged(Object problemFactOrEntity) Deprecated, for removal: This API element is subject to removal in a future version.Calling this method by user code is not recommended and will lead to unforeseen consequences.voidbeforeVariableChanged(Object entity, String variableName) @NonNull Solution_ThePlanningSolutionthat is used to calculate theScore.<E> @Nullable ElookUpWorkingObject(@Nullable E externalObject) Translates an entity or fact instance (often from anotherThreador JVM) to thisScoreDirector's internal working instance.<E> @Nullable ElookUpWorkingObjectOrReturnNull(@Nullable E externalObject) As defined bylookUpWorkingObject(Object), but doesn't fail fast if no workingObject was ever added for the externalObject.void
-
Method Details
-
getWorkingSolution
@NonNull Solution_ getWorkingSolution()ThePlanningSolutionthat is used to calculate theScore.Because a
Scoreis best calculated incrementally (by deltas), theScoreDirectorneeds to be notified when itsworking solutionchanges. -
beforeVariableChanged
-
afterVariableChanged
-
beforeListVariableElementAssigned
-
afterListVariableElementAssigned
-
beforeListVariableElementUnassigned
-
afterListVariableElementUnassigned
-
beforeListVariableChanged
-
afterListVariableChanged
-
triggerVariableListeners
void triggerVariableListeners() -
beforeEntityAdded
Deprecated, for removal: This API element is subject to removal in a future version.Calling this method by user code is not recommended and will lead to unforeseen consequences. UseProblemChangeinstead. -
afterEntityAdded
Deprecated, for removal: This API element is subject to removal in a future version.Calling this method by user code is not recommended and will lead to unforeseen consequences. UseProblemChangeinstead. -
beforeEntityRemoved
Deprecated, for removal: This API element is subject to removal in a future version.Calling this method by user code is not recommended and will lead to unforeseen consequences. UseProblemChangeinstead. -
afterEntityRemoved
Deprecated, for removal: This API element is subject to removal in a future version.Calling this method by user code is not recommended and will lead to unforeseen consequences. UseProblemChangeinstead. -
beforeProblemFactAdded
Deprecated, for removal: This API element is subject to removal in a future version.Calling this method by user code is not recommended and will lead to unforeseen consequences. UseProblemChangeinstead. -
afterProblemFactAdded
Deprecated, for removal: This API element is subject to removal in a future version.Calling this method by user code is not recommended and will lead to unforeseen consequences. UseProblemChangeinstead. -
beforeProblemPropertyChanged
@Deprecated(forRemoval=true, since="1.8.0") default void beforeProblemPropertyChanged(Object problemFactOrEntity) Deprecated, for removal: This API element is subject to removal in a future version.Calling this method by user code is not recommended and will lead to unforeseen consequences. UseProblemChangeinstead. -
afterProblemPropertyChanged
@Deprecated(forRemoval=true, since="1.8.0") default void afterProblemPropertyChanged(Object problemFactOrEntity) Deprecated, for removal: This API element is subject to removal in a future version.Calling this method by user code is not recommended and will lead to unforeseen consequences. UseProblemChangeinstead. -
beforeProblemFactRemoved
@Deprecated(forRemoval=true, since="1.8.0") default void beforeProblemFactRemoved(Object problemFact) Deprecated, for removal: This API element is subject to removal in a future version.Calling this method by user code is not recommended and will lead to unforeseen consequences. UseProblemChangeinstead. -
afterProblemFactRemoved
@Deprecated(forRemoval=true, since="1.8.0") default void afterProblemFactRemoved(Object problemFact) Deprecated, for removal: This API element is subject to removal in a future version.Calling this method by user code is not recommended and will lead to unforeseen consequences. UseProblemChangeinstead. -
lookUpWorkingObject
<E> @Nullable E lookUpWorkingObject(@Nullable E externalObject) Translates an entity or fact instance (often from anotherThreador JVM) to thisScoreDirector's internal working instance. Useful for move rebasing and in aProblemChange.Matching is determined by the
LookUpStrategyTypeonPlanningSolution. Matching uses aPlanningIdby default.- Type Parameters:
E- the object type- Returns:
- null if externalObject is null
- Throws:
IllegalArgumentException- if there is no workingObject for externalObject, if it cannot be looked up or if the externalObject's class is not supportedIllegalStateException- if it cannot be looked up
-
lookUpWorkingObjectOrReturnNull
<E> @Nullable E lookUpWorkingObjectOrReturnNull(@Nullable E externalObject) As defined bylookUpWorkingObject(Object), but doesn't fail fast if no workingObject was ever added for the externalObject. It's recommended to uselookUpWorkingObject(Object)instead, especially in move rebasing code.- Type Parameters:
E- the object type- Returns:
- null if externalObject is null or if there is no workingObject for externalObject
- Throws:
IllegalArgumentException- if it cannot be looked up or if the externalObject's class is not supportedIllegalStateException- if it cannot be looked up
-