Skip to content

Commit

Permalink
refactor: don't rebuild model just to change Gurobi setting
Browse files Browse the repository at this point in the history
  • Loading branch information
danielolsen committed May 27, 2020
1 parent 432324a commit 6a88bf8
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/loop.jl
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,7 @@ function interval_loop(env::Gurobi.Env, model_kwargs::Dict,
# if BarHomogeneous is not enabled, enable it and re-build
solver_kwargs["BarHomogeneous"] = 1
println("enable BarHomogeneous")
m_kwargs = (; (Symbol(k) => v for (k,v) in model_kwargs)...)
s_kwargs = (; (Symbol(k) => v for (k,v) in solver_kwargs)...)
m = JuMP.direct_model(Gurobi.Optimizer(env; s_kwargs...))
m, voi = _build_model(m; m_kwargs...)
JuMP.set_optimizer_attribute(m, "BarHomogeneous", 1)
else
# Something has gone very wrong
@show status
Expand Down

0 comments on commit 6a88bf8

Please sign in to comment.