TimefoldAI / TimefoldAI/timefold-solver
Feat: A notification should be trigger when calculation terminated if solver with daemon
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.8k
- Forks
- 228
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 46
Description
sourced from #555
In one of my scenarios, real-time planning was used for task scheduling. I set the solver to Daemon to receive new tasks or delete tasks at any time. I set the termination so that when a solver reaches the stopping condition, the results will be output, for example, to a file or database. But when a solver is configured as a Daemon and starts planning through SolverManager.solveAndListen method. When a new bestSolution is found, the bestSolutionConsumer is called, and the finalBestSolutionConsumer has never been called. I had to serialize the results in the bestSolutionConsumer, but when the solver finds bestSolution frequently, serializing the results becomes a bottleneck. I also tried to start another thread to check the SolverStatus regularly, but unfortunately, when the solver is Daemon, SolverStatus is always SOLVING_ACTIVE, regardless of whether the calculation is running or not.
So, I sincerely recommended that a solver with Daemon could trigger an event, when its calculation terminated, to notify t the front-end thread.
Suggestion:
So, I sincerely recommended that a solver with Daemon could trigger an event, when its calculation terminated, to notify t the front-end thread.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with SolverManager.solveAndListen and trace how daemon mode handles bestSolutionConsumer, finalBestSolutionConsumer, and SolverStatus. Define how calculation termination should notify the front-end without serializing every best solution or relying on status polling; done means this behavior is documented and covered by an appropriate test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- ai, backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100