Solution_ - the solution type, the class with the PlanningSolution annotation@FunctionalInterface public 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.
To add custom properties, configure custom properties and add public setters for them.
AbstractCustomPhaseCommand| Modifier and Type | Method and Description |
|---|---|
void |
changeWorkingSolution(ScoreDirector<Solution_> scoreDirector)
Changes
working solution of ScoreDirector.getWorkingSolution(). |
void 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–2020 JBoss by Red Hat. All rights reserved.