MIP.mod, line 214 (offset 8323):
cstr_ObjUnsat must be redeclared without objective1_UnsatDemand.val because objective1_UnsatDemand is a defined variable.
context: sum{d in Demands} Unsat[d] <= >>> objective1_UnsatDemand.val; <<<
Any help or workaround is much appreciated!
Thanks in advance,
Fulya
--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ampl/6045ea81-081b-40ec-ad2d-942708884861n%40googlegroups.com.
param obj1_unsatdemand; let obj1_unsatdemand := objective1_UnsatDemand.val; subject to cstr_ObjUnsat: sum {d in Demands} Unsat[d] <= obj1_unsatdemand; minimize objective2_UnsatDemand: ... ; objective objective2_UnsatDemand; solve;
Dear Robert,
Many thanks for your answer.
I can indeed do that, however, my problem of not being able to use the value of the first objective function as the right hand side of a new constraint persists. How can I do this?
Best regards,
Fulya
On Sun, Jul 10, 2022 at 4:28 AM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
Your constraint "subject to cstr_ObjUnsat: sum{d in Demands} Unsat[d] <= objective1_UnsatDemand.val;" depends on objective1_UnsatDemand, so deleting objective1_UnsatDemand will cause an error.
However, a model can have more than one objective function. So in addition to defining cstr_ObjUnsat, you can define
minimize objective2_UnsatDemand: . . . ;
objective objective2_UnsatDemand;
where . . . is replaced by the expression for your second objective function. Then you can run "solve;" again, and the second objective will be optimized.
--
Robert Fourer
am...@googlegroups.com