Fix non-bool use of _is_initially_on

add_formulations
Aleksandr Kazachkov 4 years ago
parent 6096204270
commit 9f09e71bfb

@ -75,7 +75,7 @@ function _add_status_vars!(
fix(switch_on[g.name, t], (t == 1 ? 1.0 - _is_initially_on(g) : 0.0); force = true) fix(switch_on[g.name, t], (t == 1 ? 1.0 - _is_initially_on(g) : 0.0); force = true)
fix(switch_off[g.name, t], 0.0; force = true) fix(switch_off[g.name, t], 0.0; force = true)
elseif t == 1 elseif t == 1
if _is_initially_on(g) if is_initially_on
# Generator was on (for g.initial_status time periods), # Generator was on (for g.initial_status time periods),
# so cannot be more switched on until the period after the first time it can be turned off # so cannot be more switched on until the period after the first time it can be turned off
fix(switch_on[g.name, 1], 0.0; force = true) fix(switch_on[g.name, 1], 0.0; force = true)
@ -92,7 +92,7 @@ function _add_status_vars!(
switch_on[g.name, t] = (t == 1 ? 1.0 - _is_initially_on(g) : 0.0) switch_on[g.name, t] = (t == 1 ? 1.0 - _is_initially_on(g) : 0.0)
switch_off[g.name, t] = 0.0 switch_off[g.name, t] = 0.0
elseif t == 1 elseif t == 1
if _is_initially_on(g) if is_initially_on
switch_on[g.name, t] = 0.0 switch_on[g.name, t] = 0.0
else else
switch_off[g.name, t] = 0.0 switch_off[g.name, t] = 0.0

Loading…
Cancel
Save