timefold-solver icon indicating copy to clipboard operation
timefold-solver copied to clipboard

Feat: Native support for non-disruptive replanning

Open triceo opened this issue 8 months ago • 0 comments

The current design pattern for non-disruptive replanning is for the user to remember the original value of a variable, and to penalize every difference. This is a lot of boilerplate, and there is technically nothing preventing the solver from doing the heavy lifting.

Idea:

  • New embedded shadow variable, values true/false.
  • Needs to work on both genuine entities (basic vars) and shadow entities (list var).
  • When a working solution is reset, starting values are remembered by the solver.
  • When a variable differs from the starting value, the shadow variable is set to true, otherwise it is false.

Things to pay extra attention to:

  • Multi-threaded solving and entity/value lookups.
  • Entities need to be compared by identity, facts by equality (think LocalDateTime).

Questions:

  • Should another embedded shadow var be introduced, for the previous version of the variable?
  • If so, how should it handle multi-var situations?

triceo avatar Mar 28 '25 12:03 triceo