Gurobi does not have a built-in option of the sort you describe. In fact it is lacking two options of this kind: one to stop when the upper bound reaches a certain value, and one to stop when the lower bound reaches a certain value. I haven't noticed options of these kinds in other MIP solvers, either. Perhaps the developers are thinking, How can you know what value to stop at, when you don't know the optimal solution (to within some tolerance)? However, considering the number of times your question has been asked, it seems that in a few applications one does know a value beyond which the optimization is no longer significant or interesting. I recall a case where the purpose of the optimization was to determine whether the maximum was negative, and so it was desired to stop as soon as the lower bound reached zero.
You may see advice that you can get Gurobi to work in the desired way by writing a callback function. However since callbacks are not currently supported by the AMPL interface, the only way to follow this advice is to rewrite your entire model and your data-handling using one of the Gurobi APIs, which is a lot of trouble to implement such a simple condition.
You may also see advice to add directives of the form 'cutoff=<objval> solnlimit=1' to your gurobi_options string, where <objval> is replaced by the number that is your target objective function value. However this does not do what you have in mind, which is to have Gurobi run in the usual way and to stop as soon as it finds an incumbent solution whose objective value is at least as good as your target. Instead it converts your optimization into a feasibility problem, which in general is a harder problem and in any case results in Gurobi making a quite different search.
Possibly a more promising approach is to introduce a new variable Z >= 0, and to minimize Z subject to
Z >= <objective expression> - <objval>
(or similarly for maximization). I don't know how Gurobi reacts to problems of this form, but it appears to allow the objective to start at a value greater than <objval> and to be progressively reduced, and it should stop with an optimal value of Z = 0 as soon as the objective has a value less than or equal to <objval>.
Bob Fourer
am...@googlegroups.com
=======