Hi,
I'm running quick tests with CBC and it appears to be incompatible with MOI methods to extract duals:
ERROR: ArgumentError: ModelLike of type Cbc.Optimizer does not support accessing the attribute MathOptInterface.ConstraintDual(1)
Stacktrace:
[1] get(::Cbc.Optimizer, ::MathOptInterface.ConstraintDual, ::MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64},MathOptInterface.LessThan{Float64}}) at C:\Users\M435719\.julia\packages\MathOptInterface\bygN7\src\attributes.jl:272
[2] get(::MathOptInterface.Utilities.CachingOptimizer{Cbc.Optimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}, ::MathOptInterface.ConstraintDual, ::MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64},MathOptInterface.LessThan{Float64}}) at C:\Users\M435719\.julia\packages\MathOptInterface\bygN7\src\Utilities\cachingoptimizer.jl:568
[3] get(::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{Cbc.Optimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, ::MathOptInterface.ConstraintDual, ::MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64},MathOptInterface.LessThan{Float64}}) at C:\Users\M435719\.julia\packages\MathOptInterface\bygN7\src\Bridges\bridge_optimizer.jl:866
[4] get(::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{Cbc.Optimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, ::MathOptInterface.ConstraintDual, ::StochasticPrograms.AffineDecisionConstraintBridge{Float64,MathOptInterface.LessThan{Float64}}) at C:\Users\M435719\.julia\packages\StochasticPrograms\yFtc7\src\types\decisions\bridges\constraints\affine.jl:73
[5] (::MathOptInterface.Bridges.var"#54#55"{MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{Cbc.Optimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}},MathOptInterface.ConstraintDual})(::StochasticPrograms.AffineDecisionConstraintBridge{Float64,MathOptInterface.LessThan{Float64}}) at C:\Users\M435719\.julia\packages\MathOptInterface\bygN7\src\Bridges\bridge_optimizer.jl:864
[6] (::MathOptInterface.Bridges.var"#1#2"{MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{Cbc.Optimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}},MathOptInterface.ConstraintIndex{StochasticPrograms.AffineDecisionFunction{Float64},MathOptInterface.LessThan{Float64}},MathOptInterface.Bridges.var"#54#55"{MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{Cbc.Optimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}},MathOptInterface.ConstraintDual}})() at C:\Users\M435719\.julia\packages\MathOptInterface\bygN7\src\Bridges\bridge_optimizer.jl:217
[7] call_in_context(::MathOptInterface.Bridges.Variable.Map, ::Int64, ::MathOptInterface.Bridges.var"#1#2"{MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{Cbc.Optimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}},MathOptInterface.ConstraintIndex{StochasticPrograms.AffineDecisionFunction{Float64},MathOptInterface.LessThan{Float64}},MathOptInterface.Bridges.var"#54#55"{MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{Cbc.Optimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}},MathOptInterface.ConstraintDual}}) at C:\Users\M435719\.julia\packages\MathOptInterface\bygN7\src\Bridges\Variable\map.jl:404
[8] call_in_context at C:\Users\M435719\.julia\packages\MathOptInterface\bygN7\src\Bridges\Variable\map.jl:435 [inlined]
[9] call_in_context at C:\Users\M435719\.julia\packages\MathOptInterface\bygN7\src\Bridges\bridge_optimizer.jl:216 [inlined]
[10] get(::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{Cbc.Optimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, ::MathOptInterface.ConstraintDual, ::MathOptInterface.ConstraintIndex{StochasticPrograms.AffineDecisionFunction{Float64},MathOptInterface.LessThan{Float64}}) at C:\Users\M435719\.julia\packages\MathOptInterface\bygN7\src\Bridges\bridge_optimizer.jl:864
[11] get(::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}, ::MathOptInterface.ConstraintDual, ::MathOptInterface.ConstraintIndex{StochasticPrograms.AffineDecisionFunction{Float64},MathOptInterface.LessThan{Float64}}) at C:\Users\M435719\.julia\packages\MathOptInterface\bygN7\src\Utilities\cachingoptimizer.jl:568
[12] StochasticPrograms.LShaped.FeasibilityCut(::StochasticPrograms.LShaped.SubProblem{StochasticPrograms.LShaped.FeasibilityHandler,Float64}, ::Array{Float64,1}) at C:\Users\M435719\.julia\packages\StochasticPrograms\yFtc7\src\solvers\structured\lshaped\types\subproblem.jl:317
[13] (::StochasticPrograms.LShaped.SubProblem{StochasticPrograms.LShaped.FeasibilityHandler,Float64})(::Array{Float64,1}) at C:\Users\M435719\.julia\packages\StochasticPrograms\yFtc7\src\solvers\structured\lshaped\types\subproblem.jl:268
[14] resolve_subproblems!(::StochasticPrograms.LShaped.LShapedAlgorithm{Float64,Array{Float64,1},StochasticPrograms.VerticalStructure{2,1,Tuple{StochasticPrograms.ScenarioProblems{Main.StochOptModel.CScenario}}},MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}},StochasticPrograms.LShaped.SerialExecution{StochasticPrograms.LShaped.FeasibilityHandler,Float64,Array{Float64,1}},StochasticPrograms.LShaped.HandleFeasibility{Float64},StochasticPrograms.LShaped.NoRegularization,StochasticPrograms.LShaped.NoAggregation,StochasticPrograms.LShaped.NoConsolidation}, ::StochasticPrograms.LShaped.SerialExecution{StochasticPrograms.LShaped.FeasibilityHandler,Float64,Array{Float64,1}}) at C:\Users\M435719\.julia\packages\StochasticPrograms\yFtc7\src\solvers\structured\lshaped\execution\serial.jl:64
[15] resolve_subproblems! at C:\Users\M435719\.julia\packages\StochasticPrograms\yFtc7\src\solvers\structured\lshaped\execution\execution.jl:12 [inlined]
[16] iterate!(::StochasticPrograms.LShaped.LShapedAlgorithm{Float64,Array{Float64,1},StochasticPrograms.VerticalStructure{2,1,Tuple{StochasticPrograms.ScenarioProblems{Main.StochOptModel.CScenario}}},MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}},StochasticPrograms.LShaped.SerialExecution{StochasticPrograms.LShaped.FeasibilityHandler,Float64,Array{Float64,1}},StochasticPrograms.LShaped.HandleFeasibility{Float64},StochasticPrograms.LShaped.NoRegularization,StochasticPrograms.LShaped.NoAggregation,StochasticPrograms.LShaped.NoConsolidation}, ::StochasticPrograms.LShaped.SerialExecution{StochasticPrograms.LShaped.FeasibilityHandler,Float64,Array{Float64,1}}) at C:\Users\M435719\.julia\packages\StochasticPrograms\yFtc7\src\solvers\structured\lshaped\execution\common.jl:90
[17] iterate! at C:\Users\M435719\.julia\packages\StochasticPrograms\yFtc7\src\solvers\structured\lshaped\execution\execution.jl:9 [inlined]
[18] (::StochasticPrograms.LShaped.LShapedAlgorithm{Float64,Array{Float64,1},StochasticPrograms.VerticalStructure{2,1,Tuple{StochasticPrograms.ScenarioProblems{Main.StochOptModel.CScenario}}},MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}},StochasticPrograms.LShaped.SerialExecution{StochasticPrograms.LShaped.FeasibilityHandler,Float64,Array{Float64,1}},StochasticPrograms.LShaped.HandleFeasibility{Float64},StochasticPrograms.LShaped.NoRegularization,StochasticPrograms.LShaped.NoAggregation,StochasticPrograms.LShaped.NoConsolidation})() at C:\Users\M435719\.julia\packages\StochasticPrograms\yFtc7\src\solvers\structured\lshaped\solver.jl:153
[19] optimize!(::StochasticPrograms.LShaped.Optimizer) at C:\Users\M435719\.julia\packages\StochasticPrograms\yFtc7\src\solvers\structured\lshaped\MOI_wrapper.jl:139
[20] optimize!(::StochasticPrograms.VerticalStructure{2,1,Tuple{StochasticPrograms.ScenarioProblems{Main.StochOptModel.CScenario}}}, ::StochasticPrograms.LShaped.Optimizer, ::Array{Float64,1}) at C:\Users\M435719\.julia\packages\StochasticPrograms\yFtc7\src\methods\vertical\optimization.jl:8
[21] optimize!(::StochasticPrograms.StochasticProgram{2,Tuple{StochasticPrograms.Stage{NamedTuple{(:tasks, :agents, :shifts, :pauses, :dqual, :pqual, :bigM, :min_tasks_per_shift, :max_extra_minutes),Tuple{Dict{Int64,Main.Tasks.task},Dict{Tuple,Main.Shifts.agent},Dict{Int64,Main.Shifts.shift},Dict{Int64,Main.Shifts.pause},Dict{Int64,Float64},Dict{Int64,Float64},Float64,Float64,Float64}}},StochasticPrograms.Stage{NamedTuple{(:tasks, :agents, :shifts, :pauses, :dqual, :pqual, :bigM, :min_tasks_per_shift, :max_extra_minutes),Tuple{Dict{Int64,Main.Tasks.task},Dict{Tuple,Main.Shifts.agent},Dict{Int64,Main.Shifts.shift},Dict{Int64,Main.Shifts.pause},Dict{Int64,Float64},Dict{Int64,Float64},Float64,Float64,Float64}}}},StochasticPrograms.VerticalStructure{2,1,Tuple{StochasticPrograms.ScenarioProblems{Main.StochOptModel.CScenario}}}}; crash::StochasticPrograms.Crash.None, kw::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at C:\Users\M435719\.julia\packages\StochasticPrograms\yFtc7\src\methods\api.jl:209
[22] optimize!(::StochasticPrograms.StochasticProgram{2,Tuple{StochasticPrograms.Stage{NamedTuple{(:tasks, :agents, :shifts, :pauses, :dqual, :pqual, :bigM, :min_tasks_per_shift, :max_extra_minutes),Tuple{Dict{Int64,Main.Tasks.task},Dict{Tuple,Main.Shifts.agent},Dict{Int64,Main.Shifts.shift},Dict{Int64,Main.Shifts.pause},Dict{Int64,Float64},Dict{Int64,Float64},Float64,Float64,Float64}}},StochasticPrograms.Stage{NamedTuple{(:tasks, :agents, :shifts, :pauses, :dqual, :pqual, :bigM, :min_tasks_per_shift, :max_extra_minutes),Tuple{Dict{Int64,Main.Tasks.task},Dict{Tuple,Main.Shifts.agent},Dict{Int64,Main.Shifts.shift},Dict{Int64,Main.Shifts.pause},Dict{Int64,Float64},Dict{Int64,Float64},Float64,Float64,Float64}}}},StochasticPrograms.VerticalStructure{2,1,Tuple{StochasticPrograms.ScenarioProblems{Main.StochOptModel.CScenario}}}}) at C:\Users\M435719\.julia\packages\StochasticPrograms\yFtc7\src\methods\api.jl:201
[23] solve_opt_model!(::Main.StochOptModel.opt_model) at C:\Users\M435719\OneDrive\OneDrive - Air France KLM\TARGETS\thor_poc\src_new\NEWFORM_opt_model_stoch_SP.jl:506
[24] main() at C:\Users\M435719\OneDrive\OneDrive - Air France KLM\TARGETS\thor_poc\src_new\main.jl:32
[25] top-level scope at C:\Users\M435719\OneDrive\OneDrive - Air France KLM\TARGETS\thor_poc\src_new\main.jl:45
[26] include(::String) at .\client.jl:439
[27] top-level scope at REPL[2]:1
Hi, I'm running quick tests with CBC and it appears to be incompatible with MOI methods to extract duals:
Kind regards