Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

Conditional Constraint

Archive User

Archive UserMon June 04, 2018 01:22 AM

ALEX FLEISCHER

ALEX FLEISCHERMon June 04, 2018 04:50 AM

  • 1.  Conditional Constraint

    Posted Mon June 04, 2018 01:22 AM

    Originally posted by: open_ball


    Hi,

     

    Suppose I define the followings;

    String x = ["x1","x2","x3]

    int y = 1..20;

    dvar int+ V[x][y];

     

    When I have x1,  y should go up to 10, when I have x2, y should go up to 15, and when I have x3, y should go up to 20. 

     

    When I create my constraints and do (forall x, for all y), I do not want to create the redundant variables. What is the best way to do so? 


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Conditional Constraint

    Posted Mon June 04, 2018 04:50 AM

    Hi,

    could

    {string} x = {"x1","x2","x3"};

    tuple t
    {
    key string st;
    int y;
    }

    {t} s with st in x={<"x1",10>,<"x2",15>,<"x3",20>};

    dvar int+ V[s];


    maximize sum(i in s) V[i];
    subject to
    {
    forall(i in s) V[i]<=i.y;
    }

    help ?

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer