Originally posted by: open_ball
Hi Alex,
I have the following structure;
minimize {
........
}
{Tup_Y} add_y = {< i , j , a, t, Y[<i, j, a, t>]> | <i,j, a, t > in Ytup};
{Tup_Y} add_master_f = {< c1 , c2 , a,t, master_f[<c1, c2, a, t>]> | <c1, c2, a, t > in Ytup};
With this two, I pass information to my sub problem at every iteration.
In the main, I have the following code block.
if(masterCplex.solve()){
masterOpl.postProcess();
}
Now, I want to write one of the variables into an Excel file during the last iteration. If I update my code as follows;
{Tup_Y} add_y = {< i , j , a, t, Y[<i, j, a, t>]> | <i,j, a, t > in Ytup};
{Tup_Y} add_master_f = {< c1 , c2 , a,t, master_f[<c1, c2, a, t>]> | <c1, c2, a, t > in Ytup};
tuple forX {
string a;
string c;
int t;
int amount;
}
{forX} Xdata={<a,c, t, X[<a, c,t>]> | a in Assets, c in Cities,t in 1..time, xx in Xtup:
xx.a == a && xx.c ==c&& xx.t == t};
execute
{
var f13 = new IloOplOutputFile("C:\\Desktop\\X.csv");
f13.writeln("asset,","city,","time,","Amount");
for(var i in Xdata)
f13.writeln(i.a,",",i.c,",",i.t,",",i.amount);
f13.close();
}
Then post process function calls all of them together at every iteration. How should I distinguish them? I want to call post process and send the required information to sub problem at every iteration, but I want to use the part for Excel only during the last iteration.
#DecisionOptimization#OPLusingCPLEXOptimizer