Skip to content

Commit

Permalink
Merge pull request #118 from Electa-Git/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
hakanergun authored Feb 23, 2022
2 parents 18c4cc9 + 373912c commit f2cc7ec
Show file tree
Hide file tree
Showing 42 changed files with 194 additions and 184 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = "FlexPlan"
uuid = "4dc3fedf-fcb4-4327-bce2-523fd266e8c9"
autors = ["Hakan Ergun", "Matteo Rossini", "Marco Rossi", "Damien Lapage", "Iver Bakken Sperstad", "Espen Flo Bødal", "Merkebu Zenebe Degefa", "Reinhilde D'hulst"]
repo = "https://github.com/electa-git/FlexPlan.jl"
version = "0.2.0"
version = "0.2.1"

[deps]
InfrastructureModels = "2030c09a-7f63-5d83-885d-db604e0e9cc0"
Expand All @@ -28,7 +28,7 @@ Memento = "~1.0, ~1.1, ~1.2, ~1.3"
PowerModels = "0.19.1"
PowerModelsACDC = "=0.5.2"
SCS = ">= 0.8"
julia = "^1"
julia = "1.5"

[extras]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand Down
12 changes: 6 additions & 6 deletions examples/example_stochastic_tnep.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ import JSON
import CSV

# Solver configurations
scs = JuMP.with_optimizer(SCS.Optimizer, max_iters=100000)
ipopt = JuMP.with_optimizer(Ipopt.Optimizer, tol=1e-4, print_level=0)
cbc = JuMP.with_optimizer(Cbc.Optimizer, tol=1e-4, print_level=0)
gurobi = JuMP.with_optimizer(Gurobi.Optimizer)
mosek = JuMP.with_optimizer(Mosek.Optimizer)
juniper = JuMP.with_optimizer(Juniper.Optimizer, nl_solver = ipopt, mip_solver= cbc, time_limit= 7200)
scs = _FP.optimizer_with_attributes(SCS.Optimizer, "max_iters"=>100000)
ipopt = _FP.optimizer_with_attributes(Ipopt.Optimizer, "tol"=>1e-4, "print_level"=>0)
cbc = _FP.optimizer_with_attributes(Cbc.Optimizer, "tol"=>1e-4, "print_level"=>0)
gurobi = Gurobi.Optimizer
mosek = Mosek.Optimizer
juniper = _FP.optimizer_with_attributes(Juniper.Optimizer, "nl_solver"=>ipopt, "mip_solver"=>cbc, "time_limit"=>7200)

################# INPUT PARAMETERS ######################
number_of_hours = 144 # Number of time points
Expand Down
4 changes: 2 additions & 2 deletions src/FlexPlan.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const _IM = InfrastructureModels
import MathOptInterface
const _MOI = MathOptInterface

import JuMP: with_optimizer, optimizer_with_attributes
export with_optimizer, optimizer_with_attributes
import JuMP: optimizer_with_attributes
export optimizer_with_attributes

using Printf

Expand Down
74 changes: 42 additions & 32 deletions src/core/dimensions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function shift_ids!(data::Dict{String,Any}, offset::Int)
if _IM.ismultinetwork(data)
Memento.error(_LOGGER, "`shift_ids!` can only be applied to single-network data dictionaries.")
end
shift_ids!(data["dim"], offset)
shift_ids!(dim(data), offset)
end

"""
Expand Down Expand Up @@ -193,7 +193,7 @@ function require_dim(data::Dict{String,Any}, dimensions::Symbol...)
Memento.error(_LOGGER, "Missing `dim` dict in `data`. Use `add_dimension!` to fix.")
end
for d in dimensions
if !haskey(data["dim"][:prop], d)
if !haskey(dim(data)[:prop], d)
Memento.error(_LOGGER, "Missing dimension \"$d\" in `data`. Use `add_dimension!` to fix.")
end
end
Expand Down Expand Up @@ -231,11 +231,11 @@ function nw_ids(dim::Dict{Symbol,Any}; kwargs...)::Vector{Int}
end

function nw_ids(data::Dict{String,Any}; kwargs...)::Vector{Int}
haskey(data, "dim") ? nw_ids(data["dim"]; kwargs...) : [0]
haskey(data, "dim") ? nw_ids(dim(data); kwargs...) : [0]
end

function nw_ids(pm::_PM.AbstractPowerModel; kwargs...)::Vector{Int}
haskey(pm.ref[:it][:pm], :dim) ? nw_ids(pm.ref[:it][:pm][:dim]; kwargs...) : [0]
haskey(pm.ref[:it][_PM.pm_it_sym], :dim) ? nw_ids(dim(pm); kwargs...) : [0]
end


Expand Down Expand Up @@ -270,8 +270,8 @@ function similar_ids(dim::Dict{Symbol,Any}, n::Int; kwargs...)::Vector{Int}
ndims(nws) >= 1 ? vec(nws) : [nws]
end

similar_ids(data::Dict{String,Any}, n::Int; kwargs...) = similar_ids(data["dim"], n; kwargs...)
similar_ids(pm::_PM.AbstractPowerModel, n::Int; kwargs...) = similar_ids(pm.ref[:it][:pm][:dim], n; kwargs...)
similar_ids(data::Dict{String,Any}, n::Int; kwargs...) = similar_ids(dim(data), n; kwargs...)
similar_ids(pm::_PM.AbstractPowerModel, n::Int; kwargs...) = similar_ids(dim(pm), n; kwargs...)

"""
similar_id(pm::PowerModels.AbstractPowerModel, n::Int; kwargs...)
Expand Down Expand Up @@ -299,8 +299,8 @@ function similar_id(dim::Dict{Symbol,Any}, n::Int; kwargs...)::Int
li[ntuple(i -> get(kwargs, names[i], ci_n[i])::Int, ndims(li))...]
end

similar_id(data::Dict{String,Any}, n::Int; kwargs...) = similar_id(data["dim"], n; kwargs...)
similar_id(pm::_PM.AbstractPowerModel, n::Int; kwargs...) = similar_id(pm.ref[:it][:pm][:dim], n; kwargs...)
similar_id(data::Dict{String,Any}, n::Int; kwargs...) = similar_id(dim(data), n; kwargs...)
similar_id(pm::_PM.AbstractPowerModel, n::Int; kwargs...) = similar_id(dim(pm), n; kwargs...)

"""
first_id(pm::PowerModels.AbstractPowerModel, n::Int, dimension::Symbol...)
Expand All @@ -319,8 +319,8 @@ function first_id(dim::Dict{Symbol,Any}, n::Int, dimension::Symbol...)
li[ntuple(i -> names[i] in dimension ? 1 : ci_n[i], ndims(li))...]
end

first_id(data::Dict{String,Any}, n::Int, dimension::Symbol...) = first_id(data["dim"], n, dimension...)
first_id(pm::_PM.AbstractPowerModel, n::Int, dimension::Symbol...) = first_id(pm.ref[:it][:pm][:dim], n, dimension...)
first_id(data::Dict{String,Any}, n::Int, dimension::Symbol...) = first_id(dim(data), n, dimension...)
first_id(pm::_PM.AbstractPowerModel, n::Int, dimension::Symbol...) = first_id(dim(pm), n, dimension...)

"""
last_id(pm::PowerModels.AbstractPowerModel, n::Int, dimension::Symbol...)
Expand All @@ -339,8 +339,8 @@ function last_id(dim::Dict{Symbol,Any}, n::Int, dimension::Symbol...)
li[ntuple(i -> names[i] in dimension ? size(li,i) : ci_n[i], ndims(li))...]
end

last_id(data::Dict{String,Any}, n::Int, dimension::Symbol...) = last_id(data["dim"], n, dimension...)
last_id(pm::_PM.AbstractPowerModel, n::Int, dimension::Symbol...) = last_id(pm.ref[:it][:pm][:dim], n, dimension...)
last_id(data::Dict{String,Any}, n::Int, dimension::Symbol...) = last_id(dim(data), n, dimension...)
last_id(pm::_PM.AbstractPowerModel, n::Int, dimension::Symbol...) = last_id(dim(pm), n, dimension...)

"""
prev_id(pm::PowerModels.AbstractPowerModel, n::Int, dimension::Symbol)
Expand All @@ -359,8 +359,8 @@ function prev_id(dim::Dict{Symbol,Any}, n::Int, dimension::Symbol)::Int
li[ntuple(i -> i == pos_d ? ci_n[i]-1 : ci_n[i], ndims(li))...]
end

prev_id(data::Dict{String,Any}, n::Int, dimension::Symbol) = prev_id(data["dim"], n, dimension)
prev_id(pm::_PM.AbstractPowerModel, n::Int, dimension::Symbol) = prev_id(pm.ref[:it][:pm][:dim], n, dimension)
prev_id(data::Dict{String,Any}, n::Int, dimension::Symbol) = prev_id(dim(data), n, dimension)
prev_id(pm::_PM.AbstractPowerModel, n::Int, dimension::Symbol) = prev_id(dim(pm), n, dimension)

"""
prev_ids(pm::PowerModels.AbstractPowerModel, n::Int, dimension::Symbol)
Expand All @@ -379,8 +379,8 @@ function prev_ids(dim::Dict{Symbol,Any}, n::Int, dimension::Symbol)::Vector{Int}
li[CartesianIndex(ci_n[1:pos_d-1]), CartesianIndices((1:ci_n[pos_d]-1,)), CartesianIndex(ci_n[pos_d+1:end])]
end

