ibm-cloudcplexdocplexdocplexcloud

docplex with callback in dropsolve


Is it possible to solve a model that has a callback using model.solve(url=url, key=api)? I am trying an example similar to this but callback has no effect when called on dropsolve.


Solution

  • If that would be possible, it would be a performance disaster: for every invocation of the callback, the solve would have to call back from the cloud into your machine to invoke the callback. Since callbacks are usually invoked frequently, this would result in a lot of runtime overhead.

    What you can do instead is to submit your Python script using docplex to the DOcplexcloud. The full script is then executed on the cloud. In that case the callback will be invoked. You can find an example for this in the DOcplexcloud documentation Python API example.