Skip to content
Advertisement

Optapy error at “solver_manager_create(solver_config)”

I am trying to run solver_manager_create method as it shown in the quick start code in optapy repo (https://github.com/optapy/optapy-quickstarts/blob/04fd102ee31919cacc4145d0517fe07b2627ca02/employee-scheduling/services.py#L168)

JavaScript

But i am receiving a java.lang.IllegalArgumentException error.

Full Error:

JavaScript

what am i missing?

Advertisement

Answer

From the error message, it appears the constraint stream use one version of Shift, and the domain model use a DIFFERENT version of Shift. Do not redefine or define multiple versions of entity classes/problem fact classes: they will be considered distinct from one another. Note ...domain.Shift... (the one used by Constraint Streams) is different from ...shift_planning.domain.Shift... (the one used by the domain). Either use domain.Shift in your Constraint Stream or use shift_planning.domain.Shift in your domain.

Advertisement