Use shortfall penalty only when val is nonnegative

pull/16/head
Aleksandr Kazachkov 4 years ago
parent 2cdf8874fb
commit 92221bcaa4

@ -39,12 +39,12 @@ function _add_reserve_eqs!(model::JuMP.Model)::Nothing
eq_min_reserve[t] = @constraint( eq_min_reserve[t] = @constraint(
model, model,
sum(model[:reserve][g.name, t] for g in instance.units) + ( sum(model[:reserve][g.name, t] for g in instance.units) + (
shortfall_penalty > -1e-7 ? model[:reserve_shortfall][t] : 0.0 shortfall_penalty >= 0 ? model[:reserve_shortfall][t] : 0.0
) >= instance.reserves.spinning[t] ) >= instance.reserves.spinning[t]
) )
# Account for shortfall contribution to objective # Account for shortfall contribution to objective
if shortfall_penalty > -1e-7 if shortfall_penalty >= 0
add_to_expression!( add_to_expression!(
model.obj, model.obj,
shortfall_penalty, shortfall_penalty,

Loading…
Cancel
Save