Skip to content

Commit

Permalink
Fix unit_flow computation from subproblem to account for weight
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelma committed Aug 9, 2023
1 parent 628ad67 commit 1f0292c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/data_structure/benders_data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ function _save_sp_objective_value!(m, win_weight, tail=false)
end

function _save_sp_unit_flow!(m, win_weight, tail=false)
pval_by_ent = _pval_by_entity(m.ext[:spineopt].values[:unit_flow])
win_start, win_end = start(current_window(m)), end_(current_window(m))
window_values = Dict(
k => v for (k, v) in m.ext[:spineopt].values[:unit_flow] if start(k.t) >= win_start && end_(k.t) <= win_end
)
pval_by_ent = _pval_by_entity(window_values, win_weight)
pvals_to_node = Dict(
ent => Dict(:sp_unit_flow => pval) for (ent, pval) in pval_by_ent if ent.direction == direction(:to_node)
)
Expand Down

0 comments on commit 1f0292c

Please sign in to comment.