Package org.optaplanner.constraint.drl
Class DrlScoreDirector<Solution_,Score_ extends Score<Score_>>
java.lang.Object
org.optaplanner.core.impl.score.director.AbstractScoreDirector<Solution_,Score_,DrlScoreDirectorFactory<Solution_,Score_>>
org.optaplanner.constraint.drl.DrlScoreDirector<Solution_,Score_>
- Type Parameters:
Solution_- the solution type, the class with thePlanningSolutionannotationScore_- the score type to go with the solution
- All Implemented Interfaces:
AutoCloseable,Cloneable,ScoreDirector<Solution_>,InnerScoreDirector<Solution_,Score_>
public class DrlScoreDirector<Solution_,Score_ extends Score<Score_>>
extends AbstractScoreDirector<Solution_,Score_,DrlScoreDirectorFactory<Solution_,Score_>>
Drools implementation of
ScoreDirector, which directs the Rule Engine to calculate the Score
of the working solution.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected org.kie.api.runtime.KieSessionprotected AbstractScoreHolder<Score_>Fields inherited from class org.optaplanner.core.impl.score.director.AbstractScoreDirector
allChangesWillBeUndoneBeforeStepEnds, calculationCount, constraintMatchEnabledPreference, logger, lookUpEnabled, lookUpManager, scoreDirectorFactory, variableListenerSupport, workingEntityListRevision, workingInitScore, workingSolution -
Constructor Summary
ConstructorsConstructorDescriptionDrlScoreDirector(DrlScoreDirectorFactory<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()org.kie.api.runtime.KieSessionbooleanbooleanvoidsetWorkingSolution(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
-
Field Details
-
GLOBAL_SCORE_HOLDER_KEY
- See Also:
-
kieSession
protected org.kie.api.runtime.KieSession kieSession -
scoreHolder
-
-
Constructor Details
-
DrlScoreDirector
public DrlScoreDirector(DrlScoreDirectorFactory<Solution_, Score_> scoreDirectorFactory, boolean lookUpEnabled, boolean constraintMatchEnabledPreference)
-
-
Method Details
-
getKieSession
public org.kie.api.runtime.KieSession getKieSession() -
setWorkingSolution
- Specified by:
setWorkingSolutionin interfaceInnerScoreDirector<Solution_,Score_ extends Score<Score_>> - Overrides:
setWorkingSolutionin classAbstractScoreDirector<Solution_,Score_ extends Score<Score_>, DrlScoreDirectorFactory<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_>, DrlScoreDirectorFactory<Solution_, Score_ extends Score<Score_>>>
-
afterEntityAdded
- Overrides:
afterEntityAddedin classAbstractScoreDirector<Solution_,Score_ extends Score<Score_>, DrlScoreDirectorFactory<Solution_, Score_ extends Score<Score_>>>
-
afterVariableChanged
- Specified by:
afterVariableChangedin interfaceInnerScoreDirector<Solution_,Score_ extends Score<Score_>> - Overrides:
afterVariableChangedin classAbstractScoreDirector<Solution_,Score_ extends Score<Score_>, DrlScoreDirectorFactory<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_>, DrlScoreDirectorFactory<Solution_, Score_ extends Score<Score_>>>
-
afterEntityRemoved
- Overrides:
afterEntityRemovedin classAbstractScoreDirector<Solution_,Score_ extends Score<Score_>, DrlScoreDirectorFactory<Solution_, Score_ extends Score<Score_>>>
-
afterProblemFactAdded
- Specified by:
afterProblemFactAddedin interfaceScoreDirector<Solution_>- Overrides:
afterProblemFactAddedin classAbstractScoreDirector<Solution_,Score_ extends Score<Score_>, DrlScoreDirectorFactory<Solution_, Score_ extends Score<Score_>>>
-
afterProblemPropertyChanged
- Specified by:
afterProblemPropertyChangedin interfaceScoreDirector<Solution_>- Overrides:
afterProblemPropertyChangedin classAbstractScoreDirector<Solution_,Score_ extends Score<Score_>, DrlScoreDirectorFactory<Solution_, Score_ extends Score<Score_>>>
-
afterProblemFactRemoved
- Specified by:
afterProblemFactRemovedin interfaceScoreDirector<Solution_>- Overrides:
afterProblemFactRemovedin classAbstractScoreDirector<Solution_,Score_ extends Score<Score_>, DrlScoreDirectorFactory<Solution_, Score_ extends Score<Score_>>>
-