prev_ids(data::Dict{String,Any}, n::Int, dimension::Symbol) = prev_ids(data["dim"], n, dimension)
prev_ids(pm::_PM.AbstractPowerModel, n::Int, dimension::Symbol) = prev_ids(pm.ref[:it][:pm][:dim], n, dimension)
prev_ids(data::Dict{String,Any}, n::Int, dimension::Symbol) = prev_ids(dim(data), n, dimension)
prev_ids(pm::_PM.AbstractPowerModel, n::Int, dimension::Symbol) = prev_ids(dim(pm), n, dimension)

"""
next_id(pm::PowerModels.AbstractPowerModel, n::Int, dimension::Symbol)
Expand All @@ -399,8 +399,8 @@ function next_id(dim::Dict{Symbol,Any}, n::Int, dimension::Symbol)::Int
li[ntuple(i -> i == pos_d ? ci_n[i]+1 : ci_n[i], ndims(li))...]
end

next_id(data::Dict{String,Any}, n::Int, dimension::Symbol) = next_id(data["dim"], n, dimension)
next_id(pm::_PM.AbstractPowerModel, n::Int, dimension::Symbol) = next_id(pm.ref[:it][:pm][:dim], n, dimension)
next_id(data::Dict{String,Any}, n::Int, dimension::Symbol) = next_id(dim(data), n, dimension)
next_id(pm::_PM.AbstractPowerModel, n::Int, dimension::Symbol) = next_id(dim(pm), n, dimension)

"""
next_ids(pm::PowerModels.AbstractPowerModel, n::Int, dimension::Symbol)
Expand All @@ -419,8 +419,8 @@ function next_ids(dim::Dict{Symbol,Any}, n::Int, dimension::Symbol)::Vector{Int}
li[CartesianIndex(ci_n[1:pos_d-1]), CartesianIndices((ci_n[pos_d]+1:size(li,pos_d),)), CartesianIndex(ci_n[pos_d+1:end])]
end

next_ids(data::Dict{String,Any}, n::Int, dimension::Symbol) = next_ids(data["dim"], n, dimension)
next_ids(pm::_PM.AbstractPowerModel, n::Int, dimension::Symbol) = next_ids(pm.ref[:it][:pm][:dim], n, dimension)
next_ids(data::Dict{String,Any}, n::Int, dimension::Symbol) = next_ids(dim(data), n, dimension)
next_ids(pm::_PM.AbstractPowerModel, n::Int, dimension::Symbol) = next_ids(dim(pm), n, dimension)


## Query properties of nw ids
Expand All @@ -441,8 +441,8 @@ function coord(dim::Dict{Symbol,Any}, n::Int, dimension::Symbol)
ci_n[pos[dimension]]
end

coord(data::Dict{String,Any}, args...) = coord(data["dim"], args...)
coord(pm::_PM.AbstractPowerModel, args...) = coord(pm.ref[:it][:pm][:dim], args...)
coord(data::Dict{String,Any}, args...) = coord(dim(data), args...)
coord(pm::_PM.AbstractPowerModel, args...) = coord(dim(pm), args...)

"""
is_first_id(pm::PowerModels.AbstractPowerModel, n::Int, dimension::Symbol...)
Expand All @@ -460,8 +460,8 @@ function is_first_id(dim::Dict{Symbol,Any}, n::Int, dimension::Symbol...)
all(ci_n[pos[d]] == 1 for d in dimension)
end

is_first_id(data::Dict{String,Any}, args...) = is_first_id(data["dim"], args...)
is_first_id(pm::_PM.AbstractPowerModel, args...) = is_first_id(pm.ref[:it][:pm][:dim], args...)
is_first_id(data::Dict{String,Any}, args...) = is_first_id(dim(data), args...)
is_first_id(pm::_PM.AbstractPowerModel, args...) = is_first_id(dim(pm), args...)

"""
is_last_id(pm::PowerModels.AbstractPowerModel, n::Int, dimension::Symbol...)
Expand All @@ -478,12 +478,22 @@ function is_last_id(dim::Dict{Symbol,Any}, n::Int, dimension::Symbol...)
all(ci_n[pos[d]] == size(li,pos[d]) for d in dimension)
end

