I am trying a generate a plot of optimality gap vs solution time. For that, I am trying to retrieve incumbent solution, best bound and solution time after every 5 iterations. But, for some reason, I am having issues with callback and I don’t get anything retrieved. Attached herewith are the images giving implementation of callback operation. Could anyone please tell where I am going wrong?
Best answer by Marcel Hunting
I would set a break-point inside the callback procedure to first check whether the callback procedure is called. To do so you should add
at the beginning of the callback procedure, and rerun the model.
Note that you installed an iteration callback but named it as a time callback, which is confusing. To install a time callback you should use the suffix CallbackTime instead of CallbackProcedure. By default the time callback is called every two seconds; the interval is controlled by the option Progress Time Interval.