Originally posted by: Inspiredlallu
Hi,
Thanks for the post. It was very useful.
But there is again a problem.
I have to add constraints in the resultCplex object from two different cplex objects. If I exactly use the below lines, then the constraints of the name also remain the same. And hence, two constraints get same constraint name. (As the name of constraints in the two objects is same)
IloRange temp = (IloRange)lp.getRange(r).makeCopy(cm);
cplex.add(temp);
I tried changing the name of the constraints by adding the constraints as below:
IloRange temp = (IloRange)qMatrix.getRange(r).makeCopy(qCM);
resultCplex.addRange(temp.getLB(), temp.getExpr(),temp.getUB(),"IloC"+count);
Hence, each constraint name gets different constraint name.
But now the problem is that the resultCplex object created considers the repeated variables, w, x, y, z as different variables. As in each occurence of w is treated as a different variable.
Any idea on how to resolve this.
Regards,
Neha
#CPLEXOptimizers#DecisionOptimization