Custom recorder on stages with different constraints

The custom recorder is an arbitrary Julia function. So you could do something like:

function my_custom_recorder(sp::JuMP.Model)
    dict = JuMP.object_dictionary(sp)
    if !haskey(dict, :demand_constraint)
        return NaN
    end
    return JuMP.dual(dict[:demand_constraint])
end

# and then

    custom_recorders = Dict{Symbol,Function}(
        :price => my_custom_recorder,
    )
1 Like