I am creating a project where I have one model where one variable is always changing, namely ForecastMultiplier. I need to put the results of each iteration into an excel spreadsheet. You can find main down below:
main { var source = new IloOplModelSource ("CS4.mod");
var def = new IloOplModelDefinition(source);
for (var k = 0.8; k <= 1.3; k += 0.1)
{ var modelInstance = new IloOplModel(def, cplex);
var data = new IloOplDataSource("CS4.dat");
modelInstance.addDataSource(data);
var data2= new IloOplDataElements();
data2.ForecastMultiplier=k;
modelInstance.addDataSource(data2);
modelInstance.generate();
cplex.solve();
writeln("For The scenario:" + k +", Optimal solution: " + modelInstance.x);
modelInstance.end()
}
}
I had an idea to do it like this:
DataName to SheetWrite(ConnectionName, “Sheet!xx:xx”);
Thank you
