Have you tried using the drop and restore commands?
I am using them to solve an iterative LP problem and it works for me.
Kind regards
Cristián Hernández C.
Enviado desde mi iPhone
> --
> You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
> To post to this group, send email to am...@googlegroups.com.
> To unsubscribe from this group, send email to ampl+uns...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/ampl?hl=en.
>
www.ampl.com/NEW/LOOP2/trnloc1d.mod
www.ampl.com/NEW/LOOP2/trnloc1d.run
there is a constraint like this:
subj to Cut_Defn {k in 1..nCUT}:
if cut_type[k] = "point" then Max_Ship_Cost >=
sum {i in ORIG} supply_price[i,k] * supply[i] * Build[i] +
sum {j in DEST} demand_price[j,k] * demand[j];
and the meaning of this constraint is changed within a loop by statements
like this:
let nCUT := nCUT + 1;
let cut_type[nCUT] := "point";
let {i in ORIG} supply_price[i,nCUT] := Supply_Price[i];
let {j in DEST} demand_price[j,nCUT] := Demand_Price[j];
The first statement actually increases the number of constraints, by
expanding the index set 1..nCUT of constraint Cut_Defn. The others define
the values of the coefficients and constraints in the new constraint, by
setting them equal to the values of variables from the previous solve. The
same approach could be used to change coefficient values in existing
constraints. (To inactivate or reactivate entire constraints that you have
already created, use the drop and restore commands.)
Bob Fourer
4...@ampl.com