Interface VariableDescriptorAwareScoreDirector<Solution_>
- All Superinterfaces:
ScoreDirector<Solution_>
- All Known Subinterfaces:
InnerScoreDirector<Solution_,,Score_> RevertableScoreDirector<Solution_>
- All Known Implementing Classes:
AbstractScoreDirector,BavetConstraintStreamScoreDirector,EasyScoreDirector,IncrementalScoreDirector,VariableChangeRecordingScoreDirector
-
Method Summary
Modifier and TypeMethodDescriptionvoidafterListVariableChanged(ListVariableDescriptor<Solution_> variableDescriptor, Object entity, int fromIndex, int toIndex) Notify the score director after a list variable changes.default voidafterListVariableChanged(Object entity, String variableName, int fromIndex, int toIndex) voidafterListVariableElementAssigned(ListVariableDescriptor<Solution_> variableDescriptor, Object element) Call this for each element that was assigned (added to a list variable of one entity without being removed from a list variable of another entity).default voidafterListVariableElementAssigned(Object entity, String variableName, Object element) voidafterListVariableElementUnassigned(ListVariableDescriptor<Solution_> variableDescriptor, Object element) Call this for each element that was unassigned (removed from a list variable of one entity without being added to a list variable of another entity).default voidafterListVariableElementUnassigned(Object entity, String variableName, Object element) voidafterVariableChanged(VariableDescriptor<Solution_> variableDescriptor, Object entity) default voidafterVariableChanged(Object entity, String variableName) voidbeforeListVariableChanged(ListVariableDescriptor<Solution_> variableDescriptor, Object entity, int fromIndex, int toIndex) Notify the score director before a list variable changes.default voidbeforeListVariableChanged(Object entity, String variableName, int fromIndex, int toIndex) voidbeforeListVariableElementAssigned(ListVariableDescriptor<Solution_> variableDescriptor, Object element) Call this for each element that will be assigned (added to a list variable of one entity without being removed from a list variable of another entity).default voidbeforeListVariableElementAssigned(Object entity, String variableName, Object element) voidbeforeListVariableElementUnassigned(ListVariableDescriptor<Solution_> variableDescriptor, Object element) Call this for each element that will be unassigned (removed from a list variable of one entity without being added to a list variable of another entity).default voidbeforeListVariableElementUnassigned(Object entity, String variableName, Object element) voidbeforeVariableChanged(VariableDescriptor<Solution_> variableDescriptor, Object entity) default voidbeforeVariableChanged(Object entity, String variableName) default voidchangeVariableFacade(VariableDescriptor<Solution_> variableDescriptor, Object entity, Object newValue) Methods inherited from interface ai.timefold.solver.core.api.score.director.ScoreDirector
afterEntityAdded, afterEntityRemoved, afterProblemFactAdded, afterProblemFactRemoved, afterProblemPropertyChanged, beforeEntityAdded, beforeEntityRemoved, beforeProblemFactAdded, beforeProblemFactRemoved, beforeProblemPropertyChanged, getWorkingSolution, lookUpWorkingObject, lookUpWorkingObjectOrReturnNull, triggerVariableListeners
-
Method Details
-
getSolutionDescriptor
SolutionDescriptor<Solution_> getSolutionDescriptor() -
beforeVariableChanged
-
afterVariableChanged
-
changeVariableFacade
default void changeVariableFacade(VariableDescriptor<Solution_> variableDescriptor, Object entity, Object newValue) -
beforeListVariableElementAssigned
void beforeListVariableElementAssigned(ListVariableDescriptor<Solution_> variableDescriptor, Object element) Call this for each element that will be assigned (added to a list variable of one entity without being removed from a list variable of another entity).- Parameters:
variableDescriptor- the list variable descriptorelement- the assigned element
-
afterListVariableElementAssigned
void afterListVariableElementAssigned(ListVariableDescriptor<Solution_> variableDescriptor, Object element) Call this for each element that was assigned (added to a list variable of one entity without being removed from a list variable of another entity).- Parameters:
variableDescriptor- the list variable descriptorelement- the assigned element
-
beforeListVariableElementUnassigned
void beforeListVariableElementUnassigned(ListVariableDescriptor<Solution_> variableDescriptor, Object element) Call this for each element that will be unassigned (removed from a list variable of one entity without being added to a list variable of another entity).- Parameters:
variableDescriptor- the list variable descriptorelement- the unassigned element
-
afterListVariableElementUnassigned
void afterListVariableElementUnassigned(ListVariableDescriptor<Solution_> variableDescriptor, Object element) Call this for each element that was unassigned (removed from a list variable of one entity without being added to a list variable of another entity).- Parameters:
variableDescriptor- the list variable descriptorelement- the unassigned element
-
beforeListVariableChanged
void beforeListVariableChanged(ListVariableDescriptor<Solution_> variableDescriptor, Object entity, int fromIndex, int toIndex) Notify the score director before a list variable changes.The list variable change includes:
- Changing position (index) of one or more elements.
- Removing one or more elements from the list variable.
- Adding one or more elements to the list variable.
- Any mix of the above.
fromIndex(inclusive) and ends attoIndex(exclusive).The range has to comply with the following contract:
fromIndexmust be greater than or equal to 0;toIndexmust be less than or equal to the list variable size.toIndexmust be greater than or equal tofromIndex.- The range must contain all elements that are going to be changed.
- The range is allowed to contain elements that are not going to be changed.
- The range may be empty (
fromIndexequalstoIndex) if none of the existing list variable elements are going to be changed.
beforeListVariableElementUnassigned(ListVariableDescriptor, Object)must be called for each element that will be unassigned (removed from a list variable of one entity without being added to a list variable of another entity).- Parameters:
variableDescriptor- descriptor of the list variable being changedentity- the entity owning the list variable being changedfromIndex- low endpoint (inclusive) of the changed rangetoIndex- high endpoint (exclusive) of the changed range
-
afterListVariableChanged
void afterListVariableChanged(ListVariableDescriptor<Solution_> variableDescriptor, Object entity, int fromIndex, int toIndex) Notify the score director after a list variable changes.The list variable change includes:
- Changing position (index) of one or more elements.
- Removing one or more elements from the list variable.
- Adding one or more elements to the list variable.
- Any mix of the above.
fromIndex(inclusive) and ends attoIndex(exclusive).The range has to comply with the following contract:
fromIndexmust be greater than or equal to 0;toIndexmust be less than or equal to the list variable size.toIndexmust be greater than or equal tofromIndex.- The range must contain all elements that have changed.
- The range is allowed to contain elements that have not changed.
- The range may be empty (
fromIndexequalstoIndex) if none of the existing list variable elements have changed.
afterListVariableElementUnassigned(ListVariableDescriptor, Object)must be called for each element that was unassigned (removed from a list variable of one entity without being added to a list variable of another entity).- Parameters:
variableDescriptor- descriptor of the list variable being changedentity- the entity owning the list variable being changedfromIndex- low endpoint (inclusive) of the changed rangetoIndex- high endpoint (exclusive) of the changed range
-
getVariableDescriptorCache
VariableDescriptorCache<Solution_> getVariableDescriptorCache() -
beforeVariableChanged
- Specified by:
beforeVariableChangedin interfaceScoreDirector<Solution_>
-
afterVariableChanged
- Specified by:
afterVariableChangedin interfaceScoreDirector<Solution_>
-
beforeListVariableElementAssigned
- Specified by:
beforeListVariableElementAssignedin interfaceScoreDirector<Solution_>
-
afterListVariableElementAssigned
- Specified by:
afterListVariableElementAssignedin interfaceScoreDirector<Solution_>
-
beforeListVariableElementUnassigned
default void beforeListVariableElementUnassigned(Object entity, String variableName, Object element) - Specified by:
beforeListVariableElementUnassignedin interfaceScoreDirector<Solution_>
-
afterListVariableElementUnassigned
- Specified by:
afterListVariableElementUnassignedin interfaceScoreDirector<Solution_>
-
beforeListVariableChanged
default void beforeListVariableChanged(Object entity, String variableName, int fromIndex, int toIndex) - Specified by:
beforeListVariableChangedin interfaceScoreDirector<Solution_>
-
afterListVariableChanged
default void afterListVariableChanged(Object entity, String variableName, int fromIndex, int toIndex) - Specified by:
afterListVariableChangedin interfaceScoreDirector<Solution_>
-