Constraints of function in the Set MathOptInterface.Interval{Float64} are not implemented

The model is a bi_level model with Gurobi solver.
There are a number of continuous variables and one binary variable.
When solving this model, it shows such wrong. What does it mean? How can I find the wrong constraint?

LoadError: Constraints of function MathOptInterface.ScalarAffineFunction{Float64} in the Set MathOptInterface.Interval{Float64} are not implemented
Stacktrace:
 [1] error(::String, ::Type{T} where T, ::String, ::Type{T} where T, ::String) at .\error.jl:42
 [2] supported_constraints(::Array{Tuple{DataType,DataType},1}) at C:\Users\ipso17.GXU\.julia\packages\Dualization\fSW2B\src\supported.jl:9
 [3] dualize(::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.GenericModel{Float64,MathOptInterface.Utilities.ModelFunctionConstraints{Float64}}}}, ::Dualization.DualProblem{Float64,MathOptInterface.Utilities.GenericModel{Float64,Dualization.DualizableModelFunctionConstraints{Float64}}}, ::Dualization.DualNames, ::Array{MathOptInterface.VariableIndex,1}, ::Bool) at C:\Users\ipso17.GXU\.julia\packages\Dualization\fSW2B\src\dualize.jl:27
 [4] #dualize#1 at C:\Users\ipso17.GXU\.julia\packages\Dualization\fSW2B\src\dualize.jl:8 [inlined]
 [5] build_bilevel(::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.GenericModel{Float64,MathOptInterface.Utilities.ModelFunctionConstraints{Float64}}}}, 
::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.GenericModel{Float64,MathOptInterface.Utilities.ModelFunctionConstraints{Float64}}}}, ::Dict{MathOptInterface.VariableIndex,MathOptInterface.VariableIndex}, ::Array{MathOptInterface.VariableIndex,1}, ::BilevelJuMP.SOS1Mode{Float64}, ::Dict{MathOptInterface.VariableIndex,MathOptInterface.ConstraintIndex}; copy_names::Bool, pass_start::Bool) at C:\Users\ipso17.GXU\.julia\packages\BilevelJuMP\wSyR2\src\moi.jl:286
 [6] optimize!(::BilevelModel; lower_prob::String, upper_prob::String, bilevel_prob::String, solver_prob::String, file_format::MathOptInterface.FileFormats.FileFormat) at C:\Users\ipso17.GXU\.julia\packages\BilevelJuMP\wSyR2\src\jump.jl:394
 [7] optimize!(::BilevelModel) at C:\Users\ipso17.GXU\.julia\packages\BilevelJuMP\wSyR2\src\jump.jl:354

Thank you for your help!

The error is saying that you can’t dualize a Interval constraint.

Look for a constraint like @constraint(model, 1 <= a' x <= 2) in your model and rewrite it as two inequalities:

@constraint(model, 1 <= a' x)
@constraint(model, a' x <= 2)

Nice!

1 Like