Package org.optaplanner.constraint.drl
Class DrlScoreDirector<Solution_,Score_ extends org.optaplanner.core.api.score.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,org.optaplanner.core.api.score.director.ScoreDirector<Solution_>,org.optaplanner.core.impl.score.director.InnerScoreDirector<Solution_,Score_>
public class DrlScoreDirector<Solution_,Score_ extends org.optaplanner.core.api.score.Score<Score_>>
extends org.optaplanner.core.impl.score.director.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:
-
ScoreDirector
-
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(org.optaplanner.core.impl.domain.entity.descriptor.EntityDescriptor<Solution_> entityDescriptor, Object entity) voidafterEntityRemoved(org.optaplanner.core.impl.domain.entity.descriptor.EntityDescriptor<Solution_> entityDescriptor, Object entity) voidafterListVariableChanged(org.optaplanner.core.impl.domain.variable.descriptor.ListVariableDescriptor<Solution_> variableDescriptor, Object entity, int fromIndex, int toIndex) voidafterProblemFactAdded(Object problemFact) voidafterProblemFactRemoved(Object problemFact) voidafterProblemPropertyChanged(Object problemFactOrEntity) voidafterVariableChanged(org.optaplanner.core.impl.domain.variable.descriptor.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, 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
protected AbstractScoreHolder<Score_ extends org.optaplanner.core.api.score.Score<Score_>> 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 interfaceorg.optaplanner.core.impl.score.director.InnerScoreDirector<Solution_,Score_ extends org.optaplanner.core.api.score.Score<Score_>> - Overrides:
setWorkingSolutionin classorg.optaplanner.core.impl.score.director.AbstractScoreDirector<Solution_,Score_ extends org.optaplanner.core.api.score.Score<Score_>, DrlScoreDirectorFactory<Solution_, Score_ extends org.optaplanner.core.api.score.Score<Score_>>>
-
calculateScore
-
isConstraintMatchEnabled
public boolean isConstraintMatchEnabled() -
getConstraintMatchTotalMap
-
getIndictmentMap
-
requiresFlushing
public boolean requiresFlushing() -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceorg.optaplanner.core.impl.score.director.InnerScoreDirector<Solution_,Score_ extends org.optaplanner.core.api.score.Score<Score_>> - Overrides:
closein classorg.optaplanner.core.impl.score.director.AbstractScoreDirector<Solution_,Score_ extends org.optaplanner.core.api.score.Score<Score_>, DrlScoreDirectorFactory<Solution_, Score_ extends org.optaplanner.core.api.score.Score<Score_>>>
-
afterEntityAdded
-
afterVariableChanged
public void afterVariableChanged(org.optaplanner.core.impl.domain.variable.descriptor.VariableDescriptor<Solution_> variableDescriptor, Object entity) - Specified by:
afterVariableChangedin interfaceorg.optaplanner.core.impl.score.director.InnerScoreDirector<Solution_,Score_ extends org.optaplanner.core.api.score.Score<Score_>> - Overrides:
afterVariableChangedin classorg.optaplanner.core.impl.score.director.AbstractScoreDirector<Solution_,Score_ extends org.optaplanner.core.api.score.Score<Score_>, DrlScoreDirectorFactory<Solution_, Score_ extends org.optaplanner.core.api.score.Score<Score_>>>
-
afterListVariableChanged
public void afterListVariableChanged(org.optaplanner.core.impl.domain.variable.descriptor.ListVariableDescriptor<Solution_> variableDescriptor, Object entity, int fromIndex, int toIndex) - Specified by:
afterListVariableChangedin interfaceorg.optaplanner.core.impl.score.director.InnerScoreDirector<Solution_,Score_ extends org.optaplanner.core.api.score.Score<Score_>> - Overrides:
afterListVariableChangedin classorg.optaplanner.core.impl.score.director.AbstractScoreDirector<Solution_,Score_ extends org.optaplanner.core.api.score.Score<Score_>, DrlScoreDirectorFactory<Solution_, Score_ extends org.optaplanner.core.api.score.Score<Score_>>>
-
afterEntityRemoved
-
afterProblemFactAdded
- Specified by:
afterProblemFactAddedin interfaceorg.optaplanner.core.api.score.director.ScoreDirector<Solution_>- Overrides:
afterProblemFactAddedin classorg.optaplanner.core.impl.score.director.AbstractScoreDirector<Solution_,Score_ extends org.optaplanner.core.api.score.Score<Score_>, DrlScoreDirectorFactory<Solution_, Score_ extends org.optaplanner.core.api.score.Score<Score_>>>
-
afterProblemPropertyChanged
- Specified by:
afterProblemPropertyChangedin interfaceorg.optaplanner.core.api.score.director.ScoreDirector<Solution_>- Overrides:
afterProblemPropertyChangedin classorg.optaplanner.core.impl.score.director.AbstractScoreDirector<Solution_,Score_ extends org.optaplanner.core.api.score.Score<Score_>, DrlScoreDirectorFactory<Solution_, Score_ extends org.optaplanner.core.api.score.Score<Score_>>>
-
afterProblemFactRemoved
- Specified by:
afterProblemFactRemovedin interfaceorg.optaplanner.core.api.score.director.ScoreDirector<Solution_>- Overrides:
afterProblemFactRemovedin classorg.optaplanner.core.impl.score.director.AbstractScoreDirector<Solution_,Score_ extends org.optaplanner.core.api.score.Score<Score_>, DrlScoreDirectorFactory<Solution_, Score_ extends org.optaplanner.core.api.score.Score<Score_>>>
-