Search code examples
optimizationoptaplanneroptapy

Optapy Error "RuntimeError: An error occurred during solving. This can occur when functions take the wrong number of parameters"


I am working on an optapy project and I am getting this error in the solver phase.

return _unwrap_java_object(self._java_solve(wrapped_problem))
java.lang.java.lang.IllegalStateException: java.lang.IllegalStateException: Error occurred when wrapping object 
(Reservation(reservation_id = 1 for employee Employee(name = Karim test in team 1) on Dateslot 1 for 2020-01-01 00:00:00 at Seat bdc37e76-02ce-41c7-b68b-062dc64707e7 in room 8e20d743-180c-459a-9791-32751e65183d for team 1 code: B1))

And I got this runtime error:

RuntimeError: An error occurred during solving. This can occur when functions take the wrong number of parameters (ex: a setter that does not take exactly one parameter) or by a function returning an incompatible return type (ex: returning a str in a filter, which expects a bool). This can also occur when an exception 
is raised when evaluating constraints/getters/setters.

Any ideas to solve it ?


Solution

  • As mentioned by @Christopher Chianelli , ids as uuid are not supported yet by Optapy, So I just solved the problem using uuid as strings.