Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query Gurobi attributes from JuMP model #246

Closed
aahaselgrove opened this issue Sep 9, 2019 · 1 comment · Fixed by #248
Closed

Query Gurobi attributes from JuMP model #246

aahaselgrove opened this issue Sep 9, 2019 · 1 comment · Fixed by #248
Labels
Wrapper: MathOptInterface Issue is specific to MOI wrapper

Comments

@aahaselgrove
Copy link

I would like to query the optimality gap after my solver has completed execution. The Gurobi website indicates that this is an attribute of the solution (https://www.gurobi.com/documentation/6.5/refman/mipgap.html), but I can't see how to query this from a JuMP model (or, for that matter, from a Gurobi Model).

@odow
Copy link
Member

odow commented Sep 9, 2019

General support is about to drop: #247

But for now,

using JuMP, Gurobi
model = Model(with_optimizer(Gurobi.Optimizer))
# ...
optimize!(model)
MOI.get(model, MOI.RelativeGap())

The JuMP docs should be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Wrapper: MathOptInterface Issue is specific to MOI wrapper
Development

Successfully merging a pull request may close this issue.

2 participants