I need to obtain the gap in AMPL API Python. I know that in AMPL the code is “display z.relmipgap” where z is the name of objective function.
the information capture is necesary because I export the results to excel.
I’m using gurobi and writed "ampl.option[“gurobi_options”] = “outlev=1 timelim=150 bestbound=1 return_mipgap=3"”
I defined “GAP = ampl.get_option(“relmipgap”)” but whitout success