Uploaded image for project: 'OptaPlanner'
  1. OptaPlanner
  2. PLANNER-1868

SolverManager needs an API that allows a user to listen to both best solution and solver terminated events

XMLWordPrintable

    • 2020 Week 13-15 (from Mar 23), 2020 Week 16-18 (from Apr 13), 2020 Week 19-21 (from May 4), 2020 Week 22-24 (from May 25), 2020 Week 25-27 (from Jun 15), 2020 Week 28-30 (from Jul 6)
    • 3
    • NEW
    • NEW

      Currently, there is no way to listen to both new best solution and solver terminated events; you can only do one or the other:

      solverManager.solve(id, finalBestSolutionListener)
      or
      solverManager.solveAndListen(id, bestSolutionListener)

      As such, it is hard to create a reactive publisher that let its consumers know both the latest solution and when the solver terminated (example: updating the UI of an application whenever the best solution is updated, but also show solver status in the UI).


      Proposal A

      solverManager.solveAndListen(
          ...,
          // For every new best solution event
          (bestSolution) -> send(bestSolution),
          // The solver terminated
          (bestSolution) -> end(),
          (exception) -> ...);
      

      Proposal B

      solverManager.solveAndListen(
          ...,
          // For every new best solution event
          (bestSolution) -> send(bestSolution),
          // The solver terminated
          () -> end(),
          (exception) -> ...);
      

            gdesmet@redhat.com Geoffrey De Smet (Inactive)
            cchianel Christopher Chianelli
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: