Search code examples
optaplanner

Implement problem change on solver instance created from solverManager.solveAndListen() [Optaplanner version 8.14]


If I'm using the 8.14 version of Optaplanner, not considering the option to move to a later version. Is there a way for me to implement problem change(real-time planning) using the solver instance created from solverManager.solveAndlisten() not the solver.solve()?


Solution

  • No, in 8.14 it's not possible to do problem fact changes on the SolverManager.

    Either upgrade to 8.17 or use the workaround suggested in this answer: How to implement a problemFactChange while using optaplanner-spring-boot-starter?.

    The workaround injects SolverFactory, builds a Solver instance and uses solver.solve().