Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Convert NodeId into Int

    Posted 06/17/14 09:19 AM

    Originally posted by: skkim


    Hi, all. I have a function that only executes at the root node, so I would like to create something like

    BranchCallBack1() {

            IloCplex::BranchCallbackI::NodeId nodeId;
            nodeId=getNodeId();
            
            if(nodeId==0)
                    getEnv().out() << "node 0" << endl;

    }

    It is giving me the following error: no match for 'operator!=' in 'nodeId == 0'

    How can I make this work? Or How can I let callback function know the process at the root node?


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Convert NodeId into Int

    Posted 06/17/14 09:34 AM

    At the root node the callback's getNnodes() function should return 0. This should be good enough to identify the root node.

    if nothing else helps: The NodeId::_id field is publicly visible (see ilocplexi.h) so you can directly test this field. Not nice, not future proof, but should work as well.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Convert NodeId into Int

    Posted 06/17/14 09:42 AM

    Originally posted by: skkim


    Good!!! Why didn't I think trying getNnodes()? Thanks. 


    #CPLEXOptimizers
    #DecisionOptimization