Many solvers have an "objno" option that lets you select an objective function. So you can write, as an example,
for {i in 1.._nobjs} {
option gurobi_options ('objno=' & i);
solve;
<<< examine results and reset parameters >>>
}
The numbering of the objectives corresponds to the order in which they were defined in the model; _nobjs is a built-in parameter that gives the number of objectives that have been defined. But if you have an indexed collection of objectives, defined by some statement like
minimize TotalCost {i in 1..m}: <<< expression for objective >>> ;
then instead you can specify the objective by name in the AMPL loop:
for {i in 1..m} {
objective TotalCost[i];
solve;
<<< examine results and reset parameters >>>
}
Bob Fourer
am...@googlegroups.com
=======