mirror of
https://github.com/ANL-CEEESA/UnitCommitment.jl.git
synced 2025-12-06 08:18:51 -06:00
Fix non-bool use of _is_initially_on
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user