Skip to content

Commit

Permalink
add attribute containers to the auto gen code
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-lara committed Mar 4, 2024
1 parent b32e226 commit 630542b
Show file tree
Hide file tree
Showing 30 changed files with 580 additions and 116 deletions.
203 changes: 203 additions & 0 deletions src/descriptors/power_system_structs.json

Large diffs are not rendered by default.

17 changes: 13 additions & 4 deletions src/models/generated/Area.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This file is auto-generated. Do not edit.
peak_reactive_power::Float64
load_response::Float64
time_series_container::InfrastructureSystems.TimeSeriesContainer
supplemental_attributes_container::InfrastructureSystems.SupplementalAttributesContainer
internal::InfrastructureSystemsInternal
end
Expand All @@ -22,6 +23,7 @@ A collection of buses for control purposes.
- `peak_reactive_power::Float64`
- `load_response::Float64`
- `time_series_container::InfrastructureSystems.TimeSeriesContainer`: internal time_series storage
- `supplemental_attributes_container::InfrastructureSystems.SupplementalAttributesContainer`: container for supplemental attributes
- `internal::InfrastructureSystemsInternal`: power system internal reference, do not modify
"""
mutable struct Area <: AggregationTopology
Expand All @@ -31,16 +33,18 @@ mutable struct Area <: AggregationTopology
load_response::Float64
"internal time_series storage"
time_series_container::InfrastructureSystems.TimeSeriesContainer
"container for supplemental attributes"
supplemental_attributes_container::InfrastructureSystems.SupplementalAttributesContainer
"power system internal reference, do not modify"
internal::InfrastructureSystemsInternal
end

function Area(name, peak_active_power=0.0, peak_reactive_power=0.0, load_response=0.0, time_series_container=InfrastructureSystems.TimeSeriesContainer(), )
Area(name, peak_active_power, peak_reactive_power, load_response, time_series_container, InfrastructureSystemsInternal(), )
function Area(name, peak_active_power=0.0, peak_reactive_power=0.0, load_response=0.0, time_series_container=InfrastructureSystems.TimeSeriesContainer(), supplemental_attributes_container=InfrastructureSystems.SupplementalAttributesContainer(), )
Area(name, peak_active_power, peak_reactive_power, load_response, time_series_container, supplemental_attributes_container, InfrastructureSystemsInternal(), )
end

function Area(; name, peak_active_power=0.0, peak_reactive_power=0.0, load_response=0.0, time_series_container=InfrastructureSystems.TimeSeriesContainer(), internal=InfrastructureSystemsInternal(), )
Area(name, peak_active_power, peak_reactive_power, load_response, time_series_container, internal, )
function Area(; name, peak_active_power=0.0, peak_reactive_power=0.0, load_response=0.0, time_series_container=InfrastructureSystems.TimeSeriesContainer(), supplemental_attributes_container=InfrastructureSystems.SupplementalAttributesContainer(), internal=InfrastructureSystemsInternal(), )
Area(name, peak_active_power, peak_reactive_power, load_response, time_series_container, supplemental_attributes_container, internal, )
end

# Constructor for demo purposes; non-functional.
Expand All @@ -51,6 +55,7 @@ function Area(::Nothing)
peak_reactive_power=0.0,
load_response=0.0,
time_series_container=InfrastructureSystems.TimeSeriesContainer(),
supplemental_attributes_container=InfrastructureSystems.SupplementalAttributesContainer(),
)
end

Expand All @@ -64,6 +69,8 @@ get_peak_reactive_power(value::Area) = get_value(value, value.peak_reactive_powe
get_load_response(value::Area) = value.load_response
"""Get [`Area`](@ref) `time_series_container`."""
get_time_series_container(value::Area) = value.time_series_container
"""Get [`Area`](@ref) `supplemental_attributes_container`."""
get_supplemental_attributes_container(value::Area) = value.supplemental_attributes_container
"""Get [`Area`](@ref) `internal`."""
get_internal(value::Area) = value.internal

Expand All @@ -75,3 +82,5 @@ set_peak_reactive_power!(value::Area, val) = value.peak_reactive_power = set_val
set_load_response!(value::Area, val) = value.load_response = val
"""Set [`Area`](@ref) `time_series_container`."""
set_time_series_container!(value::Area, val) = value.time_series_container = val
"""Set [`Area`](@ref) `supplemental_attributes_container`."""
set_supplemental_attributes_container!(value::Area, val) = value.supplemental_attributes_container = val
17 changes: 13 additions & 4 deletions src/models/generated/BatteryEMS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ This file is auto-generated. Do not edit.
dynamic_injector::Union{Nothing, DynamicInjection}
ext::Dict{String, Any}
time_series_container::InfrastructureSystems.TimeSeriesContainer
supplemental_attributes_container::InfrastructureSystems.SupplementalAttributesContainer
internal::InfrastructureSystemsInternal
end
Expand Down Expand Up @@ -54,6 +55,7 @@ Data structure for a battery compatible with energy management formulations.
- `dynamic_injector::Union{Nothing, DynamicInjection}`: corresponding dynamic injection device
- `ext::Dict{String, Any}`
- `time_series_container::InfrastructureSystems.TimeSeriesContainer`: internal time_series storage
- `supplemental_attributes_container::InfrastructureSystems.SupplementalAttributesContainer`: container for supplemental attributes
- `internal::InfrastructureSystemsInternal`: power system internal reference, do not modify
"""
mutable struct BatteryEMS <: Storage
Expand Down Expand Up @@ -87,16 +89,18 @@ mutable struct BatteryEMS <: Storage
ext::Dict{String, Any}
"internal time_series storage"
time_series_container::InfrastructureSystems.TimeSeriesContainer
"container for supplemental attributes"
supplemental_attributes_container::InfrastructureSystems.SupplementalAttributesContainer
"power system internal reference, do not modify"
internal::InfrastructureSystemsInternal
end

