Here's an update on this question. We have updated the behavior of AMPL's Gurobi interface when handling the following option in the gurobi_options string:
return_mipgap Whether to return mipgap suffixes or include mipgap values
(|objective - best_bound|) in the solve_message: sum of
1 = return relmipgap suffix (relative to |obj|);
2 = return absmipgap suffix (absolute mipgap);
4 = suppress mipgap values in solve_message.
Default = 0. The suffixes are on the objective and problem.
Returned suffix values are +Infinity if no integer-feasible
solution has been found, in which case no mipgap values are
reported in the solve_message.
When a time limit or other stopping condition occurs before any integer-feasible solution has been found, the .relmipgap and/or .absmipgap suffix now reports a gap of Infinity. When the stopping condition occurs after an integer-feasible solution has been found, these gaps are reported as finite.
For example, if you add 'return_mipgap 2' to the gurobi_options string, and your AMPL objective function is Total_Cost, then Total_Cost.absmipgap will be Infinity if and only if no integer-feasible solution was found.
Bob Fourer
am...@googlegroups.com