I am wondering how we can override a constraint in AMPL. in a very basic example :
var x >= 0 ;
var y >= 0;
minimize cost : x^2 + y^4;
subject to constraint1 : x+2*y >= 100;
subject to constraint1 : x+2*y <= 10;
---------------------------------
"constraint1 is already defined"
AMPL uses the first "constraint1" as its constraint and ignores the second one , is there any way that AMPL uses the last "constraint1" ?
It is not possible to override constraints with the same variable name.
It is possible to toggle between constraints that are assigned to the same name via conditional logic (if statements come to mind), but they cannot be overwritten.