0

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 ?

  • Look like a bug. To verify, are you using the latest version of optapy (8.23.0a0)? Can you share your domain model and constraints? – Christopher Chianelli Aug 09 '22 at 18:11
  • Yes, I have the latest version of Optapy. This is my domain model: https://ideone.com/gdWH4P And this is my constraints file: https://ideone.com/2I2N7D – Karim Omrane Aug 10 '22 at 08:08
  • 1
    Found the issue: you are using uuid for @planning_id. As a workaround, you can use `str(self.id)` instead of `self.id` in the `get_id` method. Only `str` and `int` types are supported for `planning_id` currently in `optapy`. – Christopher Chianelli Aug 10 '22 at 14:25
  • @ChristopherChianelli Would you mind adding a link to the github issue for this? I presume we want to be able to support uuid as a planning ID? Or otherwise improve the error message. – Geoffrey De Smet Aug 12 '22 at 12:16

1 Answers1

0

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