Originally posted by: Kate1592
Hi,
Im trying to use benders strategy in cplex to solve a scenario based problem. I used the strategy 2 and provided annotations to define the master and sub problem variables. But, I'm getting this error "Cannot convert to an Integer" and I'm not sure what does that indicate. Can someone please help me understand this error?
Following is the code lines for strategy 2. The error is in the highlighted line and B is a continuous variable
var masterDef = thisOplModel.modelDefinition;
var masterElts = thisOplModel.dataElements;
var subCplex2 = new IloCplex();
var subOpl2 = new IloOplModel(masterDef, subCplex2);
subOpl2.addDataSource(masterElts);
subOpl2.generate();
subCplex2.bendersstrategy = 2;
subCplex2.newLongAnnotation("cpxBendersPartition");
for(var sc=1; sc<=thisOplModel.scenarios;sc++){
for(var cj=1; cj<=thisOplModel.numclientjobs;cj++){
for(var s=1; s<=thisOplModel.statesizes[cj];s++){
for(var t=1;t <= thisOplModel.numTU[thisOplModel.TSin[cj][s]]; t++){
subCplex2.setLongAnnotation("cpxBendersPartition", subOpl2.B[sc][cj][s][t], subOpl2.bendersPartition);
}
}
}
}
subCplex2.solve();
t
cplex.exportModel("benders.lp");
subCplex2.writeBendersAnnotation("cplex2.ann");
writeln(subCplex2.getObjValue());
In the beginning, I partition the model as:
int bendersPartition[sc in 1..scenarios][i in 1..numclientjobs][s in 1..bigstatesize][1..maxTU] = sc;
int bendersPartition2[sc in 1..scenarios] = sc;
Can someone please help me understand this error?
Thanks in advance!
#CPLEXOptimizers#DecisionOptimization