Class EasyScoreDirector<Solution_>
- java.lang.Object
-
- org.optaplanner.core.impl.score.director.AbstractScoreDirector<Solution_,EasyScoreDirectorFactory<Solution_>>
-
- org.optaplanner.core.impl.score.director.easy.EasyScoreDirector<Solution_>
-
- Type Parameters:
Solution_
- the solution type, the class with thePlanningSolution
annotation
- All Implemented Interfaces:
AutoCloseable
,Cloneable
,InnerScoreDirector<Solution_>
,ScoreDirector<Solution_>
public class EasyScoreDirector<Solution_> extends AbstractScoreDirector<Solution_,EasyScoreDirectorFactory<Solution_>>
Easy java implementation ofScoreDirector
, which recalculates theScore
of theworking solution
every time. This is non-incremental calculation, which is slow. This score director implementation does not supportScoreDirector.getConstraintMatchTotals()
,ScoreDirector.getConstraintMatchTotalMap()
andScoreDirector.getIndictmentMap()
.- See Also:
ScoreDirector
-
-
Field Summary
-
Fields inherited from class org.optaplanner.core.impl.score.director.AbstractScoreDirector
allChangesWillBeUndoneBeforeStepEnds, calculationCount, constraintMatchEnabledPreference, logger, lookUpEnabled, lookUpManager, scoreDirectorFactory, variableListenerSupport, workingEntityListRevision, workingInitScore, workingSolution
-
-
Constructor Summary
Constructors Constructor Description EasyScoreDirector(EasyScoreDirectorFactory<Solution_> scoreDirectorFactory, boolean lookUpEnabled, boolean constraintMatchEnabledPreference, EasyScoreCalculator<Solution_,?> easyScoreCalculator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Score
calculateScore()
Calculates theScore
and updates theworking solution
accordingly.Map<String,ConstraintMatchTotal>
getConstraintMatchTotalMap()
ConstraintMatch
s are not supported by thisScoreDirector
implementation.Collection<ConstraintMatchTotal>
getConstraintMatchTotals()
ConstraintMatch
s are not supported by thisScoreDirector
implementation.EasyScoreCalculator<Solution_,?>
getEasyScoreCalculator()
Map<Object,Indictment>
getIndictmentMap()
ConstraintMatch
s are not supported by thisScoreDirector
implementation.boolean
isConstraintMatchEnabled()
Always false,ConstraintMatchTotal
s are not supported by thisScoreDirector
implementation.-
Methods inherited from class org.optaplanner.core.impl.score.director.AbstractScoreDirector
afterEntityAdded, afterEntityAdded, afterEntityRemoved, afterEntityRemoved, afterProblemFactAdded, afterProblemFactRemoved, afterProblemPropertyChanged, afterVariableChanged, afterVariableChanged, assertExpectedUndoMoveScore, assertExpectedWorkingScore, assertPredictedScoreFromScratch, assertShadowVariablesAreNotStale, assertWorkingScoreFromScratch, beforeEntityAdded, beforeEntityAdded, beforeEntityRemoved, beforeEntityRemoved, beforeProblemFactAdded, beforeProblemFactRemoved, beforeProblemPropertyChanged, beforeVariableChanged, beforeVariableChanged, buildScoreCorruptionAnalysis, buildShadowVariableAnalysis, changeVariableFacade, clone, cloneSolution, cloneWorkingSolution, close, createChildThreadScoreDirector, createShadowVariablesViolationMessage, doAndProcessMove, doAndProcessMove, explainScore, getCalculationCount, getScoreDefinition, getScoreDirectorFactory, getSolutionDescriptor, getSupplyManager, getWorkingEntityCount, getWorkingEntityList, getWorkingEntityListRevision, getWorkingSolution, getWorkingValueCount, isAllChangesWillBeUndoneBeforeStepEnds, isConstraintMatchEnabledPreference, isLookUpEnabled, isWorkingEntityListDirty, lookUpWorkingObject, lookUpWorkingObjectOrReturnNull, overwriteConstraintMatchEnabledPreference, resetCalculationCount, setAllChangesWillBeUndoneBeforeStepEnds, setCalculatedScore, setWorkingEntityListDirty, setWorkingSolution, toString, triggerVariableListeners
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.optaplanner.core.impl.score.director.ScoreDirector
dispose
-
-
-
-
Constructor Detail
-
EasyScoreDirector
public EasyScoreDirector(EasyScoreDirectorFactory<Solution_> scoreDirectorFactory, boolean lookUpEnabled, boolean constraintMatchEnabledPreference, EasyScoreCalculator<Solution_,?> easyScoreCalculator)
-
-
Method Detail
-
getEasyScoreCalculator
public EasyScoreCalculator<Solution_,?> getEasyScoreCalculator()
-
calculateScore
public Score calculateScore()
Description copied from interface:ScoreDirector
Calculates theScore
and updates theworking solution
accordingly.- Returns:
- never null, the
Score
of theworking solution
-
isConstraintMatchEnabled
public boolean isConstraintMatchEnabled()
Always false,ConstraintMatchTotal
s are not supported by thisScoreDirector
implementation.- Returns:
- false
-
getConstraintMatchTotals
public Collection<ConstraintMatchTotal> getConstraintMatchTotals()
ConstraintMatch
s are not supported by thisScoreDirector
implementation.- Returns:
- throws
IllegalStateException
- Throws:
IllegalStateException
- always- See Also:
ScoreDirector.getConstraintMatchTotalMap()
,ScoreDirector.getIndictmentMap()
-
getConstraintMatchTotalMap
public Map<String,ConstraintMatchTotal> getConstraintMatchTotalMap()
ConstraintMatch
s are not supported by thisScoreDirector
implementation.- Returns:
- throws
IllegalStateException
- Throws:
IllegalStateException
- always- See Also:
ScoreDirector.getIndictmentMap()
-
getIndictmentMap
public Map<Object,Indictment> getIndictmentMap()
ConstraintMatch
s are not supported by thisScoreDirector
implementation.- Returns:
- throws
IllegalStateException
- Throws:
IllegalStateException
- always- See Also:
ScoreDirector.getConstraintMatchTotalMap()
-
-