Solution_ - the solution type, the class with the PlanningSolution annotationpublic interface CustomPhaseCommand<Solution_>
Phase of the Solver that changes the planning variables.
Do not abuse to change the problems facts,
instead use Solver.addProblemFactChange(ProblemFactChange) for that.
An implementation must extend AbstractCustomPhaseCommand to ensure backwards compatibility in future versions.
AbstractCustomPhaseCommand| Modifier and Type | Method and Description |
|---|---|
void |
applyCustomProperties(Map<String,String> customPropertyMap)
Called during
SolverFactory.buildSolver(). |
void |
changeWorkingSolution(ScoreDirector<Solution_> scoreDirector)
Changes
working solution of ScoreDirector.getWorkingSolution(). |
void applyCustomProperties(Map<String,String> customPropertyMap)
SolverFactory.buildSolver().customPropertyMap - never nullIllegalArgumentException - if any of the properties are not supported or don't parse correctlyvoid changeWorkingSolution(ScoreDirector<Solution_> scoreDirector)
working solution of ScoreDirector.getWorkingSolution().
When the working solution is modified, the ScoreDirector must be correctly notified
(through ScoreDirector.beforeVariableChanged(Object, String) and
ScoreDirector.afterVariableChanged(Object, String)),
otherwise calculated Scores will be corrupted.
Don't forget to call ScoreDirector.triggerVariableListeners() after each set of changes
(especially before every ScoreDirector.calculateScore() call)
to ensure all shadow variables are updated.
scoreDirector - never null, the ScoreDirector that needs to get notified of the changes.Copyright © 2006–2016 JBoss by Red Hat. All rights reserved.