Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

Conditional decision variable

  • 1.  Conditional decision variable

    Posted Tue October 28, 2014 12:12 PM

    Originally posted by: ShirinG


    I need to define a decision variable based on the other, so I used dexpr to define the condition! 

    I appreciate if any one can verify it for me since I get errors! 

    dvar boolean x[i in A][s in S];

    dexpr boolean y[i in A][s in S][w in W]=i%7==w ? x[i][s];

    By this expression I am trying to condition on values y can get for each day of a week based on the values that x have for any day!

     

    I appreciate your comments,

    Shirin

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Conditional decision variable

    Posted Tue October 28, 2014 12:41 PM

    Hi

    can you try with dexpr int and with parenthesis ?

    dexpr int y[i in A][s in S][w in W]=(i%7==w)?x[i][s]:0;

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer