Can I set different termination for each dataset when I use SolverManager?

31 views
Skip to first unread message

Kent Zhang

unread,
Apr 14, 2022, 2:04:34 PM4/14/22
to OptaPlanner development
Hi, Teams.

The SolverManager is so great, especially it supports real-time planning now! There is another case I'm facing in my planning program.
When I used SolverManager to solve multiple datasets parallelly, Can I set different Termination for each dataset due to the size of the datasets ? 

Thank you !

Regards!

Geoffrey De Smet

unread,
Apr 15, 2022, 2:29:39 AM4/15/22
to optapla...@googlegroups.com, Kent Zhang

Short answer:
No, not currently :(

Workaround:
Build a new SolverFactory from an adjusted SolverConfig for each dataset.
But I wouldn't build a new SolverManager for this, as it would create a thread pool every time...
... which means you'd have to redo what SolverManager does.

Long answer:

The SolverManager has a single SolverFactory which was build from a single SolverConfig.
The SolverFactory API is designed to internalize the SolverConfig (which it doesn't really do much yet).
Internalizing allows building solvers faster by doing preparation work during solver factory creation (think KieBase creation etc).

Internalizing Termination isn't really worth it.
We should probably design a SolverConfigCustomizer or TerminationCustomizer callback
which can be registered to a SolverManager to allow customizing the solver created for a specific dataset.
This is not on the roadmap currently (no customer asking for it).

With kind regards,
Geoffrey De Smet

--
You received this message because you are subscribed to the Google Groups "OptaPlanner development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to optaplanner-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/optaplanner-dev/1d286b36-b16f-4012-8ede-3b2552c271f1n%40googlegroups.com.

Kent Zhang

unread,
Apr 16, 2022, 12:05:50 AM4/16/22
to OptaPlanner development
Oh, I see. Thank you, Geoffrey.
Reply all
Reply to author
Forward
0 new messages