Hello Everyone,
I am looking for an efficient way to reach a specific
constraint based on a
random number.
For instance, I have a
random number=3, and I have the following constraint.
for (int i=0; i<5; i++){
for (int j=0; j<7; j++){
IloLinearNumExpr exp = cplex.linearNumExpr();
exp.addTerm(1, Variable[i][j]);
cplex.addLe(exp, 0);
}
}
What is an efficient way to reach the
3rd constraint?
I mainly need to know what are
i and j in the
3rd constraint and use them for some operations.
It is not effiecent to go over all constraints to match the random number with the constraint number (or any counter) and reach the constraint.
I know this case may be simple, but I have several IF-conditions after Foor-loops.
Thank you so much for your help and time.
------------------------------
Mehrzad Mehrabipour
Ph.D. Student
Graduate Research Assistant
Civil, Construction, & Environmental Engineering Department
North Carolina State University
------------------------------
#DecisionOptimization