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):
usage
worker1_start +=5 ;
usage
worker2_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