Solution_
- the solution type, the class with the PlanningSolution
annotationpublic interface ScoreDirector<Solution_>
working solution
and calculates the Score
for it.Solution_ getWorkingSolution()
PlanningSolution
that is used to calculate the Score
.
Because a Score
is best calculated incrementally (by deltas),
the ScoreDirector
needs to be notified when its working solution
changes.
If the working solution
has been changed since calculateScore()
was called,
its Score
won't be correct.
void setWorkingSolution(Solution_ workingSolution)
working solution
must never be the same instance as the
best solution
, it should be a (un)changed clone.
Only call this method on a separate ScoreDirector
instance,
built by Solver.getScoreDirectorFactory()
,
not on the one used inside the Solver
itself.
workingSolution
- never nullScore calculateScore()
Score
and updates the working solution
accordingly.Score
of the working solution
boolean isConstraintMatchEnabled()
getConstraintMatchTotals()
can be calledCollection<ConstraintMatchTotal> getConstraintMatchTotals()
Score
of calculateScore()
.IllegalStateException
- if isConstraintMatchEnabled()
returns falseMap<Object,List<ConstraintMatch>> extractIndictmentMap()
ConstraintMatch.getJustificationList()
.
TODO Experimental method because it's calculated from scratch, without delta's. It will probably be renamed at some point.
ConstraintMatch.getJustificationList()
and the value is its ConstraintMatch
IllegalStateException
- if isConstraintMatchEnabled()
returns falsevoid beforeEntityAdded(Object entity)
void afterEntityAdded(Object entity)
void beforeVariableChanged(VariableDescriptor variableDescriptor, Object entity)
void afterVariableChanged(VariableDescriptor variableDescriptor, Object entity)
void changeVariableFacade(VariableDescriptor variableDescriptor, Object entity, Object newValue)
void triggerVariableListeners()
void beforeEntityRemoved(Object entity)
void afterEntityRemoved(Object entity)
void beforeProblemFactAdded(Object problemFact)
void afterProblemFactAdded(Object problemFact)
void beforeProblemPropertyChanged(Object problemFactOrEntity)
void afterProblemPropertyChanged(Object problemFactOrEntity)
void beforeProblemFactRemoved(Object problemFact)
void afterProblemFactRemoved(Object problemFact)
void dispose()
Copyright © 2006–2016 JBoss by Red Hat. All rights reserved.