Conversation
ThomSerg
left a comment
There was a problem hiding this comment.
Seems a nice quality-of-life improvement. But yeah, the one for exact seems hack-y, especially with the "warning" part. Is there a way to restore the solver afterwards?
|
Besides that it is never mentioned + silently enforced that "display" is only for optimization, it seems good to me. |
|
we could add the gcs callback also since that bug is fixed or not? |
…porting-intermediate-solutions # Conflicts: # cpmpy/solvers/z3.py
|
Made quite some changes to this PR after the last review, so maybe another round of revieuwing from @ThomSerg and/or @Wout4 would be appropriate before merging. I'm wondering if we should really fill the |
ThomSerg
left a comment
There was a problem hiding this comment.
Went through the entire thing again
| self.chc_solver.limit_time(str(time_limit) + "s") | ||
|
|
||
| if display is not None: | ||
| raise NotImplementedError("Choco does not support solution callbacks, (TODO?)") |
There was a problem hiding this comment.
What is on purpose to leave this "TODO" here?
There was a problem hiding this comment.
Choco in Java does have callbacking, so just leaving it here for if and when they implement callbacking directly from Python as well
There was a problem hiding this comment.
We could also implement it as in Exact, but there will be a lot more overhead in Choco (needs to pass trough C++ and Java...)
|
|
||
|
|
||
| if display is not None: | ||
| raise NotImplementedError("TODO: implement MiniZinc callbacks -- requires new async methhod (similar to solveAll())") |
There was a problem hiding this comment.
Meant to leave this TODO?
There was a problem hiding this comment.
MiniZinc does support it, but it requires quite a bit of engineering so better for another PR I think
|
Should be fine now @ThomSerg |
|
This PR has been stale for quite some time now, and not sure how to continue on it. |
|
I propose we do not add it for all solvers, but instead solver interfaces can choose to implement the display= function. So we would add it to the template and implement it for OrTools. But we would not attempt to make it work for all solvers. |
Following the discussion in #558.
It adds quite some code in all solver interfaces, but I tried to do it somewhat consistent.
Some solvers are missing still:
For Exact,it is somewhat hacky as we need to go through "runOnce" instead of the nice "toOptimal" function. So there will be some more ping-pong through the interface.