Fix duplicated startup constraint

pull/12/head
mtanneau 4 years ago
parent 821d48bdc6
commit b2eaa0e48b

@ -12,14 +12,14 @@ function _add_startup_cost_eqs!(
S = length(g.startup_categories) S = length(g.startup_categories)
startup = model[:startup] startup = model[:startup]
for t in 1:model[:instance].time for t in 1:model[:instance].time
for s in 1:S
# If unit is switching on, we must choose a startup category # If unit is switching on, we must choose a startup category
eq_startup_choose[g.name, t, s] = @constraint( eq_startup_choose[g.name, t] = @constraint(
model, model,
model[:switch_on][g.name, t] == model[:switch_on][g.name, t] ==
sum(startup[g.name, t, s] for s in 1:S) sum(startup[g.name, t, s] for s in 1:S)
) )
for s in 1:S
# If unit has not switched off in the last `delay` time periods, startup category is forbidden. # If unit has not switched off in the last `delay` time periods, startup category is forbidden.
# The last startup category is always allowed. # The last startup category is always allowed.
if s < S if s < S

Loading…
Cancel
Save