function BatteryEMS(name, available, bus, prime_mover_type, initial_energy, state_of_charge_limits, rating, active_power, input_active_power_limits, output_active_power_limits, efficiency, reactive_power, reactive_power_limits, base_power, operation_cost=Union{StorageManagementCost, MarketBidCost}, storage_target=0.0, cycle_limits=1e4, services=Device[], dynamic_injector=nothing, ext=Dict{String, Any}(), time_series_container=InfrastructureSystems.TimeSeriesContainer(), )
BatteryEMS(name, available, bus, prime_mover_type, initial_energy, state_of_charge_limits, rating, active_power, input_active_power_limits, output_active_power_limits, efficiency, reactive_power, reactive_power_limits, base_power, operation_cost, storage_target, cycle_limits, services, dynamic_injector, ext, time_series_container, InfrastructureSystemsInternal(), )
function BatteryEMS(name, available, bus, prime_mover_type, initial_energy, state_of_charge_limits, rating, active_power, input_active_power_limits, output_active_power_limits, efficiency, reactive_power, reactive_power_limits, base_power, operation_cost=Union{StorageManagementCost, MarketBidCost}, storage_target=0.0, cycle_limits=1e4, services=Device[], dynamic_injector=nothing, ext=Dict{String, Any}(), time_series_container=InfrastructureSystems.TimeSeriesContainer(), supplemental_attributes_container=InfrastructureSystems.SupplementalAttributesContainer(), )
BatteryEMS(name, available, bus, prime_mover_type, initial_energy, state_of_charge_limits, rating, active_power, input_active_power_limits, output_active_power_limits, efficiency, reactive_power, reactive_power_limits, base_power, operation_cost, storage_target, cycle_limits, services, dynamic_injector, ext, time_series_container, supplemental_attributes_container, InfrastructureSystemsInternal(), )
end

