I'm a bit wondering about how to implement repeated planning.
The document classifies into 3 situations. 'Backup planning', 'Continuous planning' and 'Real-time planning'.
If I'm not missing something, all optaplanner-examples (e.g. Nurse roastering) implement repeated planning using 'ProblemFactChange' which is described under 'Real-time planning'. That's fine. Solver.addProblemFactChange() will take care of the ProblemFactChange gracefully.
But it sounds like an approach for 'Real-time planning'. How should we implement 'Backup planning' / 'Continuous planning' in a simpler way?
To implement what is written in "15.2. Backup planning",
Then, when things go wrong (one of the employees calls in sick), change the planning facts on the original solution (delete the sick employee leave his/her shifts unassigned) and just restart the planning, starting from that solution, which has a different score now. The construction heuristics will fill in the newly created gaps (probably with the spare employee) and the metaheuristics will even improve it further.
I just:
- Terminate Solver
- Get BestSolution from the Solver
- Edit problem facts / planning entities in the BestSolution directly (don't care about ScoreDirector)
- Run the Solver again with the edited BestSolution
Is this a valid approach?