Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

Setting value to an array with an index that is a decision variable

  • 1.  Setting value to an array with an index that is a decision variable

    Posted 07/09/10 10:31 AM

    Originally posted by: ahimsauxin


    Hi,

    I've started learning cplex for a few days so please excuse me if I'm not making any sense. I was wondering if there is a way for me to assign value to an array with a decision variable as an index.

    For example,

    IloIntVar worker1_start = ...;
    IloIntVar worker2_start = ...;
    IloIntExpr[] usage = ...;

    Then what I want to do is something like(i know the convention is wrong but i think you get the idea):
    usageworker1_start +=5 ;
    usageworker2_start +=1 ;

    What I'm trying to get out of it is that I have 2 workers with the start date of each workers being a decision variable. Then I use the cap_used array to keep track of the usage each day so that I can have a constraint that limits usage<capacity. The problem that I've been facing is that I can't set values to an array having an index as a decision variable. Is there a way out of this? Any suggestions would really be appreciated. Thank you,

    Aaron
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Setting value to an array with an index that is a decision variable

    Posted 07/09/10 02:01 PM

    Originally posted by: ahimsauxin


    Nevermind. I figured out a way to do it now. Thanks
    #DecisionOptimization
    #OPLusingCPLEXOptimizer