Class DroolsConstraintStreamScoreDirector<Solution_,Score_ extends Score<Score_>>
java.lang.Object
org.optaplanner.core.impl.score.director.AbstractScoreDirector<Solution_,Score_,DroolsConstraintStreamScoreDirectorFactory<Solution_,Score_>>
org.optaplanner.constraint.streams.drools.DroolsConstraintStreamScoreDirector<Solution_,Score_>
- Type Parameters:
Solution_- the solution type, the class with thePlanningSolutionannotation
- All Implemented Interfaces:
AutoCloseable,Cloneable,ScoreDirector<Solution_>,InnerScoreDirector<Solution_,Score_>
public final class DroolsConstraintStreamScoreDirector<Solution_,Score_ extends Score<Score_>>
extends AbstractScoreDirector<Solution_,Score_,DroolsConstraintStreamScoreDirectorFactory<Solution_,Score_>>
FP streams implementation of
ScoreDirector, which only recalculates the Score
of the part of the working solution that changed,
instead of the going through the entire PlanningSolution. This is incremental calculation, which is fast.- See Also:
-
Field Summary
Fields inherited from class org.optaplanner.core.impl.score.director.AbstractScoreDirector
allChangesWillBeUndoneBeforeStepEnds, calculationCount, constraintMatchEnabledPreference, logger, lookUpEnabled, lookUpManager, scoreDirectorFactory, variableListenerSupport, workingEntityListRevision, workingInitScore, workingSolution -
Constructor Summary
ConstructorsConstructorDescriptionDroolsConstraintStreamScoreDirector(DroolsConstraintStreamScoreDirectorFactory<Solution_, Score_> scoreDirectorFactory, boolean lookUpEnabled, boolean constraintMatchEnabledPreference) -
Method Summary
Modifier and TypeMethodDescriptionvoidafterEntityAdded(EntityDescriptor<Solution_> entityDescriptor, Object entity) voidafterEntityRemoved(EntityDescriptor<Solution_> entityDescriptor, Object entity) voidafterListVariableChanged(ListVariableDescriptor<Solution_> variableDescriptor, Object entity, int fromIndex, int toIndex) voidafterProblemFactAdded(Object problemFact) voidafterProblemFactRemoved(Object problemFact) voidafterProblemPropertyChanged(Object problemFactOrEntity) voidafterVariableChanged(VariableDescriptor<Solution_> variableDescriptor, Object entity) voidclose()booleanbooleanvoidsetWorkingSolution(Solution_ workingSolution) Methods inherited from class org.optaplanner.core.impl.score.director.AbstractScoreDirector
afterEntityAdded, afterEntityRemoved, afterListVariableChanged, afterListVariableElementAssigned, afterListVariableElementAssigned, afterListVariableElementUnassigned, afterListVariableElementUnassigned, afterVariableChanged, assertExpectedUndoMoveScore, assertExpectedWorkingScore, assertNonNullPlanningIds, assertPredictedScoreFromScratch, assertShadowVariablesAreNotStale, assertWorkingScoreFromScratch, beforeEntityAdded, beforeEntityAdded, beforeEntityRemoved, beforeEntityRemoved, beforeListVariableChanged, beforeListVariableChanged, beforeListVariableElementAssigned, beforeListVariableElementAssigned, beforeListVariableElementUnassigned, beforeListVariableElementUnassigned, beforeProblemFactAdded, beforeProblemFactRemoved, beforeProblemPropertyChanged, beforeVariableChanged, beforeVariableChanged, buildScoreCorruptionAnalysis, buildShadowVariableAnalysis, changeVariableFacade, clone, cloneSolution, cloneWorkingSolution, createChildThreadScoreDirector, doAndProcessMove, doAndProcessMove, forceTriggerVariableListeners, getCalculationCount, getScoreDefinition, getScoreDirectorFactory, getSolutionDescriptor, getSupplyManager, getWorkingEntityListRevision, getWorkingSolution, isConstraintConfiguration, isWorkingEntityListDirty, lookUpWorkingObject, lookUpWorkingObjectOrReturnNull, overwriteConstraintMatchEnabledPreference, resetCalculationCount, setAllChangesWillBeUndoneBeforeStepEnds, setCalculatedScore, setWorkingEntityListDirty, toString, triggerVariableListeners
-
Constructor Details
-
DroolsConstraintStreamScoreDirector
public DroolsConstraintStreamScoreDirector(DroolsConstraintStreamScoreDirectorFactory<Solution_, Score_> scoreDirectorFactory, boolean lookUpEnabled, boolean constraintMatchEnabledPreference)
-
-
Method Details
-
setWorkingSolution
- Specified by:
setWorkingSolutionin interfaceInnerScoreDirector<Solution_,Score_ extends Score<Score_>> - Overrides:
setWorkingSolutionin classAbstractScoreDirector<Solution_,Score_ extends Score<Score_>, DroolsConstraintStreamScoreDirectorFactory<Solution_, Score_ extends Score<Score_>>>
-
calculateScore
-
isConstraintMatchEnabled
public boolean isConstraintMatchEnabled() -
getConstraintMatchTotalMap
-
getIndictmentMap
-
requiresFlushing
public boolean requiresFlushing() -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceInnerScoreDirector<Solution_,Score_ extends Score<Score_>> - Overrides:
closein classAbstractScoreDirector<Solution_,Score_ extends Score<Score_>, DroolsConstraintStreamScoreDirectorFactory<Solution_, Score_ extends Score<Score_>>>
-
afterEntityAdded
- Overrides:
afterEntityAddedin classAbstractScoreDirector<Solution_,Score_ extends Score<Score_>, DroolsConstraintStreamScoreDirectorFactory<Solution_, Score_ extends Score<Score_>>>
-
afterVariableChanged
- Specified by:
afterVariableChangedin interfaceInnerScoreDirector<Solution_,Score_ extends Score<Score_>> - Overrides:
afterVariableChangedin classAbstractScoreDirector<Solution_,Score_ extends Score<Score_>, DroolsConstraintStreamScoreDirectorFactory<Solution_, Score_ extends Score<Score_>>>
-
afterListVariableChanged
public void afterListVariableChanged(ListVariableDescriptor<Solution_> variableDescriptor, Object entity, int fromIndex, int toIndex) - Specified by:
afterListVariableChangedin interfaceInnerScoreDirector<Solution_,Score_ extends Score<Score_>> - Overrides:
afterListVariableChangedin classAbstractScoreDirector<Solution_,Score_ extends Score<Score_>, DroolsConstraintStreamScoreDirectorFactory<Solution_, Score_ extends Score<Score_>>>
-
afterEntityRemoved
- Overrides:
afterEntityRemovedin classAbstractScoreDirector<Solution_,Score_ extends Score<Score_>, DroolsConstraintStreamScoreDirectorFactory<Solution_, Score_ extends Score<Score_>>>
-
afterProblemFactAdded
- Specified by:
afterProblemFactAddedin interfaceScoreDirector<Solution_>- Overrides:
afterProblemFactAddedin classAbstractScoreDirector<Solution_,Score_ extends Score<Score_>, DroolsConstraintStreamScoreDirectorFactory<Solution_, Score_ extends Score<Score_>>>
-
afterProblemPropertyChanged
- Specified by:
afterProblemPropertyChangedin interfaceScoreDirector<Solution_>- Overrides:
afterProblemPropertyChangedin classAbstractScoreDirector<Solution_,Score_ extends Score<Score_>, DroolsConstraintStreamScoreDirectorFactory<Solution_, Score_ extends Score<Score_>>>
-
afterProblemFactRemoved
- Specified by:
afterProblemFactRemovedin interfaceScoreDirector<Solution_>- Overrides:
afterProblemFactRemovedin classAbstractScoreDirector<Solution_,Score_ extends Score<Score_>, DroolsConstraintStreamScoreDirectorFactory<Solution_, Score_ extends Score<Score_>>>
-