Originally posted by: Frops
Dear Daniel,
Thank you for your answer.
I am so sorry, I made a mistake. I do not use templates for building Callbacks, I use MACROS.
For instance,
ILONODECALLBACK1(nodecallback, ofstream&, fitxer){
nodep2=nodep2+1:
fitxer << nodep2<<endl;
}
This callback does not do anything meaningful, just to show an example.
There are a lot of macros defined depending on the type of callback: ILOUSERCUTCALLBACKk etc...
Here is the link to the manual with all the macros http://pic.dhe.ibm.com/infocenter/cosinfoc/v12r2/index.jsp?topic=%2Filog.odms.ide.help%2Fhtml%2Frefcppopl%2Fhtml%2Fmacros%2FILOUSERCUTCALLBACK0.html
I did not understand that when the node callback is invoked, the next node to be processed is the node at index 0.
So for instance, if in the macro I use the command getDepth on node 0, I should get the depth of the next node to be processed.
For instance, my code should be like this:
IloInt nodep; // global variable that keeps track of the depth of the current node
ILONODECALLBACK1(nodecallback, ofstream&, fitxer){
IloInt64 nextNode = 0;
nodep=getDepth(nextNode);
}
Then if in another callback, in my case the usercutcallback, I use the global variable nodep, it will contain the depth of the current node.
I am sorry I am not very good at C++. It is difficult for me to understand the callbacks defined that way.I will try to understand your proposal. Because, maybe I am missing something.
Thanks a lot,
#CPLEXOptimizers#DecisionOptimization