Optaplanner solver

50 views
Skip to first unread message

Patrick Ondreovici

unread,
Feb 3, 2023, 4:10:33 AM2/3/23
to OptaPlanner development
Hi, is there a way to make optaplanner do not stop, even if we don't have planning entities ?
Right now it is stopping when we start the solver without planning entities

Lukáš Petrovický

unread,
Feb 6, 2023, 6:39:09 AM2/6/23
to optapla...@googlegroups.com
Patrick,

the solver without planning entities has nothing to do. If it didn't stop, it would just loop doing no operations. (In fact, I'm not even sure *what* in the solver should loop, because there really is nothing that could run on no entities.)

I'm assuming the use case is starting a solver and waiting for a later problem change to actually insert some entities? If that's the case, I suggest that the code calling the problem change starts the solver instead.

Regards!


On Fri, Feb 3, 2023 at 10:10 AM Patrick Ondreovici <patrick.o...@rodeapps.com> wrote:
Hi, is there a way to make optaplanner do not stop, even if we don't have planning entities ?
Right now it is stopping when we start the solver without planning entities

--
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/4da2f32c-c195-44e6-8d90-673f0938c60an%40googlegroups.com.


--

Lukáš Petrovický

OptaPlanner Project Lead

lukas.pe...@redhat.com

My work week is Monday to Thursday.
No need to respond outside of your working hours.

Geoffrey De Smet

unread,
Feb 6, 2023, 7:30:52 AM2/6/23
to optapla...@googlegroups.com

Daemon mode is probably what you're looking for:
  https://www.optaplanner.org/docs/optaplanner/latest/repeated-planning/repeated-planning.html#daemon

Start with 0 planning entities, and add them with addProblemFactChange() as they come in.
Solve() never returns, but if termination is hit, the solver does stop consuming CPU resources until a new problem fact change comes in.

With kind regards,
Geoffrey De Smet

On 03/02/2023 10:10, Patrick Ondreovici wrote:
Hi, is there a way to make optaplanner do not stop, even if we don't have planning entities ?
Right now it is stopping when we start the solver without planning entities
Reply all
Reply to author
Forward
0 new messages