function BatteryEMS(; name, available, bus, prime_mover_type, initial_energy, state_of_charge_limits, rating, active_power, input_active_power_limits, output_active_power_limits, efficiency, reactive_power, reactive_power_limits, base_power, operation_cost=Union{StorageManagementCost, MarketBidCost}, storage_target=0.0, cycle_limits=1e4, services=Device[], dynamic_injector=nothing, ext=Dict{String, Any}(), time_series_container=InfrastructureSystems.TimeSeriesContainer(), internal=InfrastructureSystemsInternal(), )
BatteryEMS(name, available, bus, prime_mover_type, initial_energy, state_of_charge_limits, rating, active_power, input_active_power_limits, output_active_power_limits, efficiency, reactive_power, reactive_power_limits, base_power, operation_cost, storage_target, cycle_limits, services, dynamic_injector, ext, time_series_container, internal, )
function BatteryEMS(; name, available, bus, prime_mover_type, initial_energy, state_of_charge_limits, rating, active_power, input_active_power_limits, output_active_power_limits, efficiency, reactive_power, reactive_power_limits, base_power, operation_cost=Union{StorageManagementCost, MarketBidCost}, storage_target=0.0, cycle_limits=1e4, services=Device[], dynamic_injector=nothing, ext=Dict{String, Any}(), time_series_container=InfrastructureSystems.TimeSeriesContainer(), supplemental_attributes_container=InfrastructureSystems.SupplementalAttributesContainer(), internal=InfrastructureSystemsInternal(), )
BatteryEMS(name, available, bus, prime_mover_type, initial_energy, state_of_charge_limits, rating, active_power, input_active_power_limits, output_active_power_limits, efficiency, reactive_power, reactive_power_limits, base_power, operation_cost, storage_target, cycle_limits, services, dynamic_injector, ext, time_series_container, supplemental_attributes_container, internal, )
end

# Constructor for demo purposes; non-functional.
Expand All @@ -123,6 +127,7 @@ function BatteryEMS(::Nothing)
dynamic_injector=nothing,
ext=Dict{String, Any}(),
time_series_container=InfrastructureSystems.TimeSeriesContainer(),
supplemental_attributes_container=InfrastructureSystems.SupplementalAttributesContainer(),
)
end

Expand Down Expand Up @@ -168,6 +173,8 @@ get_dynamic_injector(value::BatteryEMS) = value.dynamic_injector
get_ext(value::BatteryEMS) = value.ext
"""Get [`BatteryEMS`](@ref) `time_series_container`."""
get_time_series_container(value::BatteryEMS) = value.time_series_container
"""Get [`BatteryEMS`](@ref) `supplemental_attributes_container`."""
get_supplemental_attributes_container(value::BatteryEMS) = value.supplemental_attributes_container
"""Get [`BatteryEMS`](@ref) `internal`."""
get_internal(value::BatteryEMS) = value.internal