is_last_id(data::Dict{String,Any}, args...) = is_last_id(data["dim"], args...)
is_last_id(pm::_PM.AbstractPowerModel, args...) = is_last_id(pm.ref[:it][:pm][:dim], args...)
is_last_id(data::Dict{String,Any}, args...) = is_last_id(dim(data), args...)
is_last_id(pm::_PM.AbstractPowerModel, args...) = is_last_id(dim(pm), args...)


## Access data relating to dimensions

"""
dim(data::Dict{String,Any})
dim(pm::PowerModels.AbstractPowerModel)
Return `dim` data structure.
"""
function dim end
dim(data::Dict{String,Any}) = data["dim"]
dim(pm::_PM.AbstractPowerModel) = pm.ref[:it][_PM.pm_it_sym][:dim]

"""
dim_prop(dim::Dict{Symbol,Any}[, dimension[, id[, key]]])
dim_prop(data::Dict{String,Any}[, dimension[, id[, key]]])
Expand All @@ -506,8 +516,8 @@ dim_prop(dim::Dict{Symbol,Any}, dimension::Symbol, id::Int, key::String) = dim[:
dim_prop(dim::Dict{Symbol,Any}, n::Int, dimension::Symbol) = dim[:prop][dimension][coord(dim,n,dimension)]
dim_prop(dim::Dict{Symbol,Any}, n::Int, dimension::Symbol, key::String) = dim[:prop][dimension][coord(dim,n,dimension)][key]

dim_prop(data::Dict{String,Any}, args...) = dim_prop(data["dim"], args...)
dim_prop(pm::_PM.AbstractPowerModel, args...) = dim_prop(pm.ref[:it][:pm][:dim], args...)
dim_prop(data::Dict{String,Any}, args...) = dim_prop(dim(data), args...)
dim_prop(pm::_PM.AbstractPowerModel, args...) = dim_prop(dim(pm), args...)

"""
dim_meta(dim::Dict{Symbol,Any}[, dimension[, key]])
Expand All @@ -520,8 +530,8 @@ function dim_meta end
dim_meta(dim::Dict{Symbol,Any}) = dim[:meta]
dim_meta(dim::Dict{Symbol,Any}, dimension::Symbol) = dim[:meta][dimension]
dim_meta(dim::Dict{Symbol,Any}, dimension::Symbol, key::String) = dim[:meta][dimension][key]
dim_meta(data::Dict{String,Any}, args...) = dim_meta(data["dim"], args...)
dim_meta(pm::_PM.AbstractPowerModel, args...) = dim_meta(pm.ref[:it][:pm][:dim], args...)
dim_meta(data::Dict{String,Any}, args...) = dim_meta(dim(data), args...)
dim_meta(pm::_PM.AbstractPowerModel, args...) = dim_meta(dim(pm), args...)

