From 220b59ce9f949082e7a47aae8942682152707142 Mon Sep 17 00:00:00 2001 From: Jerry Potts <37674411+jerrypotts@users.noreply.github.com> Date: Wed, 18 Sep 2024 11:50:07 -0500 Subject: [PATCH] Jp/genx inputs (#15) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add fields * add electrolyzer and flexible demand structs * typo * update IS dependency * add colocated resources, retireable and retofittable techs * add reserves to SupplyTechnology * fix SupplyTechnology * update storage structs * update TransportTechnology * update Demand Requirements * additional inputs for TransportTechnology * updating naming convention, data types, and adding CurtailableDemandSideTechnology struct * add co2 to SupplyTechnology * typo * export retrofit and retire structs * add name field to retrofits and retirements * export get_technology * add requirements * make parametric an optional field for schema * add policy requirements * change requirements to subset of Service * add utility functions for requirements * change Requirements to IS System Component * add pricecap field * update exports * empty function for blobs * change slack to pricecap * add dependencies for database pipeline * initialize empty functions and added transmission to db pipeline * fixed empty transmission line vector * add power_systems_type back to structs * fix imports * add pre existing generation units * added storage to portfolio * add existing capacity to StorageTechnology * formatting * add parsers for blobs * add demand timeseries * add system to portfolio * change json to json3 in parsers * add dates and timeseries * change supply curve parser to produce tuple of XY_COORDS * remove empty functions * update investment cost to supply curve * add supplemental attributes * add zone struct * add Region abstract type * generalize supplemental_attribute functions * updaet include * change retrofits and retirements to supplemental attributes * name change * add existing capacity supplemental attribute * typos * updating data types and exports for zones * remove Revise * update retirements and retrofits to match structure of existingcapacity * add aggregated versions of retirements and retrofits * cahnge dictionary to vector in existingcapacity * merged electrolyzers with DemandsideTechnology * update field names * update includes * update names and remove unecessary fields * formatter * make Zone optional for SupplyTechnology * remove region * add defaults for storage * remove region from DemandRequirement * renaming file name to fix typo (#14) * remove extra show --------- Co-authored-by: Sourabh Dalvi Co-authored-by: Rodrigo HenrĂ­quez-Auba --- Project.toml | 3 + src/PowerSystemsInvestmentsPortfolios.jl | 34 ++ src/generate_structs.jl | 325 ++++++++++++++++-- .../generated/AggregateRetirementPotential.jl | 56 +++ .../generated/AggregateRetrofitPotential.jl | 74 ++++ src/models/generated/CarbonCaps.jl | 95 +++++ .../CurtailableDemandSideTechnology.jl | 103 ++++++ src/models/generated/DemandRequirement.jl | 44 +-- src/models/generated/DemandSideTechnology.jl | 44 ++- src/models/generated/ExistingCapacity.jl | 56 +++ .../generated/FlexibleDemandTechnology.jl | 95 +++++ .../generated/MinimumCapacityRequirements.jl | 87 +++++ src/models/generated/RetirementPotential.jl | 56 +++ src/models/generated/RetrofitPotential.jl | 56 +++ src/models/generated/StorageTechnology.jl | 220 +++++++++++- src/models/generated/SupplyTechnology.jl | 228 +++++++++--- src/models/generated/TransportTechnology.jl | 120 ++++++- src/models/generated/Zone.jl | 55 +++ src/models/generated/includes.jl | 172 ++++++++- src/models/regions.jl | 20 ++ src/models/requirements.jl | 12 + src/models/technologies.jl | 2 +- src/portfolio.jl | 103 +++++- 23 files changed, 1915 insertions(+), 145 deletions(-) create mode 100644 src/models/generated/AggregateRetirementPotential.jl create mode 100644 src/models/generated/AggregateRetrofitPotential.jl create mode 100644 src/models/generated/CarbonCaps.jl create mode 100644 src/models/generated/CurtailableDemandSideTechnology.jl create mode 100644 src/models/generated/ExistingCapacity.jl create mode 100644 src/models/generated/FlexibleDemandTechnology.jl create mode 100644 src/models/generated/MinimumCapacityRequirements.jl create mode 100644 src/models/generated/RetirementPotential.jl create mode 100644 src/models/generated/RetrofitPotential.jl create mode 100644 src/models/generated/Zone.jl create mode 100644 src/models/regions.jl create mode 100644 src/models/requirements.jl diff --git a/Project.toml b/Project.toml index c423882..e7b2528 100644 --- a/Project.toml +++ b/Project.toml @@ -4,7 +4,9 @@ authors = ["Jose Daniel Lara"] version = "0.1.0" [deps] +DBInterface = "a10d1c49-ce27-4219-8d33-6db1a4562965" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" +Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" InfrastructureSystems = "2cd47ed4-ca9b-11e9-27f2-ab636a7671f1" JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" @@ -12,6 +14,7 @@ JSONSchema = "7d188eb4-7ad8-530c-ae41-71a32a6d4692" PowerSystems = "bcd98974-b02a-5e2f-9ee0-a103f5c450dd" PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d" SQLite = "0aa819cd-b072-5ff4-a722-6bc24af294d9" +TimeSeries = "9e3dc215-6440-5c97-bce1-76c03772f85e" [compat] DocStringExtensions = "~0.9" diff --git a/src/PowerSystemsInvestmentsPortfolios.jl b/src/PowerSystemsInvestmentsPortfolios.jl index c96e1ba..f718841 100644 --- a/src/PowerSystemsInvestmentsPortfolios.jl +++ b/src/PowerSystemsInvestmentsPortfolios.jl @@ -11,29 +11,58 @@ import InfrastructureSystems: get_time_series_array, get_time_series_timestamps, get_time_series_values, + supports_time_series, InfrastructureSystemsInternal, CompressionSettings, CompressionTypes, MultiLogger, LogEventTracker, StructField, + CostCurve, + LinearCurve, InfrastructureSystemsComponent import PowerSystems +import PowerSystems: StorageCost, ThermalGenerationCost + import JSONSchema import JSON3 import PrettyTables import SQLite import DataFrames +import DBInterface +import TimeSeries +import Dates + +# Temporary, imports not working properly for some reason? +using DataFrames +using PowerSystems +using Dates +using TimeSeries export Portfolio export Technology +export Requirements export SupplyTechnology export TransportTechnology export StorageTechnology export DemandRequirement export DemandsideTechnology +export FlexibleDemandTechnology +export Electrolyzers +export CurtailableDemandSideTechnology +export RetireableCapacity +export RetrofitCapacity +export ExistingCapacity +export CarbonCaps +export MinimumCapacityRequirements +export Region +export Zone +export get_technologies +export get_technology +export get_requirements +export get_ext export add_technology! export add_technologies! export read_json_data @@ -43,6 +72,9 @@ export db_to_dataframes export map_prime_mover export dataframe_to_structs export db_to_portfolio_parser +export add_supplemental_attribute! +export remove_supplemental_attribute! +export get_supplemental_attribute const PSY = PowerSystems const IS = InfrastructureSystems @@ -59,6 +91,8 @@ export PrimeMovers export StorageTech include("models/technologies.jl") +include("models/regions.jl") +include("models/requirements.jl") include("models/generated/includes.jl") include("portfolio.jl") include("serialization.jl") diff --git a/src/generate_structs.jl b/src/generate_structs.jl index 06228b7..30f2c48 100644 --- a/src/generate_structs.jl +++ b/src/generate_structs.jl @@ -27,8 +27,8 @@ function generate_invest_structs(directory, data::JSONSchema.Schema; print_resul item["struct_name"] = struct_name item["closing_constructor_text"] = "" - item["parametric"] = input["parametric"] - if haskey(item, "parametric") + if haskey(input, "parametric") + item["parametric"] = input["parametric"] item["constructor_func"] *= "{T}" item["closing_constructor_text"] = " where T <: $(item["parametric"])" end @@ -191,9 +191,9 @@ function db_to_portfolio_parser(database_filepath::AbstractString) #Goal will be be able to read in database and populate structs simultaneously dfs = db_to_dataframes(database_filepath) - p = dataframe_to_structs(dfs) + portfolio = dataframe_to_structs(dfs) - return p + return portfolio end """ @@ -251,59 +251,328 @@ function map_prime_mover(prime_mover::String) "CSP" => PrimeMovers.CP, "RTPV" => PrimeMovers.PVe, "WIND" => PrimeMovers.WT, + "Wind" => PrimeMovers.WT, "STORAGE" => PrimeMovers.BA, ) return mapping_dict[prime_mover] end +function map_prime_mover_to_parametric(prime_mover::String) + mapping_dict = Dict( + "CT" => PSY.ThermalStandard, + "STEAM" => PSY.ThermalStandard, + "CC" => PSY.ThermalStandard, + "SYNC_COND" => PSY.ThermalStandard, + "NUCLEAR" => PSY.ThermalStandard, + "HYDRO" => PSY.ThermalStandard, + "ROR" => PSY.RenewableDispatch, + "PV" => PSY.RenewableDispatch, + "CSP" => PSY.RenewableDispatch, + "RTPV" => PSY.RenewableDispatch, + "WIND" => PSY.RenewableDispatch, + "Wind" => PSY.RenewableDispatch, + ) + + return mapping_dict[prime_mover] +end + +function parse_timestamps_and_values(json_str::String) + # Parse the JSON string into a Julia object + data = JSON3.read(json_str) + + # Initialize arrays to store timestamps and values + timestamps = String[] + values = Float64[] + + # Iterate over each dictionary in the parsed JSON data + for item in data + # Append the timestamp to the timestamps array + push!(timestamps, item["timestamp"]) + + # Append the value to the values array + push!(values, item["value"]) + end + + return timestamps, values +end + +function parse_json_to_arrays(json_str::String) + # Parse the JSON string into a Julia object + data = JSON3.read(json_str) + + # Initialize array to store x and y values + xy_values = [] + + # Iterate over each dictionary in the parsed JSON data + for item in data + # Append the x values to x_values array as vector of named tuples + push!(xy_values, IS.XY_COORDS((Float64(item["from_x"]), Float64(item["from_y"])))) + push!(xy_values, IS.XY_COORDS((Float64(item["to_x"]), Float64(item["to_y"])))) + end + + return unique(xy_values) +end + function dataframe_to_structs(df_dict::Dict) #Initialize Portfolio p = Portfolio(0.07) - #Temporary measure for small database, will go into - #more complex query based methods once database is expanded - - #Populate SupplyTechnology structs from database - for row in eachrow(df_dict["supply_technologies"]) - t = SupplyTechnology{ThermalStandard}(; + #Populate SupplyTechnology structs from database (new builds) + topologies = df_dict["balancing_topologies"] + supply_curves = filter("description" => contains("Supply"), df_dict["piecewise_linear"]) + for row_pw in eachrow(supply_curves) + + # Extract supply curves and IDs + eaid = row_pw["entity_attribute_id"] + supply_curve = row_pw["piecewise_linear_blob"] + supply_curve_parsed = parse_json_to_arrays(supply_curve) + + id = df_dict["attributes"][ + df_dict["attributes"][!, "entity_attribute_id"] .== eaid, + "entity_id", + ] + + # Find corresponding supply technology for that supply curve + row = df_dict["supply_technologies"][ + df_dict["supply_technologies"][!, "technology_id"] .== id, + :, + ] + + #extract area + area = topologies[topologies.name .== row[!, "balancing_topology"][1], "area"][1] + area_int = parse(Int64, area) + + #extract supply curve, does every supply_technology have a supply curve? + #id = row["technology_id"] + #eaid = df_dict["attributes"][df_dict["attributes"] .== id, "entity_attribute_id"][1] + #supply_curve = df_dict["time_series"][df_dict["entity_attribute_id"] .== eaid, "piecewise_linear_blob"][1] + #Now just need to parse the blob + + parametric = map_prime_mover_to_parametric(row[!, "prime_mover"][1]) + t = SupplyTechnology{parametric}(; #Data pulled from DB - name=string(row["technology_id"]), - gen_ID=string(row["technology_id"]), - capital_cost=LinearFunctionData(row["capital_cost"]), - variable_cost=LinearFunctionData(row["vom_cost"]), + name=string(row[!, "technology_id"][1]), + id=row[!, "technology_id"][1], + inv_cost_per_mwyr=InputOutputCurve(PiecewiseLinearData(supply_curve_parsed)), + om_costs=ThermalGenerationCost( + variable=CostCurve(LinearCurve(row[!, "vom_cost"][1])), + fixed=row[!, "fom_cost"][1], + start_up=0.0, + shut_down=0.0, + ), + balancing_topology=string(row[!, "balancing_topology"][1]), + prime_mover_type=map_prime_mover(row[!, "prime_mover"][1]), + fuel=row[!, "fuel_type"][1], + zone=area_int, + + #Problem ones, need to write functions to extract + base_power=100.0, + existing_cap_mw=0.0, + cap_size=250.0, + + # Data we should have but dont currently + start_fuel_mmbtu_per_mw=2.0, + start_cost_per_mw=91.0, + up_time=6.0, + down_time=6.0, + heat_rate_mmbtu_per_mwh=7.43, + co2=0.05306, + ramp_dn_percentage=0.64, + ramp_up_percentage=0.64, + + #Placeholder or default values (modeling assumptions) + region="MA", #this one can probably just be removed from the structs, just descriptor for GenX + available=true, + min_cap_mw=0.0, + min_power=0.0, + max_cap_mw=-1, + power_systems_type=string(parametric), + cluster=1, + reg_max=0.25, + rsv_max=0.5, + #new_build = 1 + ) + add_technology!(p, t) + end + + # Get existing generation units + for row in eachrow(df_dict["generation_units"]) + + #extract area + area = topologies[topologies.name .== row["balancing_topology"], "area"][1] + area_int = parse(Int64, area) + + parametric = map_prime_mover_to_parametric(row["prime_mover"]) + t = SupplyTechnology{parametric}(; + # Data pulled from DB + name=row["name"], + id=row["unit_id"], + inv_cost_per_mwyr=LinearCurve(0.0), #just assume zero since pre-existing? balancing_topology=string(row["balancing_topology"]), - operations_cost=LinearFunctionData(row["fom_cost"]), prime_mover_type=map_prime_mover(row["prime_mover"]), - - #Placeholder values - base_power=100.0, - minimum_required_capacity=0.0, + fuel=row["fuel_type"], + zone=area_int, + base_power=row["base_power"], + existing_cap_mw=row["rating"], + + # Problem ones, need to write functions to extract + cap_size=250.0, + + # Data we should have but dont currently + om_costs=ThermalGenerationCost( + variable=CostCurve(LinearCurve(0.0)), + fixed=0.0, + start_up=0.0, + shut_down=0.0, + ), + start_fuel_mmbtu_per_mw=2.0, + start_cost_per_mw=91.0, + up_time=6.0, + down_time=6.0, + heat_rate_mmbtu_per_mwh=7.43, + co2=0.05306, + ramp_dn_percentage=0.64, + ramp_up_percentage=0.64, + + #Placeholder or default values (modeling assumptions) + region="MA", available=true, - initial_capacity=200.0, - fuel=ThermalFuels.COAL, - power_systems_type="ThermalStandard", - maximum_capacity=10000.0, - capacity_factor=0.98, + min_cap_mw=0.0, + min_power=0.0, + max_cap_mw=-1, + power_systems_type=string(parametric), + cluster=1, + reg_max=0.25, + rsv_max=0.5, + #new_build = 0#0 for existing builds ) add_technology!(p, t) end + # Get storage units + for row in eachrow(df_dict["storage_units"]) + + #extract area + area = topologies[topologies.name .== row["balancing_topology"], "area"][1] + area_int = parse(Int64, area) + + s = StorageTechnology{Storage}(; + #Data pulled from DB + name=row["name"], + base_power=row["base_power"], # Natural Units + id=row["storage_unit_id"], + zone=area_int, + prime_mover_type=map_prime_mover(row["prime_mover"]), + balancing_topology=row["balancing_topology"], + existing_cap_mw=row["rating"], + existing_cap_mwh=row["max_capacity"], + + #stuff we dont have but probably should + om_costs=StorageCost( + charge_variable_cost=CostCurve(LinearCurve(0.0)), + discharge_variable_cost=CostCurve(LinearCurve(0.0)), + fixed=0.0, + start_up=0.0, + shut_down=0.0, + ), + fixed_om_cost_per_mwhyr=LinearCurve(0.0), + eff_up=0.92, + eff_down=0.92, + storage_tech=StorageTech.LIB, + + #Default or placeholder values + inv_cost_per_mwyr=LinearCurve(0.0), + inv_cost_charge_per_mwyr=LinearCurve(0.0), + inv_cost_per_mwhyr=LinearCurve(0.0), + available=true, + region="ME", + cluster=0, + self_disch=0.0, + min_duration=1.0, + max_duration=10.0, + min_cap_mwh=0.0, + min_cap_mw=0.0, + min_charge_cap_mw=-1, + max_cap_mw=-1, + max_charge_cap_mw=-1, + max_cap_mwh=-1, + power_systems_type="Test", + ) + add_technology!(p, s) + end + #Populate DemandRequirement structs from database for row in eachrow(df_dict["demand_requirements"]) + #start in time_series + eaid = row["entity_attribute_id"] + ts_blob = filter("entity_attribute_id" => isequal(eaid), df_dict["time_series"])[ + !, + "time_series_blob", + ][1] + ts_parsed = parse_timestamps_and_values(ts_blob) + dates = ts_parsed[1] #fix this later, dates syntax is inconsistent so hard to parse + dates = DateTime("2020-01-01T00:00:00"):Hour(1):DateTime("2020-12-31T23:00:00") + demand = ts_parsed[2] + demand_array = TimeArray(dates, demand) + ts = SingleTimeSeries(string(row["entity_attribute_id"]), demand_array) + #How to parse this timestamp stuff?? + d = DemandRequirement{ElectricLoad}( #Data pulled from DB name=string(row["entity_attribute_id"]), - region=string(row["area"]), - peak_load=row["peak_load"], + region=row["area"], + zone=parse(Int64, row["area"]), - #Placeholder values - load_growth=0.05, + #Placeholder/default values available=true, power_systems_type="ElectricLoad", ) add_technology!(p, d) + IS.add_time_series!(p.data, d, ts) + end + + #Transmission Lines + lines = df_dict["transmission_lines"] + for row in eachrow(df_dict["transmission_interchange"]) + + # get list of balancing topologies that correspond to the areas for line tx + topologies_from = filter("area" => isequal(row["area_from"]), topologies)[!, "name"] + topologies_to = filter("area" => isequal(row["area_to"]), topologies)[!, "name"] + + existing_capacity = 0.0 + for from in topologies_from + for to in topologies_to + line_cap = lines[ + (lines[ + !, + "balancing_topology_from", + ] .== from) .& (lines[!, "balancing_topology_to"] .== to), + "continuous_rating", + ] + if length(line_cap) == 1 + existing_capacity += line_cap[1] + end + end + end + + tx = TransportTechnology{Branch}(; + name=string(rownumber(row)), + network_lines=rownumber(row), + available=true, + start_region=parse(Int64, row["area_from"]), + end_region=parse(Int64, row["area_to"]), + maximum_new_capacity=row["max_flow_from"], + maximum_flow=row["max_flow_from"], + existing_line_capacity=existing_capacity, + + #stuff we don't have, but probably should + capital_cost=LinearCurve(19261), + line_loss=0.019653847, + power_systems_type="Branch", + ) + add_technology!(p, tx) end return p diff --git a/src/models/generated/AggregateRetirementPotential.jl b/src/models/generated/AggregateRetirementPotential.jl new file mode 100644 index 0000000..66f7cbe --- /dev/null +++ b/src/models/generated/AggregateRetirementPotential.jl @@ -0,0 +1,56 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct AggregateRetirementPotential <: IS.SupplementalAttribute + internal::InfrastructureSystemsInternal + ext::Dict + retirement_potential::Float64 + end + + + +# Arguments +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `retirement_potential::Float64`: (default: `0.0`) Amount of pre-existing capacity for a technology that is eligible for retirement +""" +mutable struct AggregateRetirementPotential <: IS.SupplementalAttribute + "Internal field" + internal::InfrastructureSystemsInternal + "Option for providing additional data" + ext::Dict + "Amount of pre-existing capacity for a technology that is eligible for retirement" + retirement_potential::Float64 +end + + +function AggregateRetirementPotential(; internal=InfrastructureSystemsInternal(), ext=Dict(), retirement_potential=0.0, ) + AggregateRetirementPotential(internal, ext, retirement_potential, ) +end + +# Constructor for demo purposes; non-functional. +function AggregateRetirementPotential(::Nothing) + AggregateRetirementPotential(; + internal=0.0, + ext=0.0, + retirement_potential=0.0, + ) +end + +"""Get [`AggregateRetirementPotential`](@ref) `internal`.""" +get_internal(value::AggregateRetirementPotential) = value.internal +"""Get [`AggregateRetirementPotential`](@ref) `ext`.""" +get_ext(value::AggregateRetirementPotential) = value.ext +"""Get [`AggregateRetirementPotential`](@ref) `retirement_potential`.""" +get_retirement_potential(value::AggregateRetirementPotential) = value.retirement_potential + +"""Set [`AggregateRetirementPotential`](@ref) `internal`.""" +set_internal!(value::AggregateRetirementPotential, val) = value.internal = val +"""Set [`AggregateRetirementPotential`](@ref) `ext`.""" +set_ext!(value::AggregateRetirementPotential, val) = value.ext = val +"""Set [`AggregateRetirementPotential`](@ref) `retirement_potential`.""" +set_retirement_potential!(value::AggregateRetirementPotential, val) = value.retirement_potential = val diff --git a/src/models/generated/AggregateRetrofitPotential.jl b/src/models/generated/AggregateRetrofitPotential.jl new file mode 100644 index 0000000..5f553f8 --- /dev/null +++ b/src/models/generated/AggregateRetrofitPotential.jl @@ -0,0 +1,74 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct AggregateRetrofitPotential <: IS.SupplementalAttribute + retrofit_id::Int64 + retrofit_fraction::Float64 + internal::InfrastructureSystemsInternal + retrofit_potential::Float64 + ext::Dict + end + + + +# Arguments +- `retrofit_id::Int64`: (default: `0`) Unique identifier to group retrofittable source technologies with retrofit options inside the same zone. +- `retrofit_fraction::Float64`: (default: `Dict()`) Fraction of existing capacity that is eligible for retrofits. Alternative to retrofit_potential +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `retrofit_potential::Float64`: (default: `0.0`) Amount of existing capacity for technology that can be retrofitted +- `ext::Dict`: (default: `Dict()`) Option for providing additional data +""" +mutable struct AggregateRetrofitPotential <: IS.SupplementalAttribute + "Unique identifier to group retrofittable source technologies with retrofit options inside the same zone." + retrofit_id::Int64 + "Fraction of existing capacity that is eligible for retrofits. Alternative to retrofit_potential" + retrofit_fraction::Float64 + "Internal field" + internal::InfrastructureSystemsInternal + "Amount of existing capacity for technology that can be retrofitted" + retrofit_potential::Float64 + "Option for providing additional data" + ext::Dict +end + + +function AggregateRetrofitPotential(; retrofit_id=0, retrofit_fraction=Dict(), internal=InfrastructureSystemsInternal(), retrofit_potential=0.0, ext=Dict(), ) + AggregateRetrofitPotential(retrofit_id, retrofit_fraction, internal, retrofit_potential, ext, ) +end + +# Constructor for demo purposes; non-functional. +function AggregateRetrofitPotential(::Nothing) + AggregateRetrofitPotential(; + retrofit_id=Dict(), + retrofit_fraction=Dict(), + internal=Dict(), + retrofit_potential=Dict(), + ext=Dict(), + ) +end + +"""Get [`AggregateRetrofitPotential`](@ref) `retrofit_id`.""" +get_retrofit_id(value::AggregateRetrofitPotential) = value.retrofit_id +"""Get [`AggregateRetrofitPotential`](@ref) `retrofit_fraction`.""" +get_retrofit_fraction(value::AggregateRetrofitPotential) = value.retrofit_fraction +"""Get [`AggregateRetrofitPotential`](@ref) `internal`.""" +get_internal(value::AggregateRetrofitPotential) = value.internal +"""Get [`AggregateRetrofitPotential`](@ref) `retrofit_potential`.""" +get_retrofit_potential(value::AggregateRetrofitPotential) = value.retrofit_potential +"""Get [`AggregateRetrofitPotential`](@ref) `ext`.""" +get_ext(value::AggregateRetrofitPotential) = value.ext + +"""Set [`AggregateRetrofitPotential`](@ref) `retrofit_id`.""" +set_retrofit_id!(value::AggregateRetrofitPotential, val) = value.retrofit_id = val +"""Set [`AggregateRetrofitPotential`](@ref) `retrofit_fraction`.""" +set_retrofit_fraction!(value::AggregateRetrofitPotential, val) = value.retrofit_fraction = val +"""Set [`AggregateRetrofitPotential`](@ref) `internal`.""" +set_internal!(value::AggregateRetrofitPotential, val) = value.internal = val +"""Set [`AggregateRetrofitPotential`](@ref) `retrofit_potential`.""" +set_retrofit_potential!(value::AggregateRetrofitPotential, val) = value.retrofit_potential = val +"""Set [`AggregateRetrofitPotential`](@ref) `ext`.""" +set_ext!(value::AggregateRetrofitPotential, val) = value.ext = val diff --git a/src/models/generated/CarbonCaps.jl b/src/models/generated/CarbonCaps.jl new file mode 100644 index 0000000..a4a1cb3 --- /dev/null +++ b/src/models/generated/CarbonCaps.jl @@ -0,0 +1,95 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct CarbonCaps <: Requirements + name::String + power_systems_type::String + pricecap::Float64 + eligible_zones::Vector{Int64} + internal::InfrastructureSystemsInternal + co_2_max_tons_mwh::Float64 + ext::Dict + co_2_max_mtons::Float64 + available::Bool + end + + + +# Arguments +- `name::String`: The technology name +- `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling +- `pricecap::Float64`: (default: `Inf`) pricecap value for carbon caps +- `eligible_zones::Vector{Int64}`: (default: `Vector{Int64}()`) List of zones that contribute to the carbon cap constraint. +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `co_2_max_tons_mwh::Float64`: (default: `1`) Emission limit in terms of rate (tCO@/MWh) +- `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `co_2_max_mtons::Float64`: (default: `Vector{Int64}()`) Emission limit in absolute values, in Million of tons +- `available::Bool`: Availability +""" +mutable struct CarbonCaps <: Requirements + "The technology name" + name::String + "maps to a valid PowerSystems.jl for PCM modeling" + power_systems_type::String + "pricecap value for carbon caps" + pricecap::Float64 + "List of zones that contribute to the carbon cap constraint." + eligible_zones::Vector{Int64} + "Internal field" + internal::InfrastructureSystemsInternal + "Emission limit in terms of rate (tCO@/MWh)" + co_2_max_tons_mwh::Float64 + "Option for providing additional data" + ext::Dict + "Emission limit in absolute values, in Million of tons" + co_2_max_mtons::Float64 + "Availability" + available::Bool +end + + +function CarbonCaps(; name, power_systems_type, pricecap=Inf, eligible_zones=Vector{Int64}(), internal=InfrastructureSystemsInternal(), co_2_max_tons_mwh=1, ext=Dict(), co_2_max_mtons=Vector{Int64}(), available, ) + CarbonCaps(name, power_systems_type, pricecap, eligible_zones, internal, co_2_max_tons_mwh, ext, co_2_max_mtons, available, ) +end + +"""Get [`CarbonCaps`](@ref) `name`.""" +get_name(value::CarbonCaps) = value.name +"""Get [`CarbonCaps`](@ref) `power_systems_type`.""" +get_power_systems_type(value::CarbonCaps) = value.power_systems_type +"""Get [`CarbonCaps`](@ref) `pricecap`.""" +get_pricecap(value::CarbonCaps) = value.pricecap +"""Get [`CarbonCaps`](@ref) `eligible_zones`.""" +get_eligible_zones(value::CarbonCaps) = value.eligible_zones +"""Get [`CarbonCaps`](@ref) `internal`.""" +get_internal(value::CarbonCaps) = value.internal +"""Get [`CarbonCaps`](@ref) `co_2_max_tons_mwh`.""" +get_co_2_max_tons_mwh(value::CarbonCaps) = value.co_2_max_tons_mwh +"""Get [`CarbonCaps`](@ref) `ext`.""" +get_ext(value::CarbonCaps) = value.ext +"""Get [`CarbonCaps`](@ref) `co_2_max_mtons`.""" +get_co_2_max_mtons(value::CarbonCaps) = value.co_2_max_mtons +"""Get [`CarbonCaps`](@ref) `available`.""" +get_available(value::CarbonCaps) = value.available + +"""Set [`CarbonCaps`](@ref) `name`.""" +set_name!(value::CarbonCaps, val) = value.name = val +"""Set [`CarbonCaps`](@ref) `power_systems_type`.""" +set_power_systems_type!(value::CarbonCaps, val) = value.power_systems_type = val +"""Set [`CarbonCaps`](@ref) `pricecap`.""" +set_pricecap!(value::CarbonCaps, val) = value.pricecap = val +"""Set [`CarbonCaps`](@ref) `eligible_zones`.""" +set_eligible_zones!(value::CarbonCaps, val) = value.eligible_zones = val +"""Set [`CarbonCaps`](@ref) `internal`.""" +set_internal!(value::CarbonCaps, val) = value.internal = val +"""Set [`CarbonCaps`](@ref) `co_2_max_tons_mwh`.""" +set_co_2_max_tons_mwh!(value::CarbonCaps, val) = value.co_2_max_tons_mwh = val +"""Set [`CarbonCaps`](@ref) `ext`.""" +set_ext!(value::CarbonCaps, val) = value.ext = val +"""Set [`CarbonCaps`](@ref) `co_2_max_mtons`.""" +set_co_2_max_mtons!(value::CarbonCaps, val) = value.co_2_max_mtons = val +"""Set [`CarbonCaps`](@ref) `available`.""" +set_available!(value::CarbonCaps, val) = value.available = val diff --git a/src/models/generated/CurtailableDemandSideTechnology.jl b/src/models/generated/CurtailableDemandSideTechnology.jl new file mode 100644 index 0000000..475d0b6 --- /dev/null +++ b/src/models/generated/CurtailableDemandSideTechnology.jl @@ -0,0 +1,103 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct CurtailableDemandSideTechnology{T <: PSY.StaticInjection} <: Technology + name::String + power_systems_type::String + curtailment_cost_mwh::Vector{Float64} + segments::Vector{Int64} + curtailment_cost::Vector{Float64} + voll::Float64 + ext::Dict + internal::InfrastructureSystemsInternal + max_demand_curtailment::Vector{Float64} + available::Bool + end + + + +# Arguments +- `name::String`: The technology name +- `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling +- `curtailment_cost_mwh::Vector{Float64}`: Energy cost of curtailment +- `segments::Vector{Int64}`: Demand segment IDs +- `curtailment_cost::Vector{Float64}`: Fraction of VOLL for curtailment cost +- `voll::Float64`: value of lost load +- `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `max_demand_curtailment::Vector{Float64}`: percent of demand that can be curtailed in that segment +- `available::Bool`: identifies whether the technology is available +""" +mutable struct CurtailableDemandSideTechnology{T <: PSY.StaticInjection} <: Technology + "The technology name" + name::String + "maps to a valid PowerSystems.jl for PCM modeling" + power_systems_type::String + "Energy cost of curtailment" + curtailment_cost_mwh::Vector{Float64} + "Demand segment IDs" + segments::Vector{Int64} + "Fraction of VOLL for curtailment cost" + curtailment_cost::Vector{Float64} + "value of lost load" + voll::Float64 + "Option for providing additional data" + ext::Dict + "Internal field" + internal::InfrastructureSystemsInternal + "percent of demand that can be curtailed in that segment" + max_demand_curtailment::Vector{Float64} + "identifies whether the technology is available" + available::Bool +end + + +function CurtailableDemandSideTechnology{T}(; name, power_systems_type, curtailment_cost_mwh, segments, curtailment_cost, voll, ext=Dict(), internal=InfrastructureSystemsInternal(), max_demand_curtailment, available, ) where T <: PSY.StaticInjection + CurtailableDemandSideTechnology{T}(name, power_systems_type, curtailment_cost_mwh, segments, curtailment_cost, voll, ext, internal, max_demand_curtailment, available, ) +end + +"""Get [`CurtailableDemandSideTechnology`](@ref) `name`.""" +get_name(value::CurtailableDemandSideTechnology) = value.name +"""Get [`CurtailableDemandSideTechnology`](@ref) `power_systems_type`.""" +get_power_systems_type(value::CurtailableDemandSideTechnology) = value.power_systems_type +"""Get [`CurtailableDemandSideTechnology`](@ref) `curtailment_cost_mwh`.""" +get_curtailment_cost_mwh(value::CurtailableDemandSideTechnology) = value.curtailment_cost_mwh +"""Get [`CurtailableDemandSideTechnology`](@ref) `segments`.""" +get_segments(value::CurtailableDemandSideTechnology) = value.segments +"""Get [`CurtailableDemandSideTechnology`](@ref) `curtailment_cost`.""" +get_curtailment_cost(value::CurtailableDemandSideTechnology) = value.curtailment_cost +"""Get [`CurtailableDemandSideTechnology`](@ref) `voll`.""" +get_voll(value::CurtailableDemandSideTechnology) = value.voll +"""Get [`CurtailableDemandSideTechnology`](@ref) `ext`.""" +get_ext(value::CurtailableDemandSideTechnology) = value.ext +"""Get [`CurtailableDemandSideTechnology`](@ref) `internal`.""" +get_internal(value::CurtailableDemandSideTechnology) = value.internal +"""Get [`CurtailableDemandSideTechnology`](@ref) `max_demand_curtailment`.""" +get_max_demand_curtailment(value::CurtailableDemandSideTechnology) = value.max_demand_curtailment +"""Get [`CurtailableDemandSideTechnology`](@ref) `available`.""" +get_available(value::CurtailableDemandSideTechnology) = value.available + +"""Set [`CurtailableDemandSideTechnology`](@ref) `name`.""" +set_name!(value::CurtailableDemandSideTechnology, val) = value.name = val +"""Set [`CurtailableDemandSideTechnology`](@ref) `power_systems_type`.""" +set_power_systems_type!(value::CurtailableDemandSideTechnology, val) = value.power_systems_type = val +"""Set [`CurtailableDemandSideTechnology`](@ref) `curtailment_cost_mwh`.""" +set_curtailment_cost_mwh!(value::CurtailableDemandSideTechnology, val) = value.curtailment_cost_mwh = val +"""Set [`CurtailableDemandSideTechnology`](@ref) `segments`.""" +set_segments!(value::CurtailableDemandSideTechnology, val) = value.segments = val +"""Set [`CurtailableDemandSideTechnology`](@ref) `curtailment_cost`.""" +set_curtailment_cost!(value::CurtailableDemandSideTechnology, val) = value.curtailment_cost = val +"""Set [`CurtailableDemandSideTechnology`](@ref) `voll`.""" +set_voll!(value::CurtailableDemandSideTechnology, val) = value.voll = val +"""Set [`CurtailableDemandSideTechnology`](@ref) `ext`.""" +set_ext!(value::CurtailableDemandSideTechnology, val) = value.ext = val +"""Set [`CurtailableDemandSideTechnology`](@ref) `internal`.""" +set_internal!(value::CurtailableDemandSideTechnology, val) = value.internal = val +"""Set [`CurtailableDemandSideTechnology`](@ref) `max_demand_curtailment`.""" +set_max_demand_curtailment!(value::CurtailableDemandSideTechnology, val) = value.max_demand_curtailment = val +"""Set [`CurtailableDemandSideTechnology`](@ref) `available`.""" +set_available!(value::CurtailableDemandSideTechnology, val) = value.available = val diff --git a/src/models/generated/DemandRequirement.jl b/src/models/generated/DemandRequirement.jl index b83b7f3..7b52fcf 100644 --- a/src/models/generated/DemandRequirement.jl +++ b/src/models/generated/DemandRequirement.jl @@ -6,82 +6,74 @@ This file is auto-generated. Do not edit. """ mutable struct DemandRequirement{T <: PSY.StaticInjection} <: Technology - load_growth::Float64 name::String + zone::Int64 power_systems_type::String internal::InfrastructureSystemsInternal ext::Dict - region::String + demand_mw::Float64 available::Bool - peak_load::Float64 end # Arguments -- `load_growth::Float64`: (default: `1.0`) Annual load growth (%) - `name::String`: The technology name +- `zone::Int64`: Zone Number - `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `ext::Dict`: (default: `Dict()`) Option for providing additional data -- `region::String`: Corresponding region for peak demand +- `demand_mw::Float64`: (default: `0.0`) Demand profile in MW - `available::Bool`: (default: `true`) identifies whether the technology is available -- `peak_load::Float64`: (default: `100.0`) Demand value (MW) for single timepoint (for now) """ mutable struct DemandRequirement{T <: PSY.StaticInjection} <: Technology - "Annual load growth (%)" - load_growth::Float64 "The technology name" name::String + "Zone Number" + zone::Int64 "maps to a valid PowerSystems.jl for PCM modeling" power_systems_type::String "Internal field" internal::InfrastructureSystemsInternal "Option for providing additional data" ext::Dict - "Corresponding region for peak demand" - region::String + "Demand profile in MW" + demand_mw::Float64 "identifies whether the technology is available" available::Bool - "Demand value (MW) for single timepoint (for now)" - peak_load::Float64 end -function DemandRequirement{T}(; load_growth=1.0, name, power_systems_type, internal=InfrastructureSystemsInternal(), ext=Dict(), region, available=true, peak_load=100.0, ) where T <: PSY.StaticInjection - DemandRequirement{T}(load_growth, name, power_systems_type, internal, ext, region, available, peak_load, ) +function DemandRequirement{T}(; name, zone, power_systems_type, internal=InfrastructureSystemsInternal(), ext=Dict(), demand_mw=0.0, available=true, ) where T <: PSY.StaticInjection + DemandRequirement{T}(name, zone, power_systems_type, internal, ext, demand_mw, available, ) end -"""Get [`DemandRequirement`](@ref) `load_growth`.""" -get_load_growth(value::DemandRequirement) = value.load_growth """Get [`DemandRequirement`](@ref) `name`.""" get_name(value::DemandRequirement) = value.name +"""Get [`DemandRequirement`](@ref) `zone`.""" +get_zone(value::DemandRequirement) = value.zone """Get [`DemandRequirement`](@ref) `power_systems_type`.""" get_power_systems_type(value::DemandRequirement) = value.power_systems_type """Get [`DemandRequirement`](@ref) `internal`.""" get_internal(value::DemandRequirement) = value.internal """Get [`DemandRequirement`](@ref) `ext`.""" get_ext(value::DemandRequirement) = value.ext -"""Get [`DemandRequirement`](@ref) `region`.""" -get_region(value::DemandRequirement) = value.region +"""Get [`DemandRequirement`](@ref) `demand_mw`.""" +get_demand_mw(value::DemandRequirement) = value.demand_mw """Get [`DemandRequirement`](@ref) `available`.""" get_available(value::DemandRequirement) = value.available -"""Get [`DemandRequirement`](@ref) `peak_load`.""" -get_peak_load(value::DemandRequirement) = value.peak_load -"""Set [`DemandRequirement`](@ref) `load_growth`.""" -set_load_growth!(value::DemandRequirement, val) = value.load_growth = val """Set [`DemandRequirement`](@ref) `name`.""" set_name!(value::DemandRequirement, val) = value.name = val +"""Set [`DemandRequirement`](@ref) `zone`.""" +set_zone!(value::DemandRequirement, val) = value.zone = val """Set [`DemandRequirement`](@ref) `power_systems_type`.""" set_power_systems_type!(value::DemandRequirement, val) = value.power_systems_type = val """Set [`DemandRequirement`](@ref) `internal`.""" set_internal!(value::DemandRequirement, val) = value.internal = val """Set [`DemandRequirement`](@ref) `ext`.""" set_ext!(value::DemandRequirement, val) = value.ext = val -"""Set [`DemandRequirement`](@ref) `region`.""" -set_region!(value::DemandRequirement, val) = value.region = val +"""Set [`DemandRequirement`](@ref) `demand_mw`.""" +set_demand_mw!(value::DemandRequirement, val) = value.demand_mw = val """Set [`DemandRequirement`](@ref) `available`.""" set_available!(value::DemandRequirement, val) = value.available = val -"""Set [`DemandRequirement`](@ref) `peak_load`.""" -set_peak_load!(value::DemandRequirement, val) = value.peak_load = val diff --git a/src/models/generated/DemandSideTechnology.jl b/src/models/generated/DemandSideTechnology.jl index 3e6be7d..546f601 100644 --- a/src/models/generated/DemandSideTechnology.jl +++ b/src/models/generated/DemandSideTechnology.jl @@ -6,58 +6,98 @@ This file is auto-generated. Do not edit. """ mutable struct DemandSideTechnology{T <: PSY.StaticInjection} <: Technology + min_power::Float64 name::String + ramp_up_percentage::Float64 power_systems_type::String internal::InfrastructureSystemsInternal + price_per_unit::Float64 ext::Dict + technology_efficiency::Float64 + ramp_dn_percentage::Float64 available::Bool end # Arguments +- `min_power::Float64`: (default: `0.0`) Minimum operation of demandside unit as a fraction of total capacity - `name::String`: The technology name +- `ramp_up_percentage::Float64`: (default: `1.0`) Maximum increase in output between operation periods. Fraction of total capacity - `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `price_per_unit::Float64`: (default: `0.0`) Price or value per unit of output. Ex: USD per ton of hydrogen for electrolyzers - `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `technology_efficiency::Float64`: (default: `0.0`) MWh of electricity per unit of output. Ex: MWh per ton of hydrogen for electrolyzers +- `ramp_dn_percentage::Float64`: (default: `1.0`) Maximum decrease in output between operation periods. Fraction of total capacity - `available::Bool`: identifies whether the technology is available """ mutable struct DemandSideTechnology{T <: PSY.StaticInjection} <: Technology + "Minimum operation of demandside unit as a fraction of total capacity" + min_power::Float64 "The technology name" name::String + "Maximum increase in output between operation periods. Fraction of total capacity" + ramp_up_percentage::Float64 "maps to a valid PowerSystems.jl for PCM modeling" power_systems_type::String "Internal field" internal::InfrastructureSystemsInternal + "Price or value per unit of output. Ex: USD per ton of hydrogen for electrolyzers" + price_per_unit::Float64 "Option for providing additional data" ext::Dict + "MWh of electricity per unit of output. Ex: MWh per ton of hydrogen for electrolyzers" + technology_efficiency::Float64 + "Maximum decrease in output between operation periods. Fraction of total capacity" + ramp_dn_percentage::Float64 "identifies whether the technology is available" available::Bool end -function DemandSideTechnology{T}(; name, power_systems_type, internal=InfrastructureSystemsInternal(), ext=Dict(), available, ) where T <: PSY.StaticInjection - DemandSideTechnology{T}(name, power_systems_type, internal, ext, available, ) +function DemandSideTechnology{T}(; min_power=0.0, name, ramp_up_percentage=1.0, power_systems_type, internal=InfrastructureSystemsInternal(), price_per_unit=0.0, ext=Dict(), technology_efficiency=0.0, ramp_dn_percentage=1.0, available, ) where T <: PSY.StaticInjection + DemandSideTechnology{T}(min_power, name, ramp_up_percentage, power_systems_type, internal, price_per_unit, ext, technology_efficiency, ramp_dn_percentage, available, ) end +"""Get [`DemandSideTechnology`](@ref) `min_power`.""" +get_min_power(value::DemandSideTechnology) = value.min_power """Get [`DemandSideTechnology`](@ref) `name`.""" get_name(value::DemandSideTechnology) = value.name +"""Get [`DemandSideTechnology`](@ref) `ramp_up_percentage`.""" +get_ramp_up_percentage(value::DemandSideTechnology) = value.ramp_up_percentage """Get [`DemandSideTechnology`](@ref) `power_systems_type`.""" get_power_systems_type(value::DemandSideTechnology) = value.power_systems_type """Get [`DemandSideTechnology`](@ref) `internal`.""" get_internal(value::DemandSideTechnology) = value.internal +"""Get [`DemandSideTechnology`](@ref) `price_per_unit`.""" +get_price_per_unit(value::DemandSideTechnology) = value.price_per_unit """Get [`DemandSideTechnology`](@ref) `ext`.""" get_ext(value::DemandSideTechnology) = value.ext +"""Get [`DemandSideTechnology`](@ref) `technology_efficiency`.""" +get_technology_efficiency(value::DemandSideTechnology) = value.technology_efficiency +"""Get [`DemandSideTechnology`](@ref) `ramp_dn_percentage`.""" +get_ramp_dn_percentage(value::DemandSideTechnology) = value.ramp_dn_percentage """Get [`DemandSideTechnology`](@ref) `available`.""" get_available(value::DemandSideTechnology) = value.available +"""Set [`DemandSideTechnology`](@ref) `min_power`.""" +set_min_power!(value::DemandSideTechnology, val) = value.min_power = val """Set [`DemandSideTechnology`](@ref) `name`.""" set_name!(value::DemandSideTechnology, val) = value.name = val +"""Set [`DemandSideTechnology`](@ref) `ramp_up_percentage`.""" +set_ramp_up_percentage!(value::DemandSideTechnology, val) = value.ramp_up_percentage = val """Set [`DemandSideTechnology`](@ref) `power_systems_type`.""" set_power_systems_type!(value::DemandSideTechnology, val) = value.power_systems_type = val """Set [`DemandSideTechnology`](@ref) `internal`.""" set_internal!(value::DemandSideTechnology, val) = value.internal = val +"""Set [`DemandSideTechnology`](@ref) `price_per_unit`.""" +set_price_per_unit!(value::DemandSideTechnology, val) = value.price_per_unit = val """Set [`DemandSideTechnology`](@ref) `ext`.""" set_ext!(value::DemandSideTechnology, val) = value.ext = val +"""Set [`DemandSideTechnology`](@ref) `technology_efficiency`.""" +set_technology_efficiency!(value::DemandSideTechnology, val) = value.technology_efficiency = val +"""Set [`DemandSideTechnology`](@ref) `ramp_dn_percentage`.""" +set_ramp_dn_percentage!(value::DemandSideTechnology, val) = value.ramp_dn_percentage = val """Set [`DemandSideTechnology`](@ref) `available`.""" set_available!(value::DemandSideTechnology, val) = value.available = val diff --git a/src/models/generated/ExistingCapacity.jl b/src/models/generated/ExistingCapacity.jl new file mode 100644 index 0000000..c61b8f9 --- /dev/null +++ b/src/models/generated/ExistingCapacity.jl @@ -0,0 +1,56 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct ExistingCapacity <: IS.SupplementalAttribute + internal::InfrastructureSystemsInternal + ext::Dict + existing_capacity::Vector{PSY.Generator} + end + + + +# Arguments +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `existing_capacity::Vector{PSY.Generator}`: (default: `Vector()`) List of individual units to map to a specific SupplyTechnology +""" +mutable struct ExistingCapacity <: IS.SupplementalAttribute + "Internal field" + internal::InfrastructureSystemsInternal + "Option for providing additional data" + ext::Dict + "List of individual units to map to a specific SupplyTechnology" + existing_capacity::Vector{PSY.Generator} +end + + +function ExistingCapacity(; internal=InfrastructureSystemsInternal(), ext=Dict(), existing_capacity=Vector(), ) + ExistingCapacity(internal, ext, existing_capacity, ) +end + +# Constructor for demo purposes; non-functional. +function ExistingCapacity(::Nothing) + ExistingCapacity(; + internal=Vector(), + ext=Vector(), + existing_capacity=Vector(), + ) +end + +"""Get [`ExistingCapacity`](@ref) `internal`.""" +get_internal(value::ExistingCapacity) = value.internal +"""Get [`ExistingCapacity`](@ref) `ext`.""" +get_ext(value::ExistingCapacity) = value.ext +"""Get [`ExistingCapacity`](@ref) `existing_capacity`.""" +get_existing_capacity(value::ExistingCapacity) = value.existing_capacity + +"""Set [`ExistingCapacity`](@ref) `internal`.""" +set_internal!(value::ExistingCapacity, val) = value.internal = val +"""Set [`ExistingCapacity`](@ref) `ext`.""" +set_ext!(value::ExistingCapacity, val) = value.ext = val +"""Set [`ExistingCapacity`](@ref) `existing_capacity`.""" +set_existing_capacity!(value::ExistingCapacity, val) = value.existing_capacity = val diff --git a/src/models/generated/FlexibleDemandTechnology.jl b/src/models/generated/FlexibleDemandTechnology.jl new file mode 100644 index 0000000..7fd5e9a --- /dev/null +++ b/src/models/generated/FlexibleDemandTechnology.jl @@ -0,0 +1,95 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct FlexibleDemandTechnology{T <: PSY.StaticInjection} <: Technology + max_demand_delay::Float64 + name::String + power_systems_type::String + var_cost_per_mwh::PSY.ValueCurve + internal::InfrastructureSystemsInternal + ext::Dict + max_demand_advance::Float64 + demand_energy_efficiency::Float64 + available::Bool + end + + + +# Arguments +- `max_demand_delay::Float64`: Maximum number of hours that demand can be deferred or delayed (hours). +- `name::String`: The technology name +- `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling +- `var_cost_per_mwh::PSY.ValueCurve`: Variable operations and maintenance costs associated with flexible demand deferral +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `max_demand_advance::Float64`: Maximum number of hours that demand can be scheduled in advance of the original schedule (hours). +- `demand_energy_efficiency::Float64`: Energy efficiency associated with time shifting demand. Represents energy losses due to time shifting +- `available::Bool`: identifies whether the technology is available +""" +mutable struct FlexibleDemandTechnology{T <: PSY.StaticInjection} <: Technology + "Maximum number of hours that demand can be deferred or delayed (hours)." + max_demand_delay::Float64 + "The technology name" + name::String + "maps to a valid PowerSystems.jl for PCM modeling" + power_systems_type::String + "Variable operations and maintenance costs associated with flexible demand deferral" + var_cost_per_mwh::PSY.ValueCurve + "Internal field" + internal::InfrastructureSystemsInternal + "Option for providing additional data" + ext::Dict + "Maximum number of hours that demand can be scheduled in advance of the original schedule (hours)." + max_demand_advance::Float64 + "Energy efficiency associated with time shifting demand. Represents energy losses due to time shifting" + demand_energy_efficiency::Float64 + "identifies whether the technology is available" + available::Bool +end + + +function FlexibleDemandTechnology{T}(; max_demand_delay, name, power_systems_type, var_cost_per_mwh, internal=InfrastructureSystemsInternal(), ext=Dict(), max_demand_advance, demand_energy_efficiency, available, ) where T <: PSY.StaticInjection + FlexibleDemandTechnology{T}(max_demand_delay, name, power_systems_type, var_cost_per_mwh, internal, ext, max_demand_advance, demand_energy_efficiency, available, ) +end + +"""Get [`FlexibleDemandTechnology`](@ref) `max_demand_delay`.""" +get_max_demand_delay(value::FlexibleDemandTechnology) = value.max_demand_delay +"""Get [`FlexibleDemandTechnology`](@ref) `name`.""" +get_name(value::FlexibleDemandTechnology) = value.name +"""Get [`FlexibleDemandTechnology`](@ref) `power_systems_type`.""" +get_power_systems_type(value::FlexibleDemandTechnology) = value.power_systems_type +"""Get [`FlexibleDemandTechnology`](@ref) `var_cost_per_mwh`.""" +get_var_cost_per_mwh(value::FlexibleDemandTechnology) = value.var_cost_per_mwh +"""Get [`FlexibleDemandTechnology`](@ref) `internal`.""" +get_internal(value::FlexibleDemandTechnology) = value.internal +"""Get [`FlexibleDemandTechnology`](@ref) `ext`.""" +get_ext(value::FlexibleDemandTechnology) = value.ext +"""Get [`FlexibleDemandTechnology`](@ref) `max_demand_advance`.""" +get_max_demand_advance(value::FlexibleDemandTechnology) = value.max_demand_advance +"""Get [`FlexibleDemandTechnology`](@ref) `demand_energy_efficiency`.""" +get_demand_energy_efficiency(value::FlexibleDemandTechnology) = value.demand_energy_efficiency +"""Get [`FlexibleDemandTechnology`](@ref) `available`.""" +get_available(value::FlexibleDemandTechnology) = value.available + +"""Set [`FlexibleDemandTechnology`](@ref) `max_demand_delay`.""" +set_max_demand_delay!(value::FlexibleDemandTechnology, val) = value.max_demand_delay = val +"""Set [`FlexibleDemandTechnology`](@ref) `name`.""" +set_name!(value::FlexibleDemandTechnology, val) = value.name = val +"""Set [`FlexibleDemandTechnology`](@ref) `power_systems_type`.""" +set_power_systems_type!(value::FlexibleDemandTechnology, val) = value.power_systems_type = val +"""Set [`FlexibleDemandTechnology`](@ref) `var_cost_per_mwh`.""" +set_var_cost_per_mwh!(value::FlexibleDemandTechnology, val) = value.var_cost_per_mwh = val +"""Set [`FlexibleDemandTechnology`](@ref) `internal`.""" +set_internal!(value::FlexibleDemandTechnology, val) = value.internal = val +"""Set [`FlexibleDemandTechnology`](@ref) `ext`.""" +set_ext!(value::FlexibleDemandTechnology, val) = value.ext = val +"""Set [`FlexibleDemandTechnology`](@ref) `max_demand_advance`.""" +set_max_demand_advance!(value::FlexibleDemandTechnology, val) = value.max_demand_advance = val +"""Set [`FlexibleDemandTechnology`](@ref) `demand_energy_efficiency`.""" +set_demand_energy_efficiency!(value::FlexibleDemandTechnology, val) = value.demand_energy_efficiency = val +"""Set [`FlexibleDemandTechnology`](@ref) `available`.""" +set_available!(value::FlexibleDemandTechnology, val) = value.available = val diff --git a/src/models/generated/MinimumCapacityRequirements.jl b/src/models/generated/MinimumCapacityRequirements.jl new file mode 100644 index 0000000..05dd274 --- /dev/null +++ b/src/models/generated/MinimumCapacityRequirements.jl @@ -0,0 +1,87 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct MinimumCapacityRequirements <: Requirements + name::String + power_systems_type::String + pricecap::Float64 + internal::InfrastructureSystemsInternal + ext::Dict + min_mw::Float64 + eligible_resources::Vector{String} + available::Bool + end + + + +# Arguments +- `name::String`: The technology name +- `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling +- `pricecap::Float64`: (default: `Inf`) price threshold for policy constraint, USD/MW +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `min_mw::Float64`: (default: `0.0`) Minimum total capacity across all eligible resources +- `eligible_resources::Vector{String}`: (default: `Vector{String}()`) List of resources that contribute to the carbon cap constraint. +- `available::Bool`: Availability +""" +mutable struct MinimumCapacityRequirements <: Requirements + "The technology name" + name::String + "maps to a valid PowerSystems.jl for PCM modeling" + power_systems_type::String + "price threshold for policy constraint, USD/MW" + pricecap::Float64 + "Internal field" + internal::InfrastructureSystemsInternal + "Option for providing additional data" + ext::Dict + "Minimum total capacity across all eligible resources" + min_mw::Float64 + "List of resources that contribute to the carbon cap constraint." + eligible_resources::Vector{String} + "Availability" + available::Bool +end + + +function MinimumCapacityRequirements(; name, power_systems_type, pricecap=Inf, internal=InfrastructureSystemsInternal(), ext=Dict(), min_mw=0.0, eligible_resources=Vector{String}(), available, ) + MinimumCapacityRequirements(name, power_systems_type, pricecap, internal, ext, min_mw, eligible_resources, available, ) +end + +"""Get [`MinimumCapacityRequirements`](@ref) `name`.""" +get_name(value::MinimumCapacityRequirements) = value.name +"""Get [`MinimumCapacityRequirements`](@ref) `power_systems_type`.""" +get_power_systems_type(value::MinimumCapacityRequirements) = value.power_systems_type +"""Get [`MinimumCapacityRequirements`](@ref) `pricecap`.""" +get_pricecap(value::MinimumCapacityRequirements) = value.pricecap +"""Get [`MinimumCapacityRequirements`](@ref) `internal`.""" +get_internal(value::MinimumCapacityRequirements) = value.internal +"""Get [`MinimumCapacityRequirements`](@ref) `ext`.""" +get_ext(value::MinimumCapacityRequirements) = value.ext +"""Get [`MinimumCapacityRequirements`](@ref) `min_mw`.""" +get_min_mw(value::MinimumCapacityRequirements) = value.min_mw +"""Get [`MinimumCapacityRequirements`](@ref) `eligible_resources`.""" +get_eligible_resources(value::MinimumCapacityRequirements) = value.eligible_resources +"""Get [`MinimumCapacityRequirements`](@ref) `available`.""" +get_available(value::MinimumCapacityRequirements) = value.available + +"""Set [`MinimumCapacityRequirements`](@ref) `name`.""" +set_name!(value::MinimumCapacityRequirements, val) = value.name = val +"""Set [`MinimumCapacityRequirements`](@ref) `power_systems_type`.""" +set_power_systems_type!(value::MinimumCapacityRequirements, val) = value.power_systems_type = val +"""Set [`MinimumCapacityRequirements`](@ref) `pricecap`.""" +set_pricecap!(value::MinimumCapacityRequirements, val) = value.pricecap = val +"""Set [`MinimumCapacityRequirements`](@ref) `internal`.""" +set_internal!(value::MinimumCapacityRequirements, val) = value.internal = val +"""Set [`MinimumCapacityRequirements`](@ref) `ext`.""" +set_ext!(value::MinimumCapacityRequirements, val) = value.ext = val +"""Set [`MinimumCapacityRequirements`](@ref) `min_mw`.""" +set_min_mw!(value::MinimumCapacityRequirements, val) = value.min_mw = val +"""Set [`MinimumCapacityRequirements`](@ref) `eligible_resources`.""" +set_eligible_resources!(value::MinimumCapacityRequirements, val) = value.eligible_resources = val +"""Set [`MinimumCapacityRequirements`](@ref) `available`.""" +set_available!(value::MinimumCapacityRequirements, val) = value.available = val diff --git a/src/models/generated/RetirementPotential.jl b/src/models/generated/RetirementPotential.jl new file mode 100644 index 0000000..ab1e8e8 --- /dev/null +++ b/src/models/generated/RetirementPotential.jl @@ -0,0 +1,56 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct RetirementPotential <: IS.SupplementalAttribute + internal::InfrastructureSystemsInternal + ext::Dict + retirement_potential::Vector{PSY.Generator} + end + + + +# Arguments +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `ext::Dict`: (default: `Dict()`) Option for providing additional data +- `retirement_potential::Vector{PSY.Generator}`: (default: `Vector()`) Individual generation units mapped to a technology that are eligible for retirement +""" +mutable struct RetirementPotential <: IS.SupplementalAttribute + "Internal field" + internal::InfrastructureSystemsInternal + "Option for providing additional data" + ext::Dict + "Individual generation units mapped to a technology that are eligible for retirement" + retirement_potential::Vector{PSY.Generator} +end + + +function RetirementPotential(; internal=InfrastructureSystemsInternal(), ext=Dict(), retirement_potential=Vector(), ) + RetirementPotential(internal, ext, retirement_potential, ) +end + +# Constructor for demo purposes; non-functional. +function RetirementPotential(::Nothing) + RetirementPotential(; + internal=Vector(), + ext=Vector(), + retirement_potential=Vector(), + ) +end + +"""Get [`RetirementPotential`](@ref) `internal`.""" +get_internal(value::RetirementPotential) = value.internal +"""Get [`RetirementPotential`](@ref) `ext`.""" +get_ext(value::RetirementPotential) = value.ext +"""Get [`RetirementPotential`](@ref) `retirement_potential`.""" +get_retirement_potential(value::RetirementPotential) = value.retirement_potential + +"""Set [`RetirementPotential`](@ref) `internal`.""" +set_internal!(value::RetirementPotential, val) = value.internal = val +"""Set [`RetirementPotential`](@ref) `ext`.""" +set_ext!(value::RetirementPotential, val) = value.ext = val +"""Set [`RetirementPotential`](@ref) `retirement_potential`.""" +set_retirement_potential!(value::RetirementPotential, val) = value.retirement_potential = val diff --git a/src/models/generated/RetrofitPotential.jl b/src/models/generated/RetrofitPotential.jl new file mode 100644 index 0000000..adf9902 --- /dev/null +++ b/src/models/generated/RetrofitPotential.jl @@ -0,0 +1,56 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct RetrofitPotential <: IS.SupplementalAttribute + internal::InfrastructureSystemsInternal + retrofit_potential::Vector{PSY.Generator} + ext::Dict + end + + + +# Arguments +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `retrofit_potential::Vector{PSY.Generator}`: (default: `Vector()`) Individual generation units mapped to this technology that can be retrofitted +- `ext::Dict`: (default: `Dict()`) Option for providing additional data +""" +mutable struct RetrofitPotential <: IS.SupplementalAttribute + "Internal field" + internal::InfrastructureSystemsInternal + "Individual generation units mapped to this technology that can be retrofitted" + retrofit_potential::Vector{PSY.Generator} + "Option for providing additional data" + ext::Dict +end + + +function RetrofitPotential(; internal=InfrastructureSystemsInternal(), retrofit_potential=Vector(), ext=Dict(), ) + RetrofitPotential(internal, retrofit_potential, ext, ) +end + +# Constructor for demo purposes; non-functional. +function RetrofitPotential(::Nothing) + RetrofitPotential(; + internal=Dict(), + retrofit_potential=Dict(), + ext=Dict(), + ) +end + +"""Get [`RetrofitPotential`](@ref) `internal`.""" +get_internal(value::RetrofitPotential) = value.internal +"""Get [`RetrofitPotential`](@ref) `retrofit_potential`.""" +get_retrofit_potential(value::RetrofitPotential) = value.retrofit_potential +"""Get [`RetrofitPotential`](@ref) `ext`.""" +get_ext(value::RetrofitPotential) = value.ext + +"""Set [`RetrofitPotential`](@ref) `internal`.""" +set_internal!(value::RetrofitPotential, val) = value.internal = val +"""Set [`RetrofitPotential`](@ref) `retrofit_potential`.""" +set_retrofit_potential!(value::RetrofitPotential, val) = value.retrofit_potential = val +"""Set [`RetrofitPotential`](@ref) `ext`.""" +set_ext!(value::RetrofitPotential, val) = value.ext = val diff --git a/src/models/generated/StorageTechnology.jl b/src/models/generated/StorageTechnology.jl index 3cb6bd8..4ba669b 100644 --- a/src/models/generated/StorageTechnology.jl +++ b/src/models/generated/StorageTechnology.jl @@ -6,74 +6,258 @@ This file is auto-generated. Do not edit. """ mutable struct StorageTechnology{T <: PSY.Storage} <: Technology + base_power::Float64 + om_costs_energy::PSY.OperationalCost + zone::Int64 + prime_mover_type::PrimeMovers + existing_cap_energy::Float64 + rsv_cost::Float64 + available::Bool + existing_cap_power::Float64 name::String storage_tech::StorageTech + capital_costs_power::PSY.ValueCurve + max_duration::Float64 + id::Int64 + min_cap_power::Float64 + capital_costs_energy::PSY.ValueCurve + losses::Float64 + eff_down::Float64 + rsv_max::Float64 + max_cap_power::Float64 power_systems_type::String - prime_mover_type::PrimeMovers internal::InfrastructureSystemsInternal + om_costs_power::PSY.OperationalCost + balancing_topology::String + min_cap_energy::Float64 ext::Dict - available::Bool + eff_up::Float64 + reg_cost::Float64 + min_duration::Float64 + max_cap_energy::Float64 + reg_max::Float64 end # Arguments +- `base_power::Float64`: Base power +- `om_costs_energy::PSY.OperationalCost`: (default: `StorageCost()`) Fixed and variable O&M costs for a technology +- `zone::Int64`: Zone number +- `prime_mover_type::PrimeMovers`: (default: `PrimeMovers.OT`) Prime mover for generator +- `existing_cap_energy::Float64`: (default: `0.0`) Pre-existing energy capacity for a technology (MWh) +- `rsv_cost::Float64`: (default: `0.0`) Cost of providing upwards spinning or contingency reserves +- `available::Bool`: identifies whether the technology is available +- `existing_cap_power::Float64`: (default: `0.0`) Pre-existing power capacity for a technology (MW) - `name::String`: The technology name - `storage_tech::StorageTech`: Storage Technology Type +- `capital_costs_power::PSY.ValueCurve`: (default: `LinearCurve(0.0)`) Capital costs for investing in a technology. +- `max_duration::Float64`: (default: `1000.0`) Maximum allowable durection for a storage technology +- `id::Int64`: ID for individual generator +- `min_cap_power::Float64`: (default: `0.0`) Minimum required power capacity for a storage technology +- `capital_costs_energy::PSY.ValueCurve`: (default: `LinearCurve(0.0)`) Capital costs for investing in a technology. +- `losses::Float64`: (default: `1.0`) Power loss (pct per hour) +- `eff_down::Float64`: (default: `1.0`) Efficiency of discharging storage +- `rsv_max::Float64`: (default: `0.0`) Fraction of nameplate capacity that can committed to provided upwards spinning or contingency reserves. +- `max_cap_power::Float64`: (default: `1e8`) Maximum allowable installed power capacity for a storage technology - `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling -- `prime_mover_type::PrimeMovers`: Prime mover for storage - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `om_costs_power::PSY.OperationalCost`: (default: `StorageCost()`) Fixed and variable O&M costs for a technology +- `balancing_topology::String`: Set of balancing nodes +- `min_cap_energy::Float64`: (default: `0.0`) Minimum required energy capacity for a storage technology - `ext::Dict`: (default: `Dict()`) Option for providing additional data -- `available::Bool`: identifies whether the technology is available +- `eff_up::Float64`: (default: `1.0`) Efficiency of charging storage +- `reg_cost::Float64`: (default: `0.0`) Cost of providing regulation reserves +- `min_duration::Float64`: (default: `0.0`) Minimum required durection for a storage technology +- `max_cap_energy::Float64`: (default: `1e8`) Maximum allowable installed energy capacity for a storage technology +- `reg_max::Float64`: (default: `0.0`) Fraction of nameplate capacity that can committed to provided regulation reserves """ mutable struct StorageTechnology{T <: PSY.Storage} <: Technology + "Base power" + base_power::Float64 + "Fixed and variable O&M costs for a technology" + om_costs_energy::PSY.OperationalCost + "Zone number" + zone::Int64 + "Prime mover for generator" + prime_mover_type::PrimeMovers + "Pre-existing energy capacity for a technology (MWh)" + existing_cap_energy::Float64 + "Cost of providing upwards spinning or contingency reserves" + rsv_cost::Float64 + "identifies whether the technology is available" + available::Bool + "Pre-existing power capacity for a technology (MW)" + existing_cap_power::Float64 "The technology name" name::String "Storage Technology Type" storage_tech::StorageTech + "Capital costs for investing in a technology." + capital_costs_power::PSY.ValueCurve + "Maximum allowable durection for a storage technology" + max_duration::Float64 + "ID for individual generator" + id::Int64 + "Minimum required power capacity for a storage technology" + min_cap_power::Float64 + "Capital costs for investing in a technology." + capital_costs_energy::PSY.ValueCurve + "Power loss (pct per hour)" + losses::Float64 + "Efficiency of discharging storage" + eff_down::Float64 + "Fraction of nameplate capacity that can committed to provided upwards spinning or contingency reserves." + rsv_max::Float64 + "Maximum allowable installed power capacity for a storage technology" + max_cap_power::Float64 "maps to a valid PowerSystems.jl for PCM modeling" power_systems_type::String - "Prime mover for storage" - prime_mover_type::PrimeMovers "Internal field" internal::InfrastructureSystemsInternal + "Fixed and variable O&M costs for a technology" + om_costs_power::PSY.OperationalCost + "Set of balancing nodes" + balancing_topology::String + "Minimum required energy capacity for a storage technology" + min_cap_energy::Float64 "Option for providing additional data" ext::Dict - "identifies whether the technology is available" - available::Bool + "Efficiency of charging storage" + eff_up::Float64 + "Cost of providing regulation reserves " + reg_cost::Float64 + "Minimum required durection for a storage technology" + min_duration::Float64 + "Maximum allowable installed energy capacity for a storage technology" + max_cap_energy::Float64 + "Fraction of nameplate capacity that can committed to provided regulation reserves" + reg_max::Float64 end -function StorageTechnology{T}(; name, storage_tech, power_systems_type, prime_mover_type, internal=InfrastructureSystemsInternal(), ext=Dict(), available, ) where T <: PSY.Storage - StorageTechnology{T}(name, storage_tech, power_systems_type, prime_mover_type, internal, ext, available, ) +function StorageTechnology{T}(; base_power, om_costs_energy=StorageCost(), zone, prime_mover_type=PrimeMovers.OT, existing_cap_energy=0.0, rsv_cost=0.0, available, existing_cap_power=0.0, name, storage_tech, capital_costs_power=LinearCurve(0.0), max_duration=1000.0, id, min_cap_power=0.0, capital_costs_energy=LinearCurve(0.0), losses=1.0, eff_down=1.0, rsv_max=0.0, max_cap_power=1e8, power_systems_type, internal=InfrastructureSystemsInternal(), om_costs_power=StorageCost(), balancing_topology, min_cap_energy=0.0, ext=Dict(), eff_up=1.0, reg_cost=0.0, min_duration=0.0, max_cap_energy=1e8, reg_max=0.0, ) where T <: PSY.Storage + StorageTechnology{T}(base_power, om_costs_energy, zone, prime_mover_type, existing_cap_energy, rsv_cost, available, existing_cap_power, name, storage_tech, capital_costs_power, max_duration, id, min_cap_power, capital_costs_energy, losses, eff_down, rsv_max, max_cap_power, power_systems_type, internal, om_costs_power, balancing_topology, min_cap_energy, ext, eff_up, reg_cost, min_duration, max_cap_energy, reg_max, ) end +"""Get [`StorageTechnology`](@ref) `base_power`.""" +get_base_power(value::StorageTechnology) = value.base_power +"""Get [`StorageTechnology`](@ref) `om_costs_energy`.""" +get_om_costs_energy(value::StorageTechnology) = value.om_costs_energy +"""Get [`StorageTechnology`](@ref) `zone`.""" +get_zone(value::StorageTechnology) = value.zone +"""Get [`StorageTechnology`](@ref) `prime_mover_type`.""" +get_prime_mover_type(value::StorageTechnology) = value.prime_mover_type +"""Get [`StorageTechnology`](@ref) `existing_cap_energy`.""" +get_existing_cap_energy(value::StorageTechnology) = value.existing_cap_energy +"""Get [`StorageTechnology`](@ref) `rsv_cost`.""" +get_rsv_cost(value::StorageTechnology) = value.rsv_cost +"""Get [`StorageTechnology`](@ref) `available`.""" +get_available(value::StorageTechnology) = value.available +"""Get [`StorageTechnology`](@ref) `existing_cap_power`.""" +get_existing_cap_power(value::StorageTechnology) = value.existing_cap_power """Get [`StorageTechnology`](@ref) `name`.""" get_name(value::StorageTechnology) = value.name """Get [`StorageTechnology`](@ref) `storage_tech`.""" get_storage_tech(value::StorageTechnology) = value.storage_tech +"""Get [`StorageTechnology`](@ref) `capital_costs_power`.""" +get_capital_costs_power(value::StorageTechnology) = value.capital_costs_power +"""Get [`StorageTechnology`](@ref) `max_duration`.""" +get_max_duration(value::StorageTechnology) = value.max_duration +"""Get [`StorageTechnology`](@ref) `id`.""" +get_id(value::StorageTechnology) = value.id +"""Get [`StorageTechnology`](@ref) `min_cap_power`.""" +get_min_cap_power(value::StorageTechnology) = value.min_cap_power +"""Get [`StorageTechnology`](@ref) `capital_costs_energy`.""" +get_capital_costs_energy(value::StorageTechnology) = value.capital_costs_energy +"""Get [`StorageTechnology`](@ref) `losses`.""" +get_losses(value::StorageTechnology) = value.losses +"""Get [`StorageTechnology`](@ref) `eff_down`.""" +get_eff_down(value::StorageTechnology) = value.eff_down +"""Get [`StorageTechnology`](@ref) `rsv_max`.""" +get_rsv_max(value::StorageTechnology) = value.rsv_max +"""Get [`StorageTechnology`](@ref) `max_cap_power`.""" +get_max_cap_power(value::StorageTechnology) = value.max_cap_power """Get [`StorageTechnology`](@ref) `power_systems_type`.""" get_power_systems_type(value::StorageTechnology) = value.power_systems_type -"""Get [`StorageTechnology`](@ref) `prime_mover_type`.""" -get_prime_mover_type(value::StorageTechnology) = value.prime_mover_type """Get [`StorageTechnology`](@ref) `internal`.""" get_internal(value::StorageTechnology) = value.internal +"""Get [`StorageTechnology`](@ref) `om_costs_power`.""" +get_om_costs_power(value::StorageTechnology) = value.om_costs_power +"""Get [`StorageTechnology`](@ref) `balancing_topology`.""" +get_balancing_topology(value::StorageTechnology) = value.balancing_topology +"""Get [`StorageTechnology`](@ref) `min_cap_energy`.""" +get_min_cap_energy(value::StorageTechnology) = value.min_cap_energy """Get [`StorageTechnology`](@ref) `ext`.""" get_ext(value::StorageTechnology) = value.ext -"""Get [`StorageTechnology`](@ref) `available`.""" -get_available(value::StorageTechnology) = value.available +"""Get [`StorageTechnology`](@ref) `eff_up`.""" +get_eff_up(value::StorageTechnology) = value.eff_up +"""Get [`StorageTechnology`](@ref) `reg_cost`.""" +get_reg_cost(value::StorageTechnology) = value.reg_cost +"""Get [`StorageTechnology`](@ref) `min_duration`.""" +get_min_duration(value::StorageTechnology) = value.min_duration +"""Get [`StorageTechnology`](@ref) `max_cap_energy`.""" +get_max_cap_energy(value::StorageTechnology) = value.max_cap_energy +"""Get [`StorageTechnology`](@ref) `reg_max`.""" +get_reg_max(value::StorageTechnology) = value.reg_max +"""Set [`StorageTechnology`](@ref) `base_power`.""" +set_base_power!(value::StorageTechnology, val) = value.base_power = val +"""Set [`StorageTechnology`](@ref) `om_costs_energy`.""" +set_om_costs_energy!(value::StorageTechnology, val) = value.om_costs_energy = val +"""Set [`StorageTechnology`](@ref) `zone`.""" +set_zone!(value::StorageTechnology, val) = value.zone = val +"""Set [`StorageTechnology`](@ref) `prime_mover_type`.""" +set_prime_mover_type!(value::StorageTechnology, val) = value.prime_mover_type = val +"""Set [`StorageTechnology`](@ref) `existing_cap_energy`.""" +set_existing_cap_energy!(value::StorageTechnology, val) = value.existing_cap_energy = val +"""Set [`StorageTechnology`](@ref) `rsv_cost`.""" +set_rsv_cost!(value::StorageTechnology, val) = value.rsv_cost = val +"""Set [`StorageTechnology`](@ref) `available`.""" +set_available!(value::StorageTechnology, val) = value.available = val +"""Set [`StorageTechnology`](@ref) `existing_cap_power`.""" +set_existing_cap_power!(value::StorageTechnology, val) = value.existing_cap_power = val """Set [`StorageTechnology`](@ref) `name`.""" set_name!(value::StorageTechnology, val) = value.name = val """Set [`StorageTechnology`](@ref) `storage_tech`.""" set_storage_tech!(value::StorageTechnology, val) = value.storage_tech = val +"""Set [`StorageTechnology`](@ref) `capital_costs_power`.""" +set_capital_costs_power!(value::StorageTechnology, val) = value.capital_costs_power = val +"""Set [`StorageTechnology`](@ref) `max_duration`.""" +set_max_duration!(value::StorageTechnology, val) = value.max_duration = val +"""Set [`StorageTechnology`](@ref) `id`.""" +set_id!(value::StorageTechnology, val) = value.id = val +"""Set [`StorageTechnology`](@ref) `min_cap_power`.""" +set_min_cap_power!(value::StorageTechnology, val) = value.min_cap_power = val +"""Set [`StorageTechnology`](@ref) `capital_costs_energy`.""" +set_capital_costs_energy!(value::StorageTechnology, val) = value.capital_costs_energy = val +"""Set [`StorageTechnology`](@ref) `losses`.""" +set_losses!(value::StorageTechnology, val) = value.losses = val +"""Set [`StorageTechnology`](@ref) `eff_down`.""" +set_eff_down!(value::StorageTechnology, val) = value.eff_down = val +"""Set [`StorageTechnology`](@ref) `rsv_max`.""" +set_rsv_max!(value::StorageTechnology, val) = value.rsv_max = val +"""Set [`StorageTechnology`](@ref) `max_cap_power`.""" +set_max_cap_power!(value::StorageTechnology, val) = value.max_cap_power = val """Set [`StorageTechnology`](@ref) `power_systems_type`.""" set_power_systems_type!(value::StorageTechnology, val) = value.power_systems_type = val -"""Set [`StorageTechnology`](@ref) `prime_mover_type`.""" -set_prime_mover_type!(value::StorageTechnology, val) = value.prime_mover_type = val """Set [`StorageTechnology`](@ref) `internal`.""" set_internal!(value::StorageTechnology, val) = value.internal = val +"""Set [`StorageTechnology`](@ref) `om_costs_power`.""" +set_om_costs_power!(value::StorageTechnology, val) = value.om_costs_power = val +"""Set [`StorageTechnology`](@ref) `balancing_topology`.""" +set_balancing_topology!(value::StorageTechnology, val) = value.balancing_topology = val +"""Set [`StorageTechnology`](@ref) `min_cap_energy`.""" +set_min_cap_energy!(value::StorageTechnology, val) = value.min_cap_energy = val """Set [`StorageTechnology`](@ref) `ext`.""" set_ext!(value::StorageTechnology, val) = value.ext = val -"""Set [`StorageTechnology`](@ref) `available`.""" -set_available!(value::StorageTechnology, val) = value.available = val +"""Set [`StorageTechnology`](@ref) `eff_up`.""" +set_eff_up!(value::StorageTechnology, val) = value.eff_up = val +"""Set [`StorageTechnology`](@ref) `reg_cost`.""" +set_reg_cost!(value::StorageTechnology, val) = value.reg_cost = val +"""Set [`StorageTechnology`](@ref) `min_duration`.""" +set_min_duration!(value::StorageTechnology, val) = value.min_duration = val +"""Set [`StorageTechnology`](@ref) `max_cap_energy`.""" +set_max_cap_energy!(value::StorageTechnology, val) = value.max_cap_energy = val +"""Set [`StorageTechnology`](@ref) `reg_max`.""" +set_reg_max!(value::StorageTechnology, val) = value.reg_max = val diff --git a/src/models/generated/SupplyTechnology.jl b/src/models/generated/SupplyTechnology.jl index 7f591f3..4330078 100644 --- a/src/models/generated/SupplyTechnology.jl +++ b/src/models/generated/SupplyTechnology.jl @@ -7,153 +7,297 @@ This file is auto-generated. Do not edit. """ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology base_power::Float64 + heat_rate_mmbtu_per_mwh::Union{Float64, PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}} + zone::Union{Nothing, Zone} prime_mover_type::PrimeMovers - capital_cost::PSY.ValueCurve minimum_required_capacity::Float64 - gen_ID::String + cofire_level_min::Union{Nothing, Dict{ThermalFuels, Float64}} + capital_costs::PSY.ValueCurve + outage_factor::Float64 + rsv_cost::Float64 + cofire_start_max::Union{Nothing, Dict{ThermalFuels, Float64}} + gen_ID::Int64 available::Bool + co2::Union{Float64, Dict{String, Float64}, Dict{ThermalFuels, Float64}} name::String + cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}} + ramp_dn_percentage::Float64 + down_time::Float64 initial_capacity::Float64 - fuel::ThermalFuels + start_fuel_mmbtu_per_mw::Float64 + operation_costs::PSY.OperationalCost + rsv_max::Float64 + fuel::Union{String, ThermalFuels, Vector{ThermalFuels}, Vector{String}} power_systems_type::String + cofire_level_max::Union{Nothing, Dict{ThermalFuels, Float64}} internal::InfrastructureSystemsInternal - variable_cost::PSY.ValueCurve ext::Dict balancing_topology::String - operations_cost::PSY.ValueCurve maximum_capacity::Float64 - capacity_factor::Float64 + cluster::Int64 + ramp_up_percentage::Float64 + reg_cost::Float64 + min_generation_percentage::Float64 + start_cost_per_mw::Float64 + reg_max::Float64 + up_time::Float64 end # Arguments - `base_power::Float64`: Base power +- `heat_rate_mmbtu_per_mwh::Union{Float64, PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}}`: (default: `0.0`) Heat rate of generator, MMBTU/MWh +- `zone::Union{Nothing, Zone}`: (default: `nothing`) Zone where tech operates in - `prime_mover_type::PrimeMovers`: (default: `PrimeMovers.OT`) Prime mover for generator -- `capital_cost::PSY.ValueCurve`: (default: `0.0`) Capital costs for investing in a technology. - `minimum_required_capacity::Float64`: (default: `0.0`) Minimum required capacity for a technology -- `gen_ID::String`: ID for individual generator -- `available::Bool`: identifies whether the technology is available +- `cofire_level_min::Union{Nothing, Dict{ThermalFuels, Float64}}`: (default: `nothing`) Minimum blending level of each fuel during normal generation process for multi-fuel generator +- `capital_costs::PSY.ValueCurve`: (default: `LinearCurve(0.0)`) Capital costs for investing in a technology. +- `outage_factor::Float64`: (default: `1.0`) Derating factor to account for planned or forced outages of a technology +- `rsv_cost::Float64`: (default: `0.0`) Cost of providing upwards spinning or contingency reserves +- `cofire_start_max::Union{Nothing, Dict{ThermalFuels, Float64}}`: (default: `nothing`) Maximum blending level of each fuel during start-up process for multi-fuel generator +- `gen_ID::Int64`: ID for individual generator +- `available::Bool`: (default: `True`) identifies whether the technology is available +- `co2::Union{Float64, Dict{String, Float64}, Dict{ThermalFuels, Float64}}`: (default: `0.0`) Carbon Intensity of fuel - `name::String`: The technology name -- `initial_capacity::Float64`: Pre-existing capacity for a technology -- `fuel::ThermalFuels`: (default: `ThermalFuels.OTHER`) Fuel type according to IEA +- `cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}}`: (default: `nothing`) Minimum blending level of each fuel during start-up process for multi-fuel generator +- `ramp_dn_percentage::Float64`: (default: `100.0`) Maximum decrease in output between operation periods. Fraction of total capacity +- `down_time::Float64`: (default: `0.0`) Minimum amount of time a resource has to remain in the shutdown state. +- `initial_capacity::Float64`: (default: `0.0`) Pre-existing capacity for a technology +- `start_fuel_mmbtu_per_mw::Float64`: (default: `0.0`) Startup fuel use per MW of nameplate capacity of each generator (MMBtu/MW per start) +- `operation_costs::PSY.OperationalCost`: (default: `ThermalGenerationCost()`) Fixed and variable O&M costs for a technology +- `rsv_max::Float64`: (default: `0.0`) Fraction of nameplate capacity that can committed to provided upwards spinning or contingency reserves. +- `fuel::Union{String, ThermalFuels, Vector{ThermalFuels}, Vector{String}}`: (default: `ThermalFuels.OTHER`) Fuel type according to IEA - `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling +- `cofire_level_max::Union{Nothing, Dict{ThermalFuels, Float64}}`: (default: `nothing`) Maximum blending level of each fuel during normal generation process for multi-fuel generator - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field -- `variable_cost::PSY.ValueCurve`: Variable O&M costs for a technology - `ext::Dict`: (default: `Dict()`) Option for providing additional data - `balancing_topology::String`: Set of balancing nodes -- `operations_cost::PSY.ValueCurve`: Fixed O&M costs for a technology - `maximum_capacity::Float64`: (default: `Inf`) Maximum allowable installed capacity for a technology -- `capacity_factor::Float64`: (default: `1.0`) Derating factor to account for planned or forced outages of a technology +- `cluster::Int64`: (default: `1`) Number of the cluster when representing multiple clusters of a given technology in a given region. +- `ramp_up_percentage::Float64`: (default: `100.0`) Maximum increase in output between operation periods. Fraction of total capacity +- `reg_cost::Float64`: (default: `0.0`) Cost of providing regulation reserves +- `min_generation_percentage::Float64`: (default: `0.0`) Minimum generation as a fraction of total capacity +- `start_cost_per_mw::Float64`: (default: `0.0`) Cost per MW of nameplate capacity to start a generator (/MW per start). +- `reg_max::Float64`: (default: `0.0`) Fraction of nameplate capacity that can committed to provided regulation reserves +- `up_time::Float64`: (default: `0.0`) Minimum amount of time a resource has to stay in the committed state. """ mutable struct SupplyTechnology{T <: PSY.Generator} <: Technology "Base power" base_power::Float64 + "Heat rate of generator, MMBTU/MWh" + heat_rate_mmbtu_per_mwh::Union{Float64, PSY.ValueCurve, Dict{ThermalFuels, PSY.ValueCurve}} + "Zone where tech operates in" + zone::Union{Nothing, Zone} "Prime mover for generator" prime_mover_type::PrimeMovers - "Capital costs for investing in a technology." - capital_cost::PSY.ValueCurve "Minimum required capacity for a technology" minimum_required_capacity::Float64 + "Minimum blending level of each fuel during normal generation process for multi-fuel generator" + cofire_level_min::Union{Nothing, Dict{ThermalFuels, Float64}} + "Capital costs for investing in a technology." + capital_costs::PSY.ValueCurve + "Derating factor to account for planned or forced outages of a technology" + outage_factor::Float64 + "Cost of providing upwards spinning or contingency reserves" + rsv_cost::Float64 + "Maximum blending level of each fuel during start-up process for multi-fuel generator" + cofire_start_max::Union{Nothing, Dict{ThermalFuels, Float64}} "ID for individual generator" - gen_ID::String + gen_ID::Int64 "identifies whether the technology is available" available::Bool + "Carbon Intensity of fuel" + co2::Union{Float64, Dict{String, Float64}, Dict{ThermalFuels, Float64}} "The technology name" name::String + "Minimum blending level of each fuel during start-up process for multi-fuel generator" + cofire_start_min::Union{Nothing, Dict{ThermalFuels, Float64}} + "Maximum decrease in output between operation periods. Fraction of total capacity" + ramp_dn_percentage::Float64 + "Minimum amount of time a resource has to remain in the shutdown state." + down_time::Float64 "Pre-existing capacity for a technology" initial_capacity::Float64 + "Startup fuel use per MW of nameplate capacity of each generator (MMBtu/MW per start)" + start_fuel_mmbtu_per_mw::Float64 + "Fixed and variable O&M costs for a technology" + operation_costs::PSY.OperationalCost + "Fraction of nameplate capacity that can committed to provided upwards spinning or contingency reserves." + rsv_max::Float64 "Fuel type according to IEA" - fuel::ThermalFuels + fuel::Union{String, ThermalFuels, Vector{ThermalFuels}, Vector{String}} "maps to a valid PowerSystems.jl for PCM modeling" power_systems_type::String + "Maximum blending level of each fuel during normal generation process for multi-fuel generator" + cofire_level_max::Union{Nothing, Dict{ThermalFuels, Float64}} "Internal field" internal::InfrastructureSystemsInternal - "Variable O&M costs for a technology" - variable_cost::PSY.ValueCurve "Option for providing additional data" ext::Dict "Set of balancing nodes" balancing_topology::String - "Fixed O&M costs for a technology" - operations_cost::PSY.ValueCurve "Maximum allowable installed capacity for a technology" maximum_capacity::Float64 - "Derating factor to account for planned or forced outages of a technology" - capacity_factor::Float64 + "Number of the cluster when representing multiple clusters of a given technology in a given region." + cluster::Int64 + "Maximum increase in output between operation periods. Fraction of total capacity" + ramp_up_percentage::Float64 + "Cost of providing regulation reserves " + reg_cost::Float64 + "Minimum generation as a fraction of total capacity" + min_generation_percentage::Float64 + "Cost per MW of nameplate capacity to start a generator (/MW per start)." + start_cost_per_mw::Float64 + "Fraction of nameplate capacity that can committed to provided regulation reserves" + reg_max::Float64 + "Minimum amount of time a resource has to stay in the committed state." + up_time::Float64 end -function SupplyTechnology{T}(; base_power, prime_mover_type=PrimeMovers.OT, capital_cost=0.0, minimum_required_capacity=0.0, gen_ID, available, name, initial_capacity, fuel=ThermalFuels.OTHER, power_systems_type, internal=InfrastructureSystemsInternal(), variable_cost, ext=Dict(), balancing_topology, operations_cost, maximum_capacity=Inf, capacity_factor=1.0, ) where T <: PSY.Generator - SupplyTechnology{T}(base_power, prime_mover_type, capital_cost, minimum_required_capacity, gen_ID, available, name, initial_capacity, fuel, power_systems_type, internal, variable_cost, ext, balancing_topology, operations_cost, maximum_capacity, capacity_factor, ) +function SupplyTechnology{T}(; base_power, heat_rate_mmbtu_per_mwh=0.0, zone=nothing, prime_mover_type=PrimeMovers.OT, minimum_required_capacity=0.0, cofire_level_min=nothing, capital_costs=LinearCurve(0.0), outage_factor=1.0, rsv_cost=0.0, cofire_start_max=nothing, gen_ID, available=True, co2=0.0, name, cofire_start_min=nothing, ramp_dn_percentage=100.0, down_time=0.0, initial_capacity=0.0, start_fuel_mmbtu_per_mw=0.0, operation_costs=ThermalGenerationCost(), rsv_max=0.0, fuel=ThermalFuels.OTHER, power_systems_type, cofire_level_max=nothing, internal=InfrastructureSystemsInternal(), ext=Dict(), balancing_topology, maximum_capacity=Inf, cluster=1, ramp_up_percentage=100.0, reg_cost=0.0, min_generation_percentage=0.0, start_cost_per_mw=0.0, reg_max=0.0, up_time=0.0, ) where T <: PSY.Generator + SupplyTechnology{T}(base_power, heat_rate_mmbtu_per_mwh, zone, prime_mover_type, minimum_required_capacity, cofire_level_min, capital_costs, outage_factor, rsv_cost, cofire_start_max, gen_ID, available, co2, name, cofire_start_min, ramp_dn_percentage, down_time, initial_capacity, start_fuel_mmbtu_per_mw, operation_costs, rsv_max, fuel, power_systems_type, cofire_level_max, internal, ext, balancing_topology, maximum_capacity, cluster, ramp_up_percentage, reg_cost, min_generation_percentage, start_cost_per_mw, reg_max, up_time, ) end """Get [`SupplyTechnology`](@ref) `base_power`.""" get_base_power(value::SupplyTechnology) = value.base_power +"""Get [`SupplyTechnology`](@ref) `heat_rate_mmbtu_per_mwh`.""" +get_heat_rate_mmbtu_per_mwh(value::SupplyTechnology) = value.heat_rate_mmbtu_per_mwh +"""Get [`SupplyTechnology`](@ref) `zone`.""" +get_zone(value::SupplyTechnology) = value.zone """Get [`SupplyTechnology`](@ref) `prime_mover_type`.""" get_prime_mover_type(value::SupplyTechnology) = value.prime_mover_type -"""Get [`SupplyTechnology`](@ref) `capital_cost`.""" -get_capital_cost(value::SupplyTechnology) = value.capital_cost """Get [`SupplyTechnology`](@ref) `minimum_required_capacity`.""" get_minimum_required_capacity(value::SupplyTechnology) = value.minimum_required_capacity +"""Get [`SupplyTechnology`](@ref) `cofire_level_min`.""" +get_cofire_level_min(value::SupplyTechnology) = value.cofire_level_min +"""Get [`SupplyTechnology`](@ref) `capital_costs`.""" +get_capital_costs(value::SupplyTechnology) = value.capital_costs +"""Get [`SupplyTechnology`](@ref) `outage_factor`.""" +get_outage_factor(value::SupplyTechnology) = value.outage_factor +"""Get [`SupplyTechnology`](@ref) `rsv_cost`.""" +get_rsv_cost(value::SupplyTechnology) = value.rsv_cost +"""Get [`SupplyTechnology`](@ref) `cofire_start_max`.""" +get_cofire_start_max(value::SupplyTechnology) = value.cofire_start_max """Get [`SupplyTechnology`](@ref) `gen_ID`.""" get_gen_ID(value::SupplyTechnology) = value.gen_ID """Get [`SupplyTechnology`](@ref) `available`.""" get_available(value::SupplyTechnology) = value.available +"""Get [`SupplyTechnology`](@ref) `co2`.""" +get_co2(value::SupplyTechnology) = value.co2 """Get [`SupplyTechnology`](@ref) `name`.""" get_name(value::SupplyTechnology) = value.name +"""Get [`SupplyTechnology`](@ref) `cofire_start_min`.""" +get_cofire_start_min(value::SupplyTechnology) = value.cofire_start_min +"""Get [`SupplyTechnology`](@ref) `ramp_dn_percentage`.""" +get_ramp_dn_percentage(value::SupplyTechnology) = value.ramp_dn_percentage +"""Get [`SupplyTechnology`](@ref) `down_time`.""" +get_down_time(value::SupplyTechnology) = value.down_time """Get [`SupplyTechnology`](@ref) `initial_capacity`.""" get_initial_capacity(value::SupplyTechnology) = value.initial_capacity +"""Get [`SupplyTechnology`](@ref) `start_fuel_mmbtu_per_mw`.""" +get_start_fuel_mmbtu_per_mw(value::SupplyTechnology) = value.start_fuel_mmbtu_per_mw +"""Get [`SupplyTechnology`](@ref) `operation_costs`.""" +get_operation_costs(value::SupplyTechnology) = value.operation_costs +"""Get [`SupplyTechnology`](@ref) `rsv_max`.""" +get_rsv_max(value::SupplyTechnology) = value.rsv_max """Get [`SupplyTechnology`](@ref) `fuel`.""" get_fuel(value::SupplyTechnology) = value.fuel """Get [`SupplyTechnology`](@ref) `power_systems_type`.""" get_power_systems_type(value::SupplyTechnology) = value.power_systems_type +"""Get [`SupplyTechnology`](@ref) `cofire_level_max`.""" +get_cofire_level_max(value::SupplyTechnology) = value.cofire_level_max """Get [`SupplyTechnology`](@ref) `internal`.""" get_internal(value::SupplyTechnology) = value.internal -"""Get [`SupplyTechnology`](@ref) `variable_cost`.""" -get_variable_cost(value::SupplyTechnology) = value.variable_cost """Get [`SupplyTechnology`](@ref) `ext`.""" get_ext(value::SupplyTechnology) = value.ext """Get [`SupplyTechnology`](@ref) `balancing_topology`.""" get_balancing_topology(value::SupplyTechnology) = value.balancing_topology -"""Get [`SupplyTechnology`](@ref) `operations_cost`.""" -get_operations_cost(value::SupplyTechnology) = value.operations_cost """Get [`SupplyTechnology`](@ref) `maximum_capacity`.""" get_maximum_capacity(value::SupplyTechnology) = value.maximum_capacity -"""Get [`SupplyTechnology`](@ref) `capacity_factor`.""" -get_capacity_factor(value::SupplyTechnology) = value.capacity_factor +"""Get [`SupplyTechnology`](@ref) `cluster`.""" +get_cluster(value::SupplyTechnology) = value.cluster +"""Get [`SupplyTechnology`](@ref) `ramp_up_percentage`.""" +get_ramp_up_percentage(value::SupplyTechnology) = value.ramp_up_percentage +"""Get [`SupplyTechnology`](@ref) `reg_cost`.""" +get_reg_cost(value::SupplyTechnology) = value.reg_cost +"""Get [`SupplyTechnology`](@ref) `min_generation_percentage`.""" +get_min_generation_percentage(value::SupplyTechnology) = value.min_generation_percentage +"""Get [`SupplyTechnology`](@ref) `start_cost_per_mw`.""" +get_start_cost_per_mw(value::SupplyTechnology) = value.start_cost_per_mw +"""Get [`SupplyTechnology`](@ref) `reg_max`.""" +get_reg_max(value::SupplyTechnology) = value.reg_max +"""Get [`SupplyTechnology`](@ref) `up_time`.""" +get_up_time(value::SupplyTechnology) = value.up_time """Set [`SupplyTechnology`](@ref) `base_power`.""" set_base_power!(value::SupplyTechnology, val) = value.base_power = val +"""Set [`SupplyTechnology`](@ref) `heat_rate_mmbtu_per_mwh`.""" +set_heat_rate_mmbtu_per_mwh!(value::SupplyTechnology, val) = value.heat_rate_mmbtu_per_mwh = val +"""Set [`SupplyTechnology`](@ref) `zone`.""" +set_zone!(value::SupplyTechnology, val) = value.zone = val """Set [`SupplyTechnology`](@ref) `prime_mover_type`.""" set_prime_mover_type!(value::SupplyTechnology, val) = value.prime_mover_type = val -"""Set [`SupplyTechnology`](@ref) `capital_cost`.""" -set_capital_cost!(value::SupplyTechnology, val) = value.capital_cost = val """Set [`SupplyTechnology`](@ref) `minimum_required_capacity`.""" set_minimum_required_capacity!(value::SupplyTechnology, val) = value.minimum_required_capacity = val +"""Set [`SupplyTechnology`](@ref) `cofire_level_min`.""" +set_cofire_level_min!(value::SupplyTechnology, val) = value.cofire_level_min = val +"""Set [`SupplyTechnology`](@ref) `capital_costs`.""" +set_capital_costs!(value::SupplyTechnology, val) = value.capital_costs = val +"""Set [`SupplyTechnology`](@ref) `outage_factor`.""" +set_outage_factor!(value::SupplyTechnology, val) = value.outage_factor = val +"""Set [`SupplyTechnology`](@ref) `rsv_cost`.""" +set_rsv_cost!(value::SupplyTechnology, val) = value.rsv_cost = val +"""Set [`SupplyTechnology`](@ref) `cofire_start_max`.""" +set_cofire_start_max!(value::SupplyTechnology, val) = value.cofire_start_max = val """Set [`SupplyTechnology`](@ref) `gen_ID`.""" set_gen_ID!(value::SupplyTechnology, val) = value.gen_ID = val """Set [`SupplyTechnology`](@ref) `available`.""" set_available!(value::SupplyTechnology, val) = value.available = val +"""Set [`SupplyTechnology`](@ref) `co2`.""" +set_co2!(value::SupplyTechnology, val) = value.co2 = val """Set [`SupplyTechnology`](@ref) `name`.""" set_name!(value::SupplyTechnology, val) = value.name = val +"""Set [`SupplyTechnology`](@ref) `cofire_start_min`.""" +set_cofire_start_min!(value::SupplyTechnology, val) = value.cofire_start_min = val +"""Set [`SupplyTechnology`](@ref) `ramp_dn_percentage`.""" +set_ramp_dn_percentage!(value::SupplyTechnology, val) = value.ramp_dn_percentage = val +"""Set [`SupplyTechnology`](@ref) `down_time`.""" +set_down_time!(value::SupplyTechnology, val) = value.down_time = val """Set [`SupplyTechnology`](@ref) `initial_capacity`.""" set_initial_capacity!(value::SupplyTechnology, val) = value.initial_capacity = val +"""Set [`SupplyTechnology`](@ref) `start_fuel_mmbtu_per_mw`.""" +set_start_fuel_mmbtu_per_mw!(value::SupplyTechnology, val) = value.start_fuel_mmbtu_per_mw = val +"""Set [`SupplyTechnology`](@ref) `operation_costs`.""" +set_operation_costs!(value::SupplyTechnology, val) = value.operation_costs = val +"""Set [`SupplyTechnology`](@ref) `rsv_max`.""" +set_rsv_max!(value::SupplyTechnology, val) = value.rsv_max = val """Set [`SupplyTechnology`](@ref) `fuel`.""" set_fuel!(value::SupplyTechnology, val) = value.fuel = val """Set [`SupplyTechnology`](@ref) `power_systems_type`.""" set_power_systems_type!(value::SupplyTechnology, val) = value.power_systems_type = val +"""Set [`SupplyTechnology`](@ref) `cofire_level_max`.""" +set_cofire_level_max!(value::SupplyTechnology, val) = value.cofire_level_max = val """Set [`SupplyTechnology`](@ref) `internal`.""" set_internal!(value::SupplyTechnology, val) = value.internal = val -"""Set [`SupplyTechnology`](@ref) `variable_cost`.""" -set_variable_cost!(value::SupplyTechnology, val) = value.variable_cost = val """Set [`SupplyTechnology`](@ref) `ext`.""" set_ext!(value::SupplyTechnology, val) = value.ext = val """Set [`SupplyTechnology`](@ref) `balancing_topology`.""" set_balancing_topology!(value::SupplyTechnology, val) = value.balancing_topology = val -"""Set [`SupplyTechnology`](@ref) `operations_cost`.""" -set_operations_cost!(value::SupplyTechnology, val) = value.operations_cost = val """Set [`SupplyTechnology`](@ref) `maximum_capacity`.""" set_maximum_capacity!(value::SupplyTechnology, val) = value.maximum_capacity = val -"""Set [`SupplyTechnology`](@ref) `capacity_factor`.""" -set_capacity_factor!(value::SupplyTechnology, val) = value.capacity_factor = val +"""Set [`SupplyTechnology`](@ref) `cluster`.""" +set_cluster!(value::SupplyTechnology, val) = value.cluster = val +"""Set [`SupplyTechnology`](@ref) `ramp_up_percentage`.""" +set_ramp_up_percentage!(value::SupplyTechnology, val) = value.ramp_up_percentage = val +"""Set [`SupplyTechnology`](@ref) `reg_cost`.""" +set_reg_cost!(value::SupplyTechnology, val) = value.reg_cost = val +"""Set [`SupplyTechnology`](@ref) `min_generation_percentage`.""" +set_min_generation_percentage!(value::SupplyTechnology, val) = value.min_generation_percentage = val +"""Set [`SupplyTechnology`](@ref) `start_cost_per_mw`.""" +set_start_cost_per_mw!(value::SupplyTechnology, val) = value.start_cost_per_mw = val +"""Set [`SupplyTechnology`](@ref) `reg_max`.""" +set_reg_max!(value::SupplyTechnology, val) = value.reg_max = val +"""Set [`SupplyTechnology`](@ref) `up_time`.""" +set_up_time!(value::SupplyTechnology, val) = value.up_time = val diff --git a/src/models/generated/TransportTechnology.jl b/src/models/generated/TransportTechnology.jl index 99faafe..2aa9784 100644 --- a/src/models/generated/TransportTechnology.jl +++ b/src/models/generated/TransportTechnology.jl @@ -6,58 +6,154 @@ This file is auto-generated. Do not edit. """ mutable struct TransportTechnology{T <: PSY.Device} <: Technology + capital_cost::PSY.ValueCurve + start_region::Int64 + available::Bool name::String + capital_recovery_factor::Int64 + end_region::Int64 power_systems_type::String + angle_limit::Float64 internal::InfrastructureSystemsInternal ext::Dict - available::Bool + resistance::Float64 + voltage::Float64 + network_id::Int64 + maximum_new_capacity::Float64 + existing_line_capacity::Float64 + wacc::Float64 + line_loss::Float64 end # Arguments -- `name::String`: The technology name +- `capital_cost::PSY.ValueCurve`: Cost of adding new capacity to the inter-regional transmission line. +- `start_region::Int64`: Start region for transport technology +- `available::Bool`: identifies whether the technology is available +- `name::String`: Name +- `capital_recovery_factor::Int64`: (default: `0`) Capital recovery period (in years) used for determining overnight capital costs from annualized investment costs for network transmission line expansion. +- `end_region::Int64`: End region for transport technology - `power_systems_type::String`: maps to a valid PowerSystems.jl for PCM modeling +- `angle_limit::Float64`: (default: `0.0`) Votlage angle limit (radians) - `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field - `ext::Dict`: (default: `Dict()`) Option for providing additional data -- `available::Bool`: identifies whether the technology is available +- `resistance::Float64`: (default: `0.0`) Technology resistance in Ohms +- `voltage::Float64`: (default: `0.0`) Technology resistance in Ohms +- `network_id::Int64`: Numerical Index +- `maximum_new_capacity::Float64`: Maximum capacity that can be added to transmission line (MW) +- `existing_line_capacity::Float64`: Existing capacity of transport technology (MW) +- `wacc::Float64`: (default: `0`) Weighted average cost of capital +- `line_loss::Float64`: Transmission loss for each transport technology (%) """ mutable struct TransportTechnology{T <: PSY.Device} <: Technology - "The technology name" + "Cost of adding new capacity to the inter-regional transmission line." + capital_cost::PSY.ValueCurve + "Start region for transport technology" + start_region::Int64 + "identifies whether the technology is available" + available::Bool + "Name" name::String + "Capital recovery period (in years) used for determining overnight capital costs from annualized investment costs for network transmission line expansion." + capital_recovery_factor::Int64 + "End region for transport technology" + end_region::Int64 "maps to a valid PowerSystems.jl for PCM modeling" power_systems_type::String + "Votlage angle limit (radians)" + angle_limit::Float64 "Internal field" internal::InfrastructureSystemsInternal "Option for providing additional data" ext::Dict - "identifies whether the technology is available" - available::Bool + "Technology resistance in Ohms" + resistance::Float64 + "Technology resistance in Ohms" + voltage::Float64 + "Numerical Index" + network_id::Int64 + "Maximum capacity that can be added to transmission line (MW)" + maximum_new_capacity::Float64 + "Existing capacity of transport technology (MW)" + existing_line_capacity::Float64 + "Weighted average cost of capital" + wacc::Float64 + "Transmission loss for each transport technology (%)" + line_loss::Float64 end -function TransportTechnology{T}(; name, power_systems_type, internal=InfrastructureSystemsInternal(), ext=Dict(), available, ) where T <: PSY.Device - TransportTechnology{T}(name, power_systems_type, internal, ext, available, ) +function TransportTechnology{T}(; capital_cost, start_region, available, name, capital_recovery_factor=0, end_region, power_systems_type, angle_limit=0.0, internal=InfrastructureSystemsInternal(), ext=Dict(), resistance=0.0, voltage=0.0, network_id, maximum_new_capacity, existing_line_capacity, wacc=0, line_loss, ) where T <: PSY.Device + TransportTechnology{T}(capital_cost, start_region, available, name, capital_recovery_factor, end_region, power_systems_type, angle_limit, internal, ext, resistance, voltage, network_id, maximum_new_capacity, existing_line_capacity, wacc, line_loss, ) end +"""Get [`TransportTechnology`](@ref) `capital_cost`.""" +get_capital_cost(value::TransportTechnology) = value.capital_cost +"""Get [`TransportTechnology`](@ref) `start_region`.""" +get_start_region(value::TransportTechnology) = value.start_region +"""Get [`TransportTechnology`](@ref) `available`.""" +get_available(value::TransportTechnology) = value.available """Get [`TransportTechnology`](@ref) `name`.""" get_name(value::TransportTechnology) = value.name +"""Get [`TransportTechnology`](@ref) `capital_recovery_factor`.""" +get_capital_recovery_factor(value::TransportTechnology) = value.capital_recovery_factor +"""Get [`TransportTechnology`](@ref) `end_region`.""" +get_end_region(value::TransportTechnology) = value.end_region """Get [`TransportTechnology`](@ref) `power_systems_type`.""" get_power_systems_type(value::TransportTechnology) = value.power_systems_type +"""Get [`TransportTechnology`](@ref) `angle_limit`.""" +get_angle_limit(value::TransportTechnology) = value.angle_limit """Get [`TransportTechnology`](@ref) `internal`.""" get_internal(value::TransportTechnology) = value.internal """Get [`TransportTechnology`](@ref) `ext`.""" get_ext(value::TransportTechnology) = value.ext -"""Get [`TransportTechnology`](@ref) `available`.""" -get_available(value::TransportTechnology) = value.available +"""Get [`TransportTechnology`](@ref) `resistance`.""" +get_resistance(value::TransportTechnology) = value.resistance +"""Get [`TransportTechnology`](@ref) `voltage`.""" +get_voltage(value::TransportTechnology) = value.voltage +"""Get [`TransportTechnology`](@ref) `network_id`.""" +get_network_id(value::TransportTechnology) = value.network_id +"""Get [`TransportTechnology`](@ref) `maximum_new_capacity`.""" +get_maximum_new_capacity(value::TransportTechnology) = value.maximum_new_capacity +"""Get [`TransportTechnology`](@ref) `existing_line_capacity`.""" +get_existing_line_capacity(value::TransportTechnology) = value.existing_line_capacity +"""Get [`TransportTechnology`](@ref) `wacc`.""" +get_wacc(value::TransportTechnology) = value.wacc +"""Get [`TransportTechnology`](@ref) `line_loss`.""" +get_line_loss(value::TransportTechnology) = value.line_loss +"""Set [`TransportTechnology`](@ref) `capital_cost`.""" +set_capital_cost!(value::TransportTechnology, val) = value.capital_cost = val +"""Set [`TransportTechnology`](@ref) `start_region`.""" +set_start_region!(value::TransportTechnology, val) = value.start_region = val +"""Set [`TransportTechnology`](@ref) `available`.""" +set_available!(value::TransportTechnology, val) = value.available = val """Set [`TransportTechnology`](@ref) `name`.""" set_name!(value::TransportTechnology, val) = value.name = val +"""Set [`TransportTechnology`](@ref) `capital_recovery_factor`.""" +set_capital_recovery_factor!(value::TransportTechnology, val) = value.capital_recovery_factor = val +"""Set [`TransportTechnology`](@ref) `end_region`.""" +set_end_region!(value::TransportTechnology, val) = value.end_region = val """Set [`TransportTechnology`](@ref) `power_systems_type`.""" set_power_systems_type!(value::TransportTechnology, val) = value.power_systems_type = val +"""Set [`TransportTechnology`](@ref) `angle_limit`.""" +set_angle_limit!(value::TransportTechnology, val) = value.angle_limit = val """Set [`TransportTechnology`](@ref) `internal`.""" set_internal!(value::TransportTechnology, val) = value.internal = val """Set [`TransportTechnology`](@ref) `ext`.""" set_ext!(value::TransportTechnology, val) = value.ext = val -"""Set [`TransportTechnology`](@ref) `available`.""" -set_available!(value::TransportTechnology, val) = value.available = val +"""Set [`TransportTechnology`](@ref) `resistance`.""" +set_resistance!(value::TransportTechnology, val) = value.resistance = val +"""Set [`TransportTechnology`](@ref) `voltage`.""" +set_voltage!(value::TransportTechnology, val) = value.voltage = val +"""Set [`TransportTechnology`](@ref) `network_id`.""" +set_network_id!(value::TransportTechnology, val) = value.network_id = val +"""Set [`TransportTechnology`](@ref) `maximum_new_capacity`.""" +set_maximum_new_capacity!(value::TransportTechnology, val) = value.maximum_new_capacity = val +"""Set [`TransportTechnology`](@ref) `existing_line_capacity`.""" +set_existing_line_capacity!(value::TransportTechnology, val) = value.existing_line_capacity = val +"""Set [`TransportTechnology`](@ref) `wacc`.""" +set_wacc!(value::TransportTechnology, val) = value.wacc = val +"""Set [`TransportTechnology`](@ref) `line_loss`.""" +set_line_loss!(value::TransportTechnology, val) = value.line_loss = val diff --git a/src/models/generated/Zone.jl b/src/models/generated/Zone.jl new file mode 100644 index 0000000..99e2274 --- /dev/null +++ b/src/models/generated/Zone.jl @@ -0,0 +1,55 @@ +#= +This file is auto-generated. Do not edit. +=# + +#! format: off + +""" + mutable struct Zone <: Region + name::String + internal::InfrastructureSystemsInternal + id::Int64 + ext::Dict + end + + + +# Arguments +- `name::String`: Name of region +- `internal::InfrastructureSystemsInternal`: (default: `InfrastructureSystemsInternal()`) Internal field +- `id::Int64`: A unique zone identification number (positive integer) +- `ext::Dict`: (default: `Dict()`) Option for providing additional data +""" +mutable struct Zone <: Region + "Name of region" + name::String + "Internal field" + internal::InfrastructureSystemsInternal + "A unique zone identification number (positive integer)" + id::Int64 + "Option for providing additional data" + ext::Dict +end + + +function Zone(; name, internal=InfrastructureSystemsInternal(), id, ext=Dict(), ) + Zone(name, internal, id, ext, ) +end + +"""Get [`Zone`](@ref) `name`.""" +get_name(value::Zone) = value.name +"""Get [`Zone`](@ref) `internal`.""" +get_internal(value::Zone) = value.internal +"""Get [`Zone`](@ref) `id`.""" +get_id(value::Zone) = value.id +"""Get [`Zone`](@ref) `ext`.""" +get_ext(value::Zone) = value.ext + +"""Set [`Zone`](@ref) `name`.""" +set_name!(value::Zone, val) = value.name = val +"""Set [`Zone`](@ref) `internal`.""" +set_internal!(value::Zone, val) = value.internal = val +"""Set [`Zone`](@ref) `id`.""" +set_id!(value::Zone, val) = value.id = val +"""Set [`Zone`](@ref) `ext`.""" +set_ext!(value::Zone, val) = value.ext = val diff --git a/src/models/generated/includes.jl b/src/models/generated/includes.jl index db0be6f..820bec6 100644 --- a/src/models/generated/includes.jl +++ b/src/models/generated/includes.jl @@ -1,46 +1,190 @@ -include("TransportTechnology.jl") +include("Zone.jl") +include("MinimumCapacityRequirements.jl") include("SupplyTechnology.jl") include("DemandRequirement.jl") -include("StorageTechnology.jl") +include("RetirementPotential.jl") +include("ExistingCapacity.jl") +include("AggregateRetrofitPotential.jl") include("DemandSideTechnology.jl") +include("AggregateRetirementPotential.jl") +include("StorageTechnology.jl") +include("CarbonCaps.jl") +include("TransportTechnology.jl") +include("RetrofitPotential.jl") +include("CurtailableDemandSideTechnology.jl") +include("FlexibleDemandTechnology.jl") +export get_angle_limit export get_available export get_balancing_topology export get_base_power -export get_capacity_factor export get_capital_cost +export get_capital_costs +export get_capital_costs_energy +export get_capital_costs_power +export get_capital_recovery_factor +export get_cluster +export get_co2 +export get_co_2_max_mtons +export get_co_2_max_tons_mwh +export get_cofire_level_max +export get_cofire_level_min +export get_cofire_start_max +export get_cofire_start_min +export get_curtailment_cost +export get_curtailment_cost_mwh +export get_demand_energy_efficiency +export get_demand_mw +export get_down_time +export get_eff_down +export get_eff_up +export get_eligible_resources +export get_eligible_zones +export get_end_region +export get_existing_cap_energy +export get_existing_cap_power +export get_existing_capacity +export get_existing_line_capacity export get_ext export get_fuel export get_gen_ID +export get_heat_rate_mmbtu_per_mwh +export get_id export get_initial_capacity -export get_load_growth +export get_line_loss +export get_losses +export get_max_cap_energy +export get_max_cap_power +export get_max_demand_advance +export get_max_demand_curtailment +export get_max_demand_delay +export get_max_duration export get_maximum_capacity +export get_maximum_new_capacity +export get_min_cap_energy +export get_min_cap_power +export get_min_duration +export get_min_generation_percentage +export get_min_mw +export get_min_power export get_minimum_required_capacity export get_name -export get_operations_cost -export get_peak_load +export get_network_id +export get_om_costs_energy +export get_om_costs_power +export get_operation_costs +export get_outage_factor export get_power_systems_type +export get_price_per_unit +export get_pricecap export get_prime_mover_type -export get_region +export get_ramp_dn_percentage +export get_ramp_up_percentage +export get_reg_cost +export get_reg_max +export get_resistance +export get_retirement_potential +export get_retrofit_fraction +export get_retrofit_id +export get_retrofit_potential +export get_rsv_cost +export get_rsv_max +export get_segments +export get_start_cost_per_mw +export get_start_fuel_mmbtu_per_mw +export get_start_region export get_storage_tech -export get_variable_cost +export get_technology_efficiency +export get_up_time +export get_var_cost_per_mwh +export get_voll +export get_voltage +export get_wacc +export get_zone +export set_angle_limit! export set_available! export set_balancing_topology! export set_base_power! -export set_capacity_factor! export set_capital_cost! +export set_capital_costs! +export set_capital_costs_energy! +export set_capital_costs_power! +export set_capital_recovery_factor! +export set_cluster! +export set_co2! +export set_co_2_max_mtons! +export set_co_2_max_tons_mwh! +export set_cofire_level_max! +export set_cofire_level_min! +export set_cofire_start_max! +export set_cofire_start_min! +export set_curtailment_cost! +export set_curtailment_cost_mwh! +export set_demand_energy_efficiency! +export set_demand_mw! +export set_down_time! +export set_eff_down! +export set_eff_up! +export set_eligible_resources! +export set_eligible_zones! +export set_end_region! +export set_existing_cap_energy! +export set_existing_cap_power! +export set_existing_capacity! +export set_existing_line_capacity! export set_ext! export set_fuel! export set_gen_ID! +export set_heat_rate_mmbtu_per_mwh! +export set_id! export set_initial_capacity! -export set_load_growth! +export set_line_loss! +export set_losses! +export set_max_cap_energy! +export set_max_cap_power! +export set_max_demand_advance! +export set_max_demand_curtailment! +export set_max_demand_delay! +export set_max_duration! export set_maximum_capacity! +export set_maximum_new_capacity! +export set_min_cap_energy! +export set_min_cap_power! +export set_min_duration! +export set_min_generation_percentage! +export set_min_mw! +export set_min_power! export set_minimum_required_capacity! export set_name! -export set_operations_cost! -export set_peak_load! +export set_network_id! +export set_om_costs_energy! +export set_om_costs_power! +export set_operation_costs! +export set_outage_factor! export set_power_systems_type! +export set_price_per_unit! +export set_pricecap! export set_prime_mover_type! -export set_region! +export set_ramp_dn_percentage! +export set_ramp_up_percentage! +export set_reg_cost! +export set_reg_max! +export set_resistance! +export set_retirement_potential! +export set_retrofit_fraction! +export set_retrofit_id! +export set_retrofit_potential! +export set_rsv_cost! +export set_rsv_max! +export set_segments! +export set_start_cost_per_mw! +export set_start_fuel_mmbtu_per_mw! +export set_start_region! export set_storage_tech! -export set_variable_cost! +export set_technology_efficiency! +export set_up_time! +export set_var_cost_per_mwh! +export set_voll! +export set_voltage! +export set_wacc! +export set_zone! diff --git a/src/models/regions.jl b/src/models/regions.jl new file mode 100644 index 0000000..8e672be --- /dev/null +++ b/src/models/regions.jl @@ -0,0 +1,20 @@ +""" +abstract type to represent regions for the CEM. + +Required fields for a Region Type + + - name + - id + - time_series_container + - supplemental_attributes_container + - internal +""" +abstract type Region <: IS.InfrastructureSystemsComponent end + +get_name(val::Region) = val.name +get_id(val::Region) = val.id +get_internal(val::Region) = val.internal +get_ext(val::Region) = get_ext(get_internal(val)) +get_time_series_container(val::Region) = val.time_series_container +get_supplemental_attributes_container(val::Region) = val.supplemental_attributes_container +supports_time_series(::Region) = true diff --git a/src/models/requirements.jl b/src/models/requirements.jl new file mode 100644 index 0000000..f76c28d --- /dev/null +++ b/src/models/requirements.jl @@ -0,0 +1,12 @@ +""" +Supertype for all portfolio requirements + +Requirements include policies or other regional factors that may constrain +expansion decisions. Common requirements are carbon caps and system +capacity requirements. +""" + +abstract type Requirements <: IS.InfrastructureSystemsComponent end + +supports_time_series(::Requirements) = true +supports_supplemental_attributes(::Requirements) = true diff --git a/src/models/technologies.jl b/src/models/technologies.jl index bfe3eb6..d6c73e1 100644 --- a/src/models/technologies.jl +++ b/src/models/technologies.jl @@ -20,4 +20,4 @@ get_ext(val::Technology) = get_ext(get_internal(val)) get_time_series_container(val::Technology) = val.time_series_container get_supplemental_attributes_container(val::Technology) = val.supplemental_attributes_container -IS.supports_time_series(::Technology) = true +supports_time_series(::Technology) = true diff --git a/src/portfolio.jl b/src/portfolio.jl index d040976..42e930c 100644 --- a/src/portfolio.jl +++ b/src/portfolio.jl @@ -17,13 +17,15 @@ mutable struct PortfolioMetadata <: IS.InfrastructureSystemsType end #TODO: Define if we are going to support unit systems -struct Portfolio <: IS.InfrastructureSystemsType +#TODO: Make immutable +mutable struct Portfolio <: IS.InfrastructureSystemsType aggregation::Type{<:Union{PSY.ACBus, PSY.AggregationTopology}} discount_rate::Float64 data::IS.SystemData # Inputs to the model investment_schedule::Dict # Investment decisions container i.e., model outputs. Container TBD #units_settings::IS.SystemUnitsSettings time_series_directory::Union{Nothing, String} + base_system::Union{Nothing, System} metadata::PortfolioMetadata internal::IS.InfrastructureSystemsInternal @@ -38,6 +40,7 @@ struct Portfolio <: IS.InfrastructureSystemsType name=nothing, description=nothing, data_source=nothing, + base_system=nothing, kwargs..., ) #TODO: Provide support to kwargs @@ -57,6 +60,7 @@ struct Portfolio <: IS.InfrastructureSystemsType investment_schedule, #units_settings, time_series_directory, + base_system, PortfolioMetadata(name, description, data_source), internal, ) @@ -169,8 +173,26 @@ function add_technology!( return end +function add_region!( + portfolio::Portfolio, + zone::T; + skip_validation=false, + kwargs..., +) where {T <: Region} + #deserialization_in_progress = _is_deserialization_in_progress(portfolio) + IS.add_component!( + portfolio.data, + zone; + #allow_existing_time_series=deserialization_in_progress, + skip_validation=skip_validation, + kwargs..., + ) + + return +end + """ -Add many technologies to the portfoliotem at once. +Add many technologies to the portfolio at once. Throws ArgumentError if the technology's name is already stored for its concrete type. Throws ArgumentError if any Technology-specific rule is violated. @@ -577,3 +599,80 @@ function Portfolio(file_path::AbstractString; assign_new_uuids=false, kwargs...) throw(DataFormatError("$file_path is not a supported file type")) end end + +################################ +######### Requirements ######### +################################ + +""" +Add policy requirement to portfolio +""" +function add_requirement!(portfolio::Portfolio, req::Requirements) + #return PSY.add_service!(portfolio.data, req) + #skip_validation = false + #skip_validation = _validate_or_skip!(sys, service, skip_validation) + return IS.add_component!(portfolio.data, req, skip_validation=false) +end + +function get_requirements(::Type{T}, portfolio::Portfolio;) where {T <: Requirements} + return IS.get_components(T, portfolio.data) +end + +########################################### +######### Supplemental Attributes ######### +########################################### + +""" +Add a supplemental attribute to a technology. The attribute may already be attached to a +different component. +""" +function add_supplemental_attribute!( + p::Portfolio, + component::IS.InfrastructureSystemsComponent, + attribute::IS.SupplementalAttribute, +) + return IS.add_supplemental_attribute!(p.data, component, attribute) +end + +""" +Remove the supplemental attribute from the component. The attribute will be removed from the +system if it is not attached to any other component. +""" +function remove_supplemental_attribute!( + p::Portfolio, + component::IS.InfrastructureSystemsComponent, + attribute::IS.SupplementalAttribute, +) + return IS.remove_supplemental_attribute!(p.data, component, attribute) +end + +""" +Remove the supplemental attribute from the system and all attached components. +""" +function remove_supplemental_attribute!(p::Portfolio, attribute::IS.SupplementalAttribute) + return IS.remove_supplemental_attribute!(p.data, attribute) +end + +""" +Remove all supplemental attributes with the given type from the system. +""" +function remove_supplemental_attributes!( + ::Type{T}, + p::Portfolio, +) where {T <: IS.SupplementalAttribute} + return IS.remove_supplemental_attributes!(T, p.data) +end + +""" +Return the supplemental attribute with the given uuid. + +Throws ArgumentError if the attribute is not stored. +""" +function get_supplemental_attribute(p::Portfolio, uuid::Base.UUID) + return IS.get_supplemental_attribute(p.data, uuid) +end + +""" +Return the internal of a supplemental attribute, required to add to IS for SupplementalAttributes to work +""" +IS.get_internal(val::IS.SupplementalAttribute) = val.internal