Skip to content

Commit

Permalink
fix storage varible name and constraint_storage_state parameter lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
ccoffrin committed Sep 17, 2019
1 parent 0385442 commit d5e36ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/core/constraint_template.jl
Original file line number Diff line number Diff line change
Expand Up @@ -745,10 +745,10 @@ end
function constraint_storage_state(pm::AbstractPowerModel, i::Int, nw_1::Int, nw_2::Int)
storage = ref(pm, nw_2, :storage, i)

if haskey(pm.data, "time_elapsed")
time_elapsed = pm.data["time_elapsed"]
if haskey(ref(pm, nw_2), :time_elapsed)
time_elapsed = ref(pm, nw_2, :time_elapsed)
else
Memento.warn(_LOGGER, "network data should specify time_elapsed, using 1.0 as a default")
Memento.warn(_LOGGER, "network $(nw_2) should specify time_elapsed, using 1.0 as a default")
time_elapsed = 1.0
end

Expand Down
4 changes: 2 additions & 2 deletions src/core/variable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -610,11 +610,11 @@ end
""
function variable_storage_complementary_indicator(pm::AbstractPowerModel; nw::Int=pm.cnw)
var(pm, nw)[:sc_on] = JuMP.@variable(pm.model,
[i in ids(pm, nw, :storage)], base_name="$(nw)_sc", Bin,
[i in ids(pm, nw, :storage)], base_name="$(nw)_sc_on", Bin,
start = comp_start_value(ref(pm, nw, :storage, i), "sc_on_start", 0)
)
var(pm, nw)[:sd_on] = JuMP.@variable(pm.model,
[i in ids(pm, nw, :storage)], base_name="$(nw)_sd", Bin,
[i in ids(pm, nw, :storage)], base_name="$(nw)_sd_on", Bin,
start = comp_start_value(ref(pm, nw, :storage, i), "sd_on_start", 0)
)
end
Expand Down

0 comments on commit d5e36ba

Please sign in to comment.