Hello,
I’m trying to solve MI-NLP problem with SDDP.jl.
I would like to use juniper.jl
as optimizer:
using SDDP
using Ipopt
using Juniper
nl_solver = optimizer_with_attributes(Ipopt.Optimizer, "print_level"=>0)
minlp_solver = optimizer_with_attributes(Juniper.Optimizer, "nl_solver"=>nl_solver)
# model = Model(minlp_solver)
# Building the subproblem
model = SDDP.LinearPolicyGraph(
stages = numtime,
sense = :Min,
lower_bound = 0.0,
optimizer = minlp_solver,
) do sp, node
...
end
But when I train the model, I got error saying:
ArgumentError: MathOptInterface.Utilities.Model{Float64} does not support getting the attribute MathOptInterface.ConstraintDual(1).
Stacktrace:
[1] get_fallback(model::MathOptInterface.Utilities.Model{Float64}, attr::MathOptInterface.ConstraintDual, #unused#::MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.EqualTo{Float64}})
@ MathOptInterface ~/.julia/packages/MathOptInterface/RuRWI/src/attributes.jl:367
[2] get(model::MathOptInterface.Utilities.Model{Float64}, attr::MathOptInterface.ConstraintDual, args::MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.EqualTo{Float64}})
@ MathOptInterface ~/.julia/packages/MathOptInterface/RuRWI/src/attributes.jl:336
[3] get(uf::MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}, attr::MathOptInterface.ConstraintDual, ci::MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.EqualTo{Float64}})
@ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/RuRWI/src/Utilities/universalfallback.jl:393
[4] get(model::Juniper.Optimizer, attr::MathOptInterface.ConstraintDual, ci::MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.EqualTo{Float64}})
@ Juniper ~/.julia/packages/Juniper/0Z1vO/src/MOI_wrapper/MOI_wrapper.jl:474
[5] get(b::MathOptInterface.Bridges.LazyBridgeOptimizer{Juniper.Optimizer}, attr::MathOptInterface.ConstraintDual, ci::MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.EqualTo{Float64}})
@ MathOptInterface.Bridges ~/.julia/packages/MathOptInterface/RuRWI/src/Bridges/bridge_optimizer.jl:1303
[6] get(model::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.Bridges.LazyBridgeOptimizer{Juniper.Optimizer}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}, attr::MathOptInterface.ConstraintDual, index::MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.EqualTo{Float64}})
How can I specify juniper solver appropriately with SDDP.jl
?