I am currently learning to use flow control in CPLEX. I wonder if I want to change the change interval for capflour to 100 at each time in the following case, how can I do that?
Thanks!
Blockquote
main {
thisOplModel.generate();
var produce = thisOplModel;
var capFlour = produce.Capacity["flour"];
var best;
var curr = Infinity;
var ofile = new IloOplOutputFile("mulprod_main.txt");
while ( 1 ) {
best = curr;
writeln("Solve with capFlour = ",capFlour);
if ( cplex.solve() ) {
curr = cplex.getObjValue();
writeln();
writeln("OBJECTIVE: ",curr);
ofile.writeln("Objective with capFlour = ", capFlour, " is ", curr);
} else {
writeln("No solution!");
break;
}
if ( best==curr ) break;
**capFlour++;**
for(var t in thisOplModel.Periods)
thisOplModel.ctCapacity["flour"][t].UB = capFlour;
}
if (best != Infinity) {
writeln("plan = ",produce.Plan);
}
ofile.close();
}
Solving
iteratively
using while
loop
Modifying the upper bound (flour capacity)
Blockquote Blockquote