"""
dim_length(dim::Dict{Symbol,Any}[, dimension])
Expand All @@ -533,5 +543,5 @@ Return the number of networks or, if `dimension` is specified, return its size.
function dim_length end
dim_length(dim::Dict{Symbol,Any}) = length(dim[:li])
dim_length(dim::Dict{Symbol,Any}, dimension::Symbol) = size(dim[:li], dim[:pos][dimension])
dim_length(data::Dict{String,Any}, args...) = dim_length(data["dim"], args...)
dim_length(pm::_PM.AbstractPowerModel, args...) = dim_length(pm.ref[:it][:pm][:dim], args...)
dim_length(data::Dict{String,Any}, args...) = dim_length(dim(data), args...)
dim_length(pm::_PM.AbstractPowerModel, args...) = dim_length(dim(pm), args...)
4 changes: 2 additions & 2 deletions src/core/distribution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function variable_oltc_branch_transform_magnitude_sqr_inv(pm::_PM.AbstractPowerM
end
end

report && _IM.sol_component_value(pm, _PM.pm_it_sym, nw, :branch, :ttmi, _PM.ids(pm, nw, :oltc_branch), ttmi)
report && _PM.sol_component_value(pm, nw, :branch, :ttmi, _PM.ids(pm, nw, :oltc_branch), ttmi)
end

function variable_oltc_ne_branch_transform(pm::_PM.AbstractWModels; kwargs...)
Expand All @@ -68,7 +68,7 @@ function variable_oltc_ne_branch_transform_magnitude_sqr_inv(pm::_PM.AbstractPow
end
end

report && _IM.sol_component_value(pm, _PM.pm_it_sym, nw, :ne_branch, :ttmi, _PM.ids(pm, nw, :oltc_ne_branch), ttmi_ne)
report && _PM.sol_component_value(pm, nw, :ne_branch, :ttmi, _PM.ids(pm, nw, :oltc_ne_branch), ttmi_ne)
end


Expand Down
22 changes: 11 additions & 11 deletions src/core/flexible_demand.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function variable_flexible_demand_indicator(pm::_PM.AbstractPowerModel; nw::Int=
z = _PM.var(pm, nw)[:z_flex] = _PM.var(pm, first_n)[:z_flex]
end
if report
_IM.sol_component_value(pm, _PM.pm_it_sym, nw, :load, :flex, _PM.ids(pm, nw, :flex_load), z)
_PM.sol_component_value(pm, nw, :load, :flex, _PM.ids(pm, nw, :flex_load), z)
_IM.sol_component_fixed(pm, _PM.pm_it_sym, nw, :load, :flex, _PM.ids(pm, nw, :fixed_load), 0.0)
end
end
Expand All @@ -63,7 +63,7 @@ function variable_flexible_demand_investment(pm::_PM.AbstractPowerModel; nw::Int
investment = _PM.var(pm, nw)[:z_flex_investment] = _PM.var(pm, first_n)[:z_flex_investment]
end
if report
_IM.sol_component_value(pm, _PM.pm_it_sym, nw, :load, :investment, _PM.ids(pm, nw, :flex_load), investment)
_PM.sol_component_value(pm, nw, :load, :investment, _PM.ids(pm, nw, :flex_load), investment)
_IM.sol_component_fixed(pm, _PM.pm_it_sym, nw, :load, :investment, _PM.ids(pm, nw, :fixed_load), 0.0)
end
end
Expand All @@ -81,7 +81,7 @@ function variable_total_flex_demand_active(pm::_PM.AbstractPowerModel; nw::Int=_
upper_bound = _PM.ref(pm, nw, :load, i, "pd") * (1 + get(_PM.ref(pm, nw, :load, i), "pshift_up_rel_max", 0.0)), # Not strictly necessary: redundant due to other bounds
start = _PM.comp_start_value(_PM.ref(pm, nw, :load, i), "pd")
)
report && _IM.sol_component_value(pm, _PM.pm_it_sym, nw, :load, :pflex, _PM.ids(pm, nw, :load), pflex)
report && _PM.sol_component_value(pm, nw, :load, :pflex, _PM.ids(pm, nw, :load), pflex)
end

function variable_total_flex_demand_reactive(pm::_PM.AbstractActivePowerModel; nw::Int=_PM.nw_id_default, bounded::Bool=true, report::Bool=true)
Expand All @@ -93,7 +93,7 @@ function variable_total_flex_demand_reactive(pm::_PM.AbstractPowerModel; nw::Int
[i in _PM.ids(pm, nw, :load)], base_name="$(nw)_qflex",
start = _PM.comp_start_value(_PM.ref(pm, nw, :load, i), "qd")
)
report && _IM.sol_component_value(pm, _PM.pm_it_sym, nw, :load, :qflex, _PM.ids(pm, nw, :load), qflex)
report && _PM.sol_component_value(pm, nw, :load, :qflex, _PM.ids(pm, nw, :load), qflex)
end

"Variable for load curtailment (i.e. involuntary demand reduction) at each load point and each time step"
Expand All @@ -104,7 +104,7 @@ function variable_demand_curtailment(pm::_PM.AbstractPowerModel; nw::Int=_PM.nw_
upper_bound = _PM.ref(pm, nw, :load, i, "pd"),
start = 0
)
report && _IM.sol_component_value(pm, _PM.pm_it_sym, nw, :load, :pcurt, _PM.ids(pm, nw, :load), pcurt)
report && _PM.sol_component_value(pm, nw, :load, :pcurt, _PM.ids(pm, nw, :load), pcurt)
end

"Variable for the power not consumed (voluntary load reduction) at each flex load point and each time step"
Expand All @@ -119,7 +119,7 @@ function variable_demand_reduction(pm::_PM.AbstractPowerModel; nw::Int=_PM.nw_id
start = 0
)
if report
_IM.sol_component_value(pm, _PM.pm_it_sym, nw, :load, :pred, _PM.ids(pm, nw, :flex_load), pred)
_PM.sol_component_value(pm, nw, :load, :pred, _PM.ids(pm, nw, :flex_load), pred)
_IM.sol_component_fixed(pm, _PM.pm_it_sym, nw, :load, :pred, _PM.ids(pm, nw, :fixed_load), 0.0)
end
end
Expand All @@ -134,7 +134,7 @@ function variable_energy_not_consumed(pm::_PM.AbstractPowerModel; nw::Int=_PM.nw
start = 0
)
if report
_IM.sol_component_value(pm, _PM.pm_it_sym, nw, :load, :ered, _PM.ids(pm, nw, :flex_load), ered)
_PM.sol_component_value(pm, nw, :load, :ered, _PM.ids(pm, nw, :flex_load), ered)
_IM.sol_component_fixed(pm, _PM.pm_it_sym, nw, :load, :ered, _PM.ids(pm, nw, :fixed_load), 0.0)
end
end
Expand All @@ -151,7 +151,7 @@ function variable_demand_shifting_upwards(pm::_PM.AbstractPowerModel; nw::Int=_P
start = 0
)
if report
_IM.sol_component_value(pm, _PM.pm_it_sym, nw, :load, :pshift_up, _PM.ids(pm, nw, :flex_load), pshift_up)
_PM.sol_component_value(pm, nw, :load, :pshift_up, _PM.ids(pm, nw, :flex_load), pshift_up)
_IM.sol_component_fixed(pm, _PM.pm_it_sym, nw, :load, :pshift_up, _PM.ids(pm, nw, :fixed_load), 0.0)
end
end
Expand All @@ -167,7 +167,7 @@ function variable_total_demand_shifting_upwards(pm::_PM.AbstractPowerModel; nw::
start = 0
)
if report
_IM.sol_component_value(pm, _PM.pm_it_sym, nw, :load, :eshift_up, _PM.ids(pm, nw, :flex_load), eshift_up)
_PM.sol_component_value(pm, nw, :load, :eshift_up, _PM.ids(pm, nw, :flex_load), eshift_up)
_IM.sol_component_fixed(pm, _PM.pm_it_sym, nw, :load, :eshift_up, _PM.ids(pm, nw, :fixed_load), 0.0)
end
end
Expand All @@ -184,7 +184,7 @@ function variable_demand_shifting_downwards(pm::_PM.AbstractPowerModel; nw::Int=
start = 0
)
if report
_IM.sol_component_value(pm, _PM.pm_it_sym, nw, :load, :pshift_down, _PM.ids(pm, nw, :flex_load), pshift_down)
_PM.sol_component_value(pm, nw, :load, :pshift_down, _PM.ids(pm, nw, :flex_load), pshift_down)
_IM.sol_component_fixed(pm, _PM.pm_it_sym, nw, :load, :pshift_down, _PM.ids(pm, nw, :fixed_load), 0.0)
end
end
Expand All @@ -199,7 +199,7 @@ function variable_total_demand_shifting_downwards(pm::_PM.AbstractPowerModel; nw
start = 0
)
if report
_IM.sol_component_value(pm, _PM.pm_it_sym, nw, :load, :eshift_down, _PM.ids(pm, nw, :flex_load), eshift_down)
_PM.sol_component_value(pm, nw, :load, :eshift_down, _PM.ids(pm, nw, :flex_load), eshift_down)
_IM.sol_component_fixed(pm, _PM.pm_it_sym, nw, :load, :eshift_down, _PM.ids(pm, nw, :fixed_load), 0.0)
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/core/gen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ function expression_gen_curtailment(pm::_PM.AbstractPowerModel; nw::Int=_PM.nw_i
)
if report
_IM.sol_component_fixed(pm, _PM.pm_it_sym, nw, :gen, :pgcurt, _PM.ids(pm, nw, :dgen), 0.0)
_IM.sol_component_value(pm, _PM.pm_it_sym, nw, :gen, :pgcurt, _PM.ids(pm, nw, :ndgen), pgcurt)
_PM.sol_component_value(pm, nw, :gen, :pgcurt, _PM.ids(pm, nw, :ndgen), pgcurt)
end
end
Loading

2 comments on commit f2cc7ec

@hakanergun
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/55269

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.1 -m "<description of version>" f2cc7ec32b523a7c62802f576a07b780479eb804
git push origin v0.2.1

Please sign in to comment.