Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Discrepancy in type

    Posted 03/31/10 01:12 PM

    Originally posted by: SystemAdmin


    Lets declare an array of boolean variables in this way:

    y = IloNumVarArray(*m_env, m_nrLocations, 0, 1, ILOBOOL);

    or
    y = IloNumVarArray(*m_env, m_nrLocations, 0, 1, ILOINT);

    they when using y[i].getType() the result seems incorrect. The output I think is supposed to be 3 (according to declaration enum Type { Int=1, Float=2, Bool=3 };
    inside the header file 'iloexpression.h') but surprisingly it can be 1 for some of the variables.

    I came across this when trying to add addDiversityFilter to the cplex object and it said "3003".
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Discrepancy in type

    Posted 03/31/10 01:22 PM

    Originally posted by: SystemAdmin


    Sorry it says error 3414.
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Discrepancy in type

    Posted 04/02/10 01:54 AM

    Originally posted by: SystemAdmin


    Hm, not for me. I did this
    IloEnv env;
    try {
       IloNumVarArray bools = IloNumVarArray(env, count, 0, 1, ILOBOOL);
       IloNumVarArray ints = IloNumVarArray(env, count, 0, 1, ILOINT);
       for (int i = 0; i < bools.getSize(); ++i)
          std::cout << bools[i].getType() << std::endl;
       for (int i = 0; i < ints.getSize(); ++i)
          std::cout << ints[i].getType() << std::endl;
    } catch (IloException& e) {
       std::cerr << e << std::endl;
    }
    env.end();
    

    and it only prints 3.
    Does your problem occur right after creating the arrays or further down the line?
    What does getLB() and getUB() report for the variables that have types different from ILOBOOL?
    What version of CPLEX and what platform are you using?
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Discrepancy in type

    Posted 04/02/10 04:35 AM

    Originally posted by: SystemAdmin


    I could get rid of that mis-match and checked all what you mentioned. Every thing seemed '3' but when passing the filter to cplex or populate this came back again.

    I tried to re-produce it on a separate project with no success.
    #CPLEXOptimizers
    #DecisionOptimization