Originally posted by: felx
Hello,
I´m currently translating an OPL model to Java.
Within the OPL model there is an array dE of decision expressions declared like this:
dexpr float dE[t in years] = decisionVariable1[t] - decisionVariable2[t]
wherein years looks like this:
years= [2011,2012….2020].
Now, I would like to do the same with Java. I´m creating an Array dE of decision expressions of type IloNumExpr and fill it via a for-loop:
IloNumExpr[]dE = new IloNumExpr[10];
for(int i=0; i<10; i++) {
dE[i] = cplex.diff(decisionVariable1[i], decisionVariable2[i]);
}
Is there any way I can assign names to each element of the array dE, the same way I can assign the years [2011,2012….2020] to the array elements in OPL?
Thanks,
Felix
#DecisionOptimization#OPLusingCPLEXOptimizer