Expand Down Expand Up @@ -209,3 +216,5 @@ set_services!(value::BatteryEMS, val) = value.services = val
set_ext!(value::BatteryEMS, val) = value.ext = val
"""Set [`BatteryEMS`](@ref) `time_series_container`."""
set_time_series_container!(value::BatteryEMS, val) = value.time_series_container = val
"""Set [`BatteryEMS`](@ref) `supplemental_attributes_container`."""
set_supplemental_attributes_container!(value::BatteryEMS, val) = value.supplemental_attributes_container = val
17 changes: 13 additions & 4 deletions src/models/generated/ExponentialLoad.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ This file is auto-generated. Do not edit.
dynamic_injector::Union{Nothing, DynamicInjection}
ext::Dict{String, Any}
time_series_container::InfrastructureSystems.TimeSeriesContainer
supplemental_attributes_container::InfrastructureSystems.SupplementalAttributesContainer
internal::InfrastructureSystemsInternal
end
Expand All @@ -40,6 +41,7 @@ Data structure for a static exponential load.
- `dynamic_injector::Union{Nothing, DynamicInjection}`: corresponding dynamic injection device
- `ext::Dict{String, Any}`
- `time_series_container::InfrastructureSystems.TimeSeriesContainer`: internal time_series storage
- `supplemental_attributes_container::InfrastructureSystems.SupplementalAttributesContainer`: container for supplemental attributes
- `internal::InfrastructureSystemsInternal`: power system internal reference, do not modify
"""
mutable struct ExponentialLoad <: StaticLoad
Expand All @@ -63,16 +65,18 @@ mutable struct ExponentialLoad <: StaticLoad
ext::Dict{String, Any}
"internal time_series storage"
time_series_container::InfrastructureSystems.TimeSeriesContainer
"container for supplemental attributes"
supplemental_attributes_container::InfrastructureSystems.SupplementalAttributesContainer
"power system internal reference, do not modify"
internal::InfrastructureSystemsInternal
end

function ExponentialLoad(name, available, bus, active_power, reactive_power, active_power_coefficient, reactive_power_coefficient, base_power, max_active_power, max_reactive_power, services=Device[], dynamic_injector=nothing, ext=Dict{String, Any}(), time_series_container=InfrastructureSystems.TimeSeriesContainer(), )
ExponentialLoad(name, available, bus, active_power, reactive_power, active_power_coefficient, reactive_power_coefficient, base_power, max_active_power, max_reactive_power, services, dynamic_injector, ext, time_series_container, InfrastructureSystemsInternal(), )
function ExponentialLoad(name, available, bus, active_power, reactive_power, active_power_coefficient, reactive_power_coefficient, base_power, max_active_power, max_reactive_power, services=Device[], dynamic_injector=nothing, ext=Dict{String, Any}(), time_series_container=InfrastructureSystems.TimeSeriesContainer(), supplemental_attributes_container=InfrastructureSystems.SupplementalAttributesContainer(), )
ExponentialLoad(name, available, bus, active_power, reactive_power, active_power_coefficient, reactive_power_coefficient, base_power, max_active_power, max_reactive_power, services, dynamic_injector, ext, time_series_container, supplemental_attributes_container, InfrastructureSystemsInternal(), )
end

function ExponentialLoad(; name, available, bus, active_power, reactive_power, active_power_coefficient, reactive_power_coefficient, base_power, max_active_power, max_reactive_power, services=Device[], dynamic_injector=nothing, ext=Dict{String, Any}(), time_series_container=InfrastructureSystems.TimeSeriesContainer(), internal=InfrastructureSystemsInternal(), )
ExponentialLoad(name, available, bus, active_power, reactive_power, active_power_coefficient, reactive_power_coefficient, base_power, max_active_power, max_reactive_power, services, dynamic_injector, ext, time_series_container, internal, )
function ExponentialLoad(; name, available, bus, active_power, reactive_power, active_power_coefficient, reactive_power_coefficient, base_power, max_active_power, max_reactive_power, services=Device[], dynamic_injector=nothing, ext=Dict{String, Any}(), time_series_container=InfrastructureSystems.TimeSeriesContainer(), supplemental_attributes_container=InfrastructureSystems.SupplementalAttributesContainer(), internal=InfrastructureSystemsInternal(), )
ExponentialLoad(name, available, bus, active_power, reactive_power, active_power_coefficient, reactive_power_coefficient, base_power, max_active_power, max_reactive_power, services, dynamic_injector, ext, time_series_container, supplemental_attributes_container, internal, )
end

# Constructor for demo purposes; non-functional.
Expand All @@ -92,6 +96,7 @@ function ExponentialLoad(::Nothing)
dynamic_injector=nothing,
ext=Dict{String, Any}(),
time_series_container=InfrastructureSystems.TimeSeriesContainer(),
supplemental_attributes_container=InfrastructureSystems.SupplementalAttributesContainer(),
)
end

Expand Down Expand Up @@ -123,6 +128,8 @@ get_dynamic_injector(value::ExponentialLoad) = value.dynamic_injector
get_ext(value::ExponentialLoad) = value.ext
"""Get [`ExponentialLoad`](@ref) `time_series_container`."""
get_time_series_container(value::ExponentialLoad) = value.time_series_container
"""Get [`ExponentialLoad`](@ref) `supplemental_attributes_container`."""
get_supplemental_attributes_container(value::ExponentialLoad) = value.supplemental_attributes_container
"""Get [`ExponentialLoad`](@ref) `internal`."""
get_internal(value::ExponentialLoad) = value.internal

Expand Down Expand Up @@ -150,3 +157,5 @@ set_services!(value::ExponentialLoad, val) = value.services = val
set_ext!(value::ExponentialLoad, val) = value.ext = val
"""Set [`ExponentialLoad`](@ref) `time_series_container`."""
set_time_series_container!(value::ExponentialLoad, val) = value.time_series_container = val
"""Set [`ExponentialLoad`](@ref) `supplemental_attributes_container`."""
set_supplemental_attributes_container!(value::ExponentialLoad, val) = value.supplemental_attributes_container = val
17 changes: 13 additions & 4 deletions src/models/generated/FixedAdmittance.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This file is auto-generated. Do not edit.
services::Vector{Service}
ext::Dict{String, Any}
time_series_container::InfrastructureSystems.TimeSeriesContainer
supplemental_attributes_container::InfrastructureSystems.SupplementalAttributesContainer
internal::InfrastructureSystemsInternal
end
Expand All @@ -28,6 +29,7 @@ This file is auto-generated. Do not edit.
- `services::Vector{Service}`: Services that this device contributes to
- `ext::Dict{String, Any}`
- `time_series_container::InfrastructureSystems.TimeSeriesContainer`: internal time_series storage
- `supplemental_attributes_container::InfrastructureSystems.SupplementalAttributesContainer`: container for supplemental attributes
- `internal::InfrastructureSystemsInternal`: power system internal reference, do not modify
"""
mutable struct FixedAdmittance <: ElectricLoad
Expand All @@ -43,16 +45,18 @@ mutable struct FixedAdmittance <: ElectricLoad
ext::Dict{String, Any}
"internal time_series storage"
time_series_container::InfrastructureSystems.TimeSeriesContainer
"container for supplemental attributes"
supplemental_attributes_container::InfrastructureSystems.SupplementalAttributesContainer
"power system internal reference, do not modify"
internal::InfrastructureSystemsInternal
end

function FixedAdmittance(name, available, bus, Y, dynamic_injector=nothing, services=Device[], ext=Dict{String, Any}(), time_series_container=InfrastructureSystems.TimeSeriesContainer(), )
FixedAdmittance(name, available, bus, Y, dynamic_injector, services, ext, time_series_container, InfrastructureSystemsInternal(), )
function FixedAdmittance(name, available, bus, Y, dynamic_injector=nothing, services=Device[], ext=Dict{String, Any}(), time_series_container=InfrastructureSystems.TimeSeriesContainer(), supplemental_attributes_container=InfrastructureSystems.SupplementalAttributesContainer(), )
FixedAdmittance(name, available, bus, Y, dynamic_injector, services, ext, time_series_container, supplemental_attributes_container, InfrastructureSystemsInternal(), )
end

function FixedAdmittance(; name, available, bus, Y, dynamic_injector=nothing, services=Device[], ext=Dict{String, Any}(), time_series_container=InfrastructureSystems.TimeSeriesContainer(), internal=InfrastructureSystemsInternal(), )
FixedAdmittance(name, available, bus, Y, dynamic_injector, services, ext, time_series_container, internal, )
function FixedAdmittance(; name, available, bus, Y, dynamic_injector=nothing, services=Device[], ext=Dict{String, Any}(), time_series_container=InfrastructureSystems.TimeSeriesContainer(), supplemental_attributes_container=InfrastructureSystems.SupplementalAttributesContainer(), internal=InfrastructureSystemsInternal(), )
FixedAdmittance(name, available, bus, Y, dynamic_injector, services, ext, time_series_container, supplemental_attributes_container, internal, )
end

# Constructor for demo purposes; non-functional.
Expand All @@ -66,6 +70,7 @@ function FixedAdmittance(::Nothing)
services=Device[],
ext=Dict{String, Any}(),
time_series_container=InfrastructureSystems.TimeSeriesContainer(),
supplemental_attributes_container=InfrastructureSystems.SupplementalAttributesContainer(),
)
end

Expand All @@ -85,6 +90,8 @@ get_services(value::FixedAdmittance) = value.services
get_ext(value::FixedAdmittance) = value.ext
"""Get [`FixedAdmittance`](@ref) `time_series_container`."""
get_time_series_container(value::FixedAdmittance) = value.time_series_container
"""Get [`FixedAdmittance`](@ref) `supplemental_attributes_container`."""
get_supplemental_attributes_container(value::FixedAdmittance) = value.supplemental_attributes_container
"""Get [`FixedAdmittance`](@ref) `internal`."""
get_internal(value::FixedAdmittance) = value.internal

Expand All @@ -100,3 +107,5 @@ set_services!(value::FixedAdmittance, val) = value.services = val
set_ext!(value::FixedAdmittance, val) = value.ext = val
"""Set [`FixedAdmittance`](@ref) `time_series_container`."""
set_time_series_container!(value::FixedAdmittance, val) = value.time_series_container = val
"""Set [`FixedAdmittance`](@ref) `supplemental_attributes_container`."""
set_supplemental_attributes_container!(value::FixedAdmittance, val) = value.supplemental_attributes_container = val
Loading

0 comments on commit 630542b

Please sign in to comment.