Skip to content

Commit

Permalink
Refine usage of LoadCost
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielKS committed Mar 22, 2024
1 parent ddd5d08 commit 2d434dd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 23 deletions.
7 changes: 0 additions & 7 deletions src/descriptors/power_system_structs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2592,13 +2592,6 @@
},
"validation_action": "warn"
},
{
"name": "operation_cost",
"null_value": "LoadCost(nothing)",
"data_type": "OperationalCost",
"default": "LoadCost(nothing)",
"comment": "Operation Cost of Generation [`OperationalCost`](@ref)"
},
{
"name": "efficiency",
"comment": "Conversion efficiency from AC Power to DC Power",
Expand Down
9 changes: 6 additions & 3 deletions src/models/cost_functions/LoadCost.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
end
Data structure for the operational cost of loads, including fixed and variable cost components.
Data structure for the operational cost of loads (e.g., InterruptiblePowerLoad), including
fixed and variable cost components.
# Arguments
- `variable::ProductionVariableCost`: Variable cost. Can take fuel curves or cost curve represenations.
- `fixed::Union{Nothing, Float64}`: Fixed cost of keeping the unit online. For some cost represenations this field can be duplicative.
- `variable::ProductionVariableCost`: Variable cost. Can take fuel curves or cost curve
represenations.
- `fixed::Union{Nothing, Float64}`: Fixed cost of keeping the unit online. For some cost
represenations this field can be duplicative.
"""
mutable struct LoadCost <: OperationalCost
"variable cost"
Expand Down
17 changes: 4 additions & 13 deletions src/models/generated/InterconnectingConverter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ This file is auto-generated. Do not edit.
rating::Float64
active_power_limits::MinMax
base_power::Float64
operation_cost::OperationalCost
efficiency::Float64
services::Vector{Service}
dynamic_injector::Union{Nothing, DynamicInjection}
Expand All @@ -35,7 +34,6 @@ Interconnecting Power Converter (IPC) for transforming power from an ACBus to a
- `rating::Float64`: Thermal limited MVA Power Output of the converter. <= Capacity, validation range: `(0, nothing)`, action if invalid: `error`
- `active_power_limits::MinMax`
- `base_power::Float64`: Base power of the converter in MVA, validation range: `(0, nothing)`, action if invalid: `warn`
- `operation_cost::OperationalCost`: Operation Cost of Generation [`OperationalCost`](@ref)
- `efficiency::Float64`: Conversion efficiency from AC Power to DC Power
- `services::Vector{Service}`: Services that this device contributes to
- `dynamic_injector::Union{Nothing, DynamicInjection}`: corresponding dynamic injection device
Expand All @@ -56,8 +54,6 @@ mutable struct InterconnectingConverter <: StaticInjection
active_power_limits::MinMax
"Base power of the converter in MVA"
base_power::Float64
"Operation Cost of Generation [`OperationalCost`](@ref)"
operation_cost::OperationalCost
"Conversion efficiency from AC Power to DC Power"
efficiency::Float64
"Services that this device contributes to"
Expand All @@ -73,12 +69,12 @@ mutable struct InterconnectingConverter <: StaticInjection
internal::InfrastructureSystemsInternal
end

function InterconnectingConverter(name, available, bus, dc_bus, active_power, rating, active_power_limits, base_power, operation_cost=LoadCost(nothing), efficiency=1.0, services=Device[], dynamic_injector=nothing, ext=Dict{String, Any}(), time_series_container=InfrastructureSystems.TimeSeriesContainer(), supplemental_attributes_container=InfrastructureSystems.SupplementalAttributesContainer(), )
InterconnectingConverter(name, available, bus, dc_bus, active_power, rating, active_power_limits, base_power, operation_cost, efficiency, services, dynamic_injector, ext, time_series_container, supplemental_attributes_container, InfrastructureSystemsInternal(), )
function InterconnectingConverter(name, available, bus, dc_bus, active_power, rating, active_power_limits, base_power, efficiency=1.0, services=Device[], dynamic_injector=nothing, ext=Dict{String, Any}(), time_series_container=InfrastructureSystems.TimeSeriesContainer(), supplemental_attributes_container=InfrastructureSystems.SupplementalAttributesContainer(), )
InterconnectingConverter(name, available, bus, dc_bus, active_power, rating, active_power_limits, base_power, efficiency, services, dynamic_injector, ext, time_series_container, supplemental_attributes_container, InfrastructureSystemsInternal(), )
end

function InterconnectingConverter(; name, available, bus, dc_bus, active_power, rating, active_power_limits, base_power, operation_cost=LoadCost(nothing), efficiency=1.0, services=Device[], dynamic_injector=nothing, ext=Dict{String, Any}(), time_series_container=InfrastructureSystems.TimeSeriesContainer(), supplemental_attributes_container=InfrastructureSystems.SupplementalAttributesContainer(), internal=InfrastructureSystemsInternal(), )
InterconnectingConverter(name, available, bus, dc_bus, active_power, rating, active_power_limits, base_power, operation_cost, efficiency, services, dynamic_injector, ext, time_series_container, supplemental_attributes_container, internal, )
function InterconnectingConverter(; name, available, bus, dc_bus, active_power, rating, active_power_limits, base_power, efficiency=1.0, services=Device[], dynamic_injector=nothing, ext=Dict{String, Any}(), time_series_container=InfrastructureSystems.TimeSeriesContainer(), supplemental_attributes_container=InfrastructureSystems.SupplementalAttributesContainer(), internal=InfrastructureSystemsInternal(), )
InterconnectingConverter(name, available, bus, dc_bus, active_power, rating, active_power_limits, base_power, efficiency, services, dynamic_injector, ext, time_series_container, supplemental_attributes_container, internal, )
end

# Constructor for demo purposes; non-functional.
Expand All @@ -92,7 +88,6 @@ function InterconnectingConverter(::Nothing)
rating=0.0,
active_power_limits=(min=0.0, max=0.0),
base_power=0.0,
operation_cost=LoadCost(nothing),
efficiency=0.0,
services=Device[],
dynamic_injector=nothing,
Expand All @@ -118,8 +113,6 @@ get_rating(value::InterconnectingConverter) = get_value(value, value.rating)
get_active_power_limits(value::InterconnectingConverter) = get_value(value, value.active_power_limits)
"""Get [`InterconnectingConverter`](@ref) `base_power`."""
get_base_power(value::InterconnectingConverter) = value.base_power
"""Get [`InterconnectingConverter`](@ref) `operation_cost`."""
get_operation_cost(value::InterconnectingConverter) = value.operation_cost
"""Get [`InterconnectingConverter`](@ref) `efficiency`."""
get_efficiency(value::InterconnectingConverter) = value.efficiency
"""Get [`InterconnectingConverter`](@ref) `services`."""
Expand Down Expand Up @@ -149,8 +142,6 @@ set_rating!(value::InterconnectingConverter, val) = value.rating = set_value(val
set_active_power_limits!(value::InterconnectingConverter, val) = value.active_power_limits = set_value(value, val)
"""Set [`InterconnectingConverter`](@ref) `base_power`."""
set_base_power!(value::InterconnectingConverter, val) = value.base_power = val
"""Set [`InterconnectingConverter`](@ref) `operation_cost`."""
set_operation_cost!(value::InterconnectingConverter, val) = value.operation_cost = val
"""Set [`InterconnectingConverter`](@ref) `efficiency`."""
set_efficiency!(value::InterconnectingConverter, val) = value.efficiency = val
"""Set [`InterconnectingConverter`](@ref) `services`."""
Expand Down

0 comments on commit 2d434dd

Please sign in to comment.