|
OptaPlanner distribution 6.0.0.Beta2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.optaplanner.core.impl.score.director.AbstractScoreDirector<DroolsScoreDirectorFactory>
org.optaplanner.core.impl.score.director.drools.DroolsScoreDirector
public class DroolsScoreDirector
Drools implementation of ScoreDirector, which directs the Rule Engine to calculate the Score
of the Solution workingSolution.
ScoreDirector| Field Summary | |
|---|---|
static String |
GLOBAL_SCORE_HOLDER_KEY
|
protected org.kie.api.runtime.KieSession |
kieSession
|
protected ScoreHolder |
workingScoreHolder
|
| Fields inherited from class org.optaplanner.core.impl.score.director.AbstractScoreDirector |
|---|
calculateCount, chainedVariableToTrailingEntitiesMap, constraintMatchEnabledPreference, hasChainedVariables, logger, scoreDirectorFactory, workingSolution |
| Constructor Summary | |
|---|---|
DroolsScoreDirector(DroolsScoreDirectorFactory scoreDirectorFactory)
|
|
| Method Summary | |
|---|---|
void |
afterAllVariablesChanged(Object entity)
|
void |
afterEntityAdded(Object entity)
|
void |
afterEntityRemoved(Object entity)
|
void |
afterProblemFactAdded(Object problemFact)
|
void |
afterProblemFactChanged(Object problemFact)
|
void |
afterProblemFactRemoved(Object problemFact)
|
void |
afterVariableChanged(Object entity,
String variableName)
|
protected void |
appendLegacyConstraintOccurrences(StringBuilder analysis,
ScoreDirector corruptedScoreDirector,
ScoreDirector uncorruptedScoreDirector)
Deprecated. |
Score |
calculateScore()
Calculates the Score and updates the workingSolution accordingly. |
AbstractScoreDirector |
clone()
Clones this ScoreDirector and its workingSolution. |
void |
dispose()
Needs to be called after use because some implementations needs to clean up their resources. |
Collection<ConstraintMatchTotal> |
getConstraintMatchTotals()
|
protected org.kie.api.KieBase |
getKieBase()
|
org.kie.api.runtime.KieSession |
getKieSession()
|
Collection<Object> |
getWorkingFacts()
|
boolean |
isConstraintMatchEnabled()
|
void |
setWorkingSolution(Solution workingSolution)
The workingSolution must never be the same instance as the bestSolution,
it should be a (un)changed clone. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String GLOBAL_SCORE_HOLDER_KEY
protected org.kie.api.runtime.KieSession kieSession
protected ScoreHolder workingScoreHolder
| Constructor Detail |
|---|
public DroolsScoreDirector(DroolsScoreDirectorFactory scoreDirectorFactory)
| Method Detail |
|---|
protected org.kie.api.KieBase getKieBase()
public org.kie.api.runtime.KieSession getKieSession()
public void setWorkingSolution(Solution workingSolution)
ScoreDirectorworkingSolution must never be the same instance as the bestSolution,
it should be a (un)changed clone.
setWorkingSolution in interface ScoreDirectorsetWorkingSolution in class AbstractScoreDirector<DroolsScoreDirectorFactory>workingSolution - never nullpublic Collection<Object> getWorkingFacts()
public void afterEntityAdded(Object entity)
afterEntityAdded in interface ScoreDirectorafterEntityAdded in class AbstractScoreDirector<DroolsScoreDirectorFactory>public void afterAllVariablesChanged(Object entity)
afterAllVariablesChanged in interface ScoreDirectorafterAllVariablesChanged in class AbstractScoreDirector<DroolsScoreDirectorFactory>
public void afterVariableChanged(Object entity,
String variableName)
afterVariableChanged in interface ScoreDirectorafterVariableChanged in class AbstractScoreDirector<DroolsScoreDirectorFactory>public void afterEntityRemoved(Object entity)
afterEntityRemoved in interface ScoreDirectorafterEntityRemoved in class AbstractScoreDirector<DroolsScoreDirectorFactory>public void afterProblemFactAdded(Object problemFact)
afterProblemFactAdded in interface ScoreDirectorafterProblemFactAdded in class AbstractScoreDirector<DroolsScoreDirectorFactory>public void afterProblemFactChanged(Object problemFact)
afterProblemFactChanged in interface ScoreDirectorafterProblemFactChanged in class AbstractScoreDirector<DroolsScoreDirectorFactory>public void afterProblemFactRemoved(Object problemFact)
afterProblemFactRemoved in interface ScoreDirectorafterProblemFactRemoved in class AbstractScoreDirector<DroolsScoreDirectorFactory>public Score calculateScore()
ScoreDirectorScore and updates the workingSolution accordingly.
Score of the workingSolutionpublic boolean isConstraintMatchEnabled()
isConstraintMatchEnabled in interface ScoreDirectorisConstraintMatchEnabled in class AbstractScoreDirector<DroolsScoreDirectorFactory>ScoreDirector.getConstraintMatchTotals() can be calledpublic Collection<ConstraintMatchTotal> getConstraintMatchTotals()
getConstraintMatchTotals in interface ScoreDirectorgetConstraintMatchTotals in class AbstractScoreDirector<DroolsScoreDirectorFactory>public AbstractScoreDirector clone()
ScoreDirectorScoreDirector and its workingSolution.
Use ScoreDirector.getWorkingSolution() to retrieve the workingSolution of that clone.
This is heavy method, because it usually breaks incremental score calculation. Use it sparingly.
Therefore it's best to clone lazily by delaying the clone call as long as possible.
clone in interface ScoreDirectorclone in class AbstractScoreDirector<DroolsScoreDirectorFactory>
@Deprecated
protected void appendLegacyConstraintOccurrences(StringBuilder analysis,
ScoreDirector corruptedScoreDirector,
ScoreDirector uncorruptedScoreDirector)
appendLegacyConstraintOccurrences in class AbstractScoreDirector<DroolsScoreDirectorFactory>public void dispose()
ScoreDirector
dispose in interface ScoreDirectordispose in class AbstractScoreDirector<DroolsScoreDirectorFactory>
|
OptaPlanner distribution 6.0.0.Beta2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||