odow / SDDP.jl

Stochastic Dual Dynamic Programming in Julia

Home Page:https://sddp.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FEASIBILITY_SENSE returned by SDDP.deterministic_equivalent()

WalterMadelim opened this issue · comments

Hi, odow. I'm learning your package through
Documentation / Examples / (the 1st) Fast: the hydro thermal problem

function fast_hydro_thermal()
    model = SDDP.PolicyGraph(...
    ) do sp, t
        ...
    end
    det = SDDP.deterministic_equivalent(model, Gurobi.Optimizer)
    set_silent(det)
    # Notice the output here:
    println(objective_sense(det)) # FEASIBILITY_SENSE
    println(objective_function(det)) # 5 p#1 + 2.5 p#2 + 2.5 p#2
    JuMP.optimize!(det)
    println(objective_value(det)) # 10.0
    ...
    return
end

fast_hydro_thermal()

It seems the JuMP model det returned from your SDDP.deterministic_equivalent() function is having an objective with FEASIBILITY_SENSE.
I'm not quite clear about the meaning.

Hmm. I think this is a bug. I don't really use deterministic_equivalent, and I wouldn't encourage it (it scales very badly). Let me take a look.

It looks like we set the objective function but not the objective sense:

# Add objective:
current = JuMP.objective_function(model)
subproblem_objective =
copy_and_replace_variables(node.stage_objective, var_src_to_dest)
JuMP.set_objective_function(
model,
current + child.probability * subproblem_objective,
)

Thanks🙂

No problem. A release will be out sometime today: #674