AMPL does not have any features for specifically describing bi-level optimization problems. Also there are not any bi-level programming solvers that have been connected to AMPL, and we do not have any bi-level optimization codes to distribute. Thus, in AMPL, you would have to explicitly define and solve the upper-level model and the lower-level model, and you would have to write an AMPL script that specifies how information from the solution to one model should be passed to the other model.
AMPL has a specific feature for describing two separate models and switching between them. There's an introduction to this feature -- with a detailed example -- in section
14.4 Alternating between models of the
AMPL book; then it is explained in more detail in section
14.5 Named problems.
AMPL also supports Gurobi's priority settings for multi-objective optimization. In the situation you describe, you could use two AMPL statements to define two different objective functions; for example, they might have the form
minimize Upper: . . . ;
minimize Lower: . . . ;
where . . . is replaced by the appropriate objective function expressions. After these objectives are read by AMPL, you could use commands like the following to set their priorities:
suffix objpriority IN;
let Upper.objpriority := 1;
let Lower.objpriority := 0;
Finally, to turn on the multi-objective optimization feature, you would specify (before the first "solve"),
option gurobi_options 'multiobj=1';
(or, if you are already defining a gurobi_options string, you would add multiobj=1 to it). For a complete description of this feature, see the following reply that was previously posted in this forum:
https://groups.google.com/d/msg/ampl/cDKRsJFHJcQ/AhZsBmnqDQAJThis Gurobi feature is often useful, but it is not the same as bi-level optimization.