Originally posted by: MatteoFabr
Thanks for your reply.
In particular I have this code:
var src = new IloOplModelSource("DiffAss.mod");
var def = new IloOplModelDefinition(src);
var fixedData = new IloOplDataSource("fixedData.dat")
for (var i=1;i<=20;i++) {
var opl = new IloOplModel(def,cplex);
opl.addDataSource(fixedData);
var dataElt = new IloOplDataElements();
dataElt.sheetName = "Dati.xlsx";
dataElt.sheetRange=i+"Dati!A1:J10";
opl.addDataSource(dataElt);
var dataSource=new IloOplDataSource("RangeExceldata.dat");
opl.addDataSource(dataSource);
opl.generate();
if ( cplex.solve() ) {
writeln();
writeln("X = ",cplex.getObjValue());
}
else {
writeln("solve failed");
}
var srcd = new IloOplModelSource("MaxDistVinc.mod");
var defd = new IloOplModelDefinition(srcd);
var fixedDatad = new IloOplDataSource("fixedData.dat")
var opld = new IloOplModel(defd,cplex);
opld.addDataSource(fixedDatad);
var dataEltd = new IloOplDataElements();
dataElt.sheetName = "DatiErkut.xlsx";
dataElt.sheetRange=i+"Erkut!A1:J10";
opld.addDataSource(dataElt);
var dataSourced=new IloOplDataSource("RangeExceldata.dat");
opld.addDataSource(dataSource);
opld.generate();
var vectors = new IloOplCplexVectors();
for ( var t =1;t<11;t++){
vectors.attach(opld.OpenWarehouse[t],opl.OpenWarehouse[t].solutionValue);
vectors.getVectors(cplex);
}
if ( cplex.solve() ) {
writeln();
writeln("Xd = ",cplex.getObjValue());
else {
ofile.writeln("solve failed");
}
opl.end();
opld.end
}
}
The variable array openWarehouse have the same size in the two different model, and also the datas are the same. I want to fix this variables for founding th values of the other.
Can you help me?
THANKS!
#DecisionOptimization#OPLusingCPLEXOptimizer