Unable to set_optimizer_attribute in BilevelJuMP.jl

I am trying to change the MIPGap parameter for Guorbi:

using JuMP, Gurobi, BilevelJuMP

model = BilevelModel(Gurobi.Optimizer, mode = BilevelJuMP.SOS1Mode())
set_optimizer_attribute(model, "MIPGap", 1e-5)

Throws error:

Error: UndefVarError: RawParameter not defined

What’s the cause? Any help is appreciated. Thank you.

Julia 1.6.1
Package versions:
Gurobi v0.11.1
JuMP v1.0.0
BilevelJuMP v0.5.0

The symbol RawParameter has now been changed to RawOptimizerAttribute in new versions of JuMP.

Where does the error actually occur?

@jd-foster This is the full stack trace. Apparently, it seems to occur in BilevelJuMP.

ERROR: UndefVarError: RawParameter not defined
Stacktrace:
 [1] set_optimizer_attribute(bm::BilevelModel, name::String, value::Float64)
   @ BilevelJuMP C:\Users\math_opt\.julia\packages\BilevelJuMP\re5gQ\src\jump_attributes.jl:10
 [2] top-level scope
   @ REPL[3]:1

Any clue on how to get around this? Thanks!

Replacing MOI.RawParameter(name) with MOI.RawOptimizerAttribute(name) should work?

Apparently there is a recent pull request for the same issue.
@joaquimg Any plans on merging the PR anytime soon? Or should I manually make the changes in my locally installed BilevelJuMP package for now? :sweat_smile:
Thanks a lot!

Just released BilevelJuMP 0.5.1 with this fix.

2 Likes

Works perfectly now. Thanks! :slight_smile: