Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  range in cplex

    Posted 03/10/16 01:57 AM

    Originally posted by: sandeepsinghchauhan


    I have a vector 

      X = [1,3,5,8,9];

    X is float  datatype

    My problem is i want to create ranges like

    range one = 1..X[1];

    range two = 1..X[2];

    range three = 1..X[3];

    .

    .

    .

    Like that But its not working showing error "1 does not exist"


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: range in cplex

    Posted 03/10/16 02:10 AM

    Originally posted by: Mintch Zulitch


    Hi,

    I think the X is defined over the float type; and you can't construct ranges based on float parameters. Ranges can only be defined over the integer domain. Therefore the X should be int type.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: range in cplex

    Posted 03/10/16 02:27 AM

    Hi

    You could write:

    float X[1..5] = [1,3,5.1,8,9.2];

    range float one = 1..X[1];

    range float two = 1..X[2];

    range float three = 1..X[3];

    execute
    {
    writeln(one.UB);
    writeln(two.UB);
    writeln(three.UB);
    }

    which gives

     

    1
    3
    5.1

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer