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
DebuggerBreakPoint;
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.
Hi, Marcel.
You are right. I am using time callback after every 5 seconds.
I will try to implement your suggestion on break-point and see whether the callback procedure is called.
Thanks.
Any comments on the code in the callback procedure body?
Sujit
Marcel,
I added a debugger break point and the procedure is being called.
However, what I observed is optimality gaps/ solution time points are not being added to ‘Gap_Timepoints’/ ‘Set_ILP_Timepoints’ after every callback.
Could you help me on this part?
Thanks,
Sujit
Is the set GapPlot_TimePoints_Set filled? It could be that BestBoundSol and IncumSol are 'na’ at the beginning of the solve in which case Gap_TimePoints remains empty. You can check this by setting a break-point and look at the values of BestBoundSol and IncumSol.
The values of BestBoundSol and IncumSol were ‘na’ at the beginning. However, I obtained values for both these as the solution process progressed and OptGap got calculated. I also got values of solution time after every callback. But, the set GapPlot_TimePoints_Set did not get filled neither Gap_TimePoints did.
I again ran the simulation after commenting everything except ‘GapPlot_TimePoints_Set’ in the body of procedure ‘NewTimeCallback’ to see if time points were getting added. But, they weren’t and the set ‘GapPlot_TimePoints_Set’ was still empty. I am attaching an image of declaration of set ‘GapPlot_TimePoints_Set’. Please check if there is something wrong in the declaration of the set.
Thanks for your help on this.
The set ‘GapPlot_TimePoints_Set’ is defined as a subset of Integers, which is ok. I don't see any mistakes. I tried something similar in AIMMS 4.74 and that worked fine. I assume that you do not empty the set ‘GapPlot_TimePoints_Set’ after the solve, and that the math program that you use inside the callback procedure is the same as the one that you are solving. Which AIMMS version are you using? Which options did you set in the project (if any)?
I am not emptying the contents of the set after the solve. The math program is also same as the one I have mentioned. The AIMMS version that I am using is v4.73. Other options set are for MIP relative optimality tolerance and simulation time limit. Attached is the script which I use for callback time procedure.
At this point I would have to inspect the AIMMS project to find out what is going on. Would you be able to share your project by sending it to our support? If that is not possible, we could schedule an online meeting such that I can look at your screen. Please send an email to our support if you want to schedule a meeting.
Sure, thanks. Let me write an email to Support to schedule a meeting.
Can you tell what the solution was?
@Hannah Forster , the other user’s issue was related to time units/quantities and rounding that they used for the x-axis of the plot.
What difficulties are you having ?