Package org.optaplanner.core.api.solver
Interface ProblemFactChange<Solution_>
-
- Type Parameters:
Solution_- the solution type, the class with thePlanningSolutionannotation
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface ProblemFactChange<Solution_>
A ProblemFactChange represents a change in 1 or more problem facts of aPlanningSolution. Problem facts used by aSolvermust not be changed while it is solving, but by scheduling this command to theSolver, you can change them when the time is right.Note that the
Solverclones aPlanningSolutionat will. So any change must be done on the problem facts and planning entities referenced by thePlanningSolutionof theScoreDirector. On each change it should also notify theScoreDirectoraccordingly.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddoChange(ScoreDirector<Solution_> scoreDirector)Does the change on thePlanningSolutionof theScoreDirectorand notifies theScoreDirectoraccordingly.
-
-
-
Method Detail
-
doChange
void doChange(ScoreDirector<Solution_> scoreDirector)
Does the change on thePlanningSolutionof theScoreDirectorand notifies theScoreDirectoraccordingly. Every modification to thePlanningSolution, must be correctly notified to theScoreDirector, otherwise theScorecalculation will be corrupted.- Parameters:
scoreDirector- never null Contains theworking solutionwhich contains the problem facts (andplanning entities) to change. Also needs to get notified of those changes.
-
-