Class DrlScoreDirectorFactory<Solution_,Score_ extends Score<Score_>>
- java.lang.Object
-
- org.optaplanner.core.impl.score.director.AbstractScoreDirectorFactory<Solution_,Score_>
-
- org.optaplanner.core.impl.score.director.drl.DrlScoreDirectorFactory<Solution_,Score_>
-
- Type Parameters:
Solution_
- the solution type, the class with thePlanningSolution
annotationScore_
- the score type to go with the solution
- All Implemented Interfaces:
InnerScoreDirectorFactory<Solution_,Score_>
,ScoreDirectorFactory<Solution_>
- Direct Known Subclasses:
TestGenDrlScoreDirectorFactory
public class DrlScoreDirectorFactory<Solution_,Score_ extends Score<Score_>> extends AbstractScoreDirectorFactory<Solution_,Score_>
Drools implementation ofScoreDirectorFactory
.- See Also:
DrlScoreDirector
,ScoreDirectorFactory
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<org.kie.api.definition.rule.Rule,Function<Solution_,Score_>>
ruleToConstraintWeightExtractorMap
-
Fields inherited from class org.optaplanner.core.impl.score.director.AbstractScoreDirectorFactory
assertClonedSolution, assertionScoreDirectorFactory, initializingScoreTrend, logger, solutionDescriptor
-
-
Constructor Summary
Constructors Constructor Description DrlScoreDirectorFactory(SolutionDescriptor<Solution_> solutionDescriptor, org.kie.api.KieBase kieBase)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
assertGlobalScoreHolderExists(org.kie.api.KieBase kieBase)
DrlScoreDirector<Solution_,Score_>
buildScoreDirector(boolean lookUpEnabled, boolean constraintMatchEnabledPreference)
LikeInnerScoreDirectorFactory.buildScoreDirector()
, but optionally disablesConstraintMatch
tracking and look up for more performance (presuming theScoreDirector
implementation actually supports it to begin with).protected void
createRuleToConstraintWeightExtractorMap(org.kie.api.KieBase kieBase)
Map<org.kie.api.definition.rule.Rule,Function<Solution_,Score_>>
getRuleToConstraintWeightExtractorMap()
org.kie.api.runtime.KieSession
newKieSession()
-
Methods inherited from class org.optaplanner.core.impl.score.director.AbstractScoreDirectorFactory
assertScoreFromScratch, buildScoreDirector, getAssertionScoreDirectorFactory, getInitializingScoreTrend, getScoreDefinition, getSolutionDescriptor, isAssertClonedSolution, setAssertClonedSolution, setAssertionScoreDirectorFactory, setInitializingScoreTrend
-
-
-
-
Constructor Detail
-
DrlScoreDirectorFactory
public DrlScoreDirectorFactory(SolutionDescriptor<Solution_> solutionDescriptor, org.kie.api.KieBase kieBase)
- Parameters:
solutionDescriptor
- never nullkieBase
- never null
-
-
Method Detail
-
assertGlobalScoreHolderExists
protected void assertGlobalScoreHolderExists(org.kie.api.KieBase kieBase)
-
createRuleToConstraintWeightExtractorMap
protected void createRuleToConstraintWeightExtractorMap(org.kie.api.KieBase kieBase)
-
getRuleToConstraintWeightExtractorMap
public Map<org.kie.api.definition.rule.Rule,Function<Solution_,Score_>> getRuleToConstraintWeightExtractorMap()
-
buildScoreDirector
public DrlScoreDirector<Solution_,Score_> buildScoreDirector(boolean lookUpEnabled, boolean constraintMatchEnabledPreference)
Description copied from interface:InnerScoreDirectorFactory
LikeInnerScoreDirectorFactory.buildScoreDirector()
, but optionally disablesConstraintMatch
tracking and look up for more performance (presuming theScoreDirector
implementation actually supports it to begin with).- Parameters:
lookUpEnabled
- true if aScoreDirector
implementation should track all working objects forScoreDirector.lookUpWorkingObject(Object)
constraintMatchEnabledPreference
- false if aScoreDirector
implementation should not doConstraintMatch
tracking even if it supports it.- Returns:
- never null
- See Also:
InnerScoreDirector.isConstraintMatchEnabled()
,InnerScoreDirector.getConstraintMatchTotalMap()
-
newKieSession
public org.kie.api.runtime.KieSession newKieSession()
-
-