Class DroolsScoreDirectorFactory<Solution_>
- java.lang.Object
-
- org.optaplanner.core.impl.score.director.AbstractScoreDirectorFactory<Solution_>
-
- org.optaplanner.core.impl.score.director.drools.DroolsScoreDirectorFactory<Solution_>
-
- Type Parameters:
Solution_- the solution type, the class with thePlanningSolutionannotation
- All Implemented Interfaces:
InnerScoreDirectorFactory<Solution_>,ScoreDirectorFactory<Solution_>
- Direct Known Subclasses:
TestGenDroolsScoreDirectorFactory
public class DroolsScoreDirectorFactory<Solution_> extends AbstractScoreDirectorFactory<Solution_>
Drools implementation ofScoreDirectorFactory.- See Also:
DroolsScoreDirector,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 DroolsScoreDirectorFactory(SolutionDescriptor<Solution_> solutionDescriptor, org.kie.api.KieBase kieBase)Deprecated.for removal, legacy code.DroolsScoreDirectorFactory(SolutionDescriptor<Solution_> solutionDescriptor, org.kie.api.runtime.KieContainer kieContainer, String ksessionName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DroolsScoreDirector<Solution_>buildScoreDirector(boolean lookUpEnabled, boolean constraintMatchEnabledPreference)LikeInnerScoreDirectorFactory.buildScoreDirector(), but optionally disablesConstraintMatchtracking and look up for more performance (presuming theScoreDirectorimplementation actually supports it to begin with).protected voidcheckIfGlobalScoreHolderExists(org.kie.api.KieBase kieBase)protected voidcreateRuleToConstraintWeightExtractorMap(org.kie.api.KieBase kieBase)org.kie.api.runtime.KieContainergetKieContainer()StringgetKsessionName()Map<org.kie.api.definition.rule.Rule,Function<Solution_,Score<?>>>getRuleToConstraintWeightExtractorMap()org.kie.api.runtime.KieSessionnewKieSession()-
Methods inherited from class org.optaplanner.core.impl.score.director.AbstractScoreDirectorFactory
assertScoreFromScratch, buildScoreDirector, getAssertionScoreDirectorFactory, getInitializingScoreTrend, getScoreDefinition, getSolutionDescriptor, isAssertClonedSolution, setAssertClonedSolution, setAssertionScoreDirectorFactory, setInitializingScoreTrend
-
-
-
-
Constructor Detail
-
DroolsScoreDirectorFactory
@Deprecated public DroolsScoreDirectorFactory(SolutionDescriptor<Solution_> solutionDescriptor, org.kie.api.KieBase kieBase)
Deprecated.for removal, legacy code.- Parameters:
solutionDescriptor- never nullkieBase- never null
-
DroolsScoreDirectorFactory
public DroolsScoreDirectorFactory(SolutionDescriptor<Solution_> solutionDescriptor, org.kie.api.runtime.KieContainer kieContainer, String ksessionName)
- Parameters:
solutionDescriptor- never nullkieContainer- never nullksessionName- null if the default ksession should be used
-
-
Method Detail
-
checkIfGlobalScoreHolderExists
protected void checkIfGlobalScoreHolderExists(org.kie.api.KieBase kieBase)
-
createRuleToConstraintWeightExtractorMap
protected void createRuleToConstraintWeightExtractorMap(org.kie.api.KieBase kieBase)
-
getKieContainer
public org.kie.api.runtime.KieContainer getKieContainer()
-
getKsessionName
public String getKsessionName()
- Returns:
- null if the default ksession should be used
-
getRuleToConstraintWeightExtractorMap
public Map<org.kie.api.definition.rule.Rule,Function<Solution_,Score<?>>> getRuleToConstraintWeightExtractorMap()
-
buildScoreDirector
public DroolsScoreDirector<Solution_> buildScoreDirector(boolean lookUpEnabled, boolean constraintMatchEnabledPreference)
Description copied from interface:InnerScoreDirectorFactoryLikeInnerScoreDirectorFactory.buildScoreDirector(), but optionally disablesConstraintMatchtracking and look up for more performance (presuming theScoreDirectorimplementation actually supports it to begin with).- Parameters:
lookUpEnabled- true if aScoreDirectorimplementation should track all working objects forScoreDirector.lookUpWorkingObject(Object)constraintMatchEnabledPreference- false if aScoreDirectorimplementation should not doConstraintMatchtracking even if it supports it.- Returns:
- never null
- See Also:
ScoreDirector.isConstraintMatchEnabled(),ScoreDirector.getConstraintMatchTotalMap()
-
newKieSession
public org.kie.api.runtime.KieSession newKieSession()
-
-