Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Error 1006 in BranchCallcackI

    Posted 07/30/14 02:15 PM

    Originally posted by: VKV7_Anulark_Naber


    In my branchcallback (c++api), I added two branches like this:

    IloConstraintArray cons1(env), cons2(env);

    cons1.add(cutLhs <= cutRHS);

    cons1.add(branchLhs >= reqQ+Epsilon_1e1);
    cons2.add(branchLhs <= reqQ-Epsilon_1e1);
    makeBranch(cons1, getObjValue());
    makeBranch(cons2, getObjValue());
     

    The constraints are added, but when it gets out of branchcallback, I got an error message 1006. What can be the causes of that error?

    As you can see, I add branches with the continuous values on the RHS. Could that be the cause?

    Thanks in advance.

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Error 1006 in BranchCallcackI

    Posted 08/04/14 08:05 AM

    Does your callback run to completion or is it possible that you get an exception in the middle of the callback? If not yet done, could you wrap the code in your callback's main() function into something like this:

    try {
       // callback code here
    }
    catch (IloException &e) {
       std::cerr << "Exception during callback: " << e << std::endl;
       ::abort(); // or just 'throw' again
    }

    Do you have any other callback besides the branch callback? Do you solve any sub-models in your branch callback?

    Having variables on the right-hand side of the constraints should not be an issue. The should automatically get normalized.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Error 1006 in BranchCallcackI

    Posted 08/04/14 11:18 AM

    Originally posted by: VKV7_Anulark_Naber


    Thank you, Daniel.

    However, I found out that it was my mistake that a node is branched more than 2 branches.

    I will catch the exception as you suggested if I have the same error again.


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Error 1006 in BranchCallcackI

    Posted 08/04/14 12:00 PM

    Ah, yes, more than two branches are not allowed at a node.

    In my experience it is best practice to always catch exceptions in callbacks, even if you only print the message and immediately re-throw. Otherwise problems in callbacks easily get overlooked or they result in hard-to-understand error messages as in your case.


    #CPLEXOptimizers
    #DecisionOptimization