AMPL offers superior support by our development and technical support teams.
Contact us for general queries, partnerships, and more.
We can help you find the license and offering that works best for your situation.
AMPL offers superior support by our development and technical support teams.
Contact us for general queries, partnerships, and more.
We can help you find the license and offering that works best for your situation.
File from Additional Scripts: Looping and Testing – 1
model steelT.mod;
data steelT.dat;
option solution_precision 10;
option solver_msg 0;
set AVAILt;
param availt_obj {AVAILt};
param availt_dual {AVAILt};
param avail_orig;
param previous_dual;
for {t in 1..T} {
let AVAILt := {};
reset data availt_obj;
reset data availt_dual;
let avail_orig := avail[t];
let avail[t] := 0;
let previous_dual := Infinity;
repeat {
let avail[t] := avail[t] + 1;
solve;
if time[t].dual = previous_dual then continue;
let AVAILt := AVAILt union {avail[t]};
let availt_obj[avail[t]] := total_profit;
let availt_dual[avail[t]] := time[t].dual;
if time[t].dual = 0 then break;
let previous_dual := time[t].dual;
}
let avail[t] := avail_orig;
display t, availt_obj, availt_dual;
}