Skip to content

Commit

Permalink
Standardize OperationalCost naming
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielKS committed Mar 31, 2024
1 parent d63dae6 commit 31b848a
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/PowerSystems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -603,9 +603,9 @@ include("models/operational_cost.jl")
include("models/cost_functions/ValueCurves.jl")
include("models/cost_functions/variable_cost.jl")
include("models/cost_functions/MarketBidCost.jl")
include("models/cost_functions/HydroPowerCost.jl")
include("models/cost_functions/HydroGenerationCost.jl")
include("models/cost_functions/LoadCost.jl")
include("models/cost_functions/RenewablePowerCost.jl")
include("models/cost_functions/RenewableGenerationCost.jl")
include("models/cost_functions/StorageCost.jl")
include("models/cost_functions/ThermalGenerationCost.jl")

Expand Down
2 changes: 1 addition & 1 deletion src/descriptors/power_system_structs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3514,7 +3514,7 @@
},
{
"name": "operation_cost",
"null_value": "RenewablePowerCost(nothing)",
"null_value": "RenewableGenerationCost(nothing)",
"data_type": "OperationalCost",
"comment": "Operation Cost of Generation [`OperationalCost`](@ref)"
},
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
mutable struct RenewablePowerCost <: OperationalCost
mutable struct RenewableGenerationCost <: OperationalCost
variable::CostCurve
curtailment_cost::CostCurve
end
Expand All @@ -12,29 +12,29 @@ curtailment Costs can be used to represent the loss of tax incentives.
- `variable::CostCurve`: Variable cost.
- `curtailment_cost::CostCurve`: Input/output cost of curtailing power.
"""
mutable struct RenewablePowerCost <: OperationalCost
mutable struct RenewableGenerationCost <: OperationalCost
"variable cost"
variable::CostCurve
"curtailment cost"
curtailment_cost::CostCurve
end

function RenewablePowerCost(;
function RenewableGenerationCost(;
variable,
curtailment_cost = InputOutputCostCurve(LinearFunctionData(0.0)),
)
RenewablePowerCost(variable, curtailment_cost)
RenewableGenerationCost(variable, curtailment_cost)
end

# Constructor for demo purposes; non-functional.
function RenewablePowerCost(::Nothing)
RenewablePowerCost(;
function RenewableGenerationCost(::Nothing)
RenewableGenerationCost(;
variable = InputOutputCostCurve(LinearFunctionData(0.0)),
)
end

"""Get [`RenewablePowerCost`](@ref) `variable`."""
get_variable(value::RenewablePowerCost) = value.variable
"""Get [`RenewableGenerationCost`](@ref) `variable`."""
get_variable(value::RenewableGenerationCost) = value.variable

"""Set [`RenewablePowerCost`](@ref) `variable`."""
set_variable!(value::RenewablePowerCost, val) = value.variable = val
"""Set [`RenewableGenerationCost`](@ref) `variable`."""
set_variable!(value::RenewableGenerationCost, val) = value.variable = val
2 changes: 1 addition & 1 deletion src/models/generated/RenewableDispatch.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function RenewableDispatch(::Nothing)
prime_mover_type=PrimeMovers.OT,
reactive_power_limits=nothing,
power_factor=1.0,
operation_cost=RenewablePowerCost(nothing),
operation_cost=RenewableGenerationCost(nothing),
base_power=0.0,
services=Device[],
dynamic_injector=nothing,
Expand Down
2 changes: 1 addition & 1 deletion src/parsers/power_models_data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ function make_hydro_gen(gen_name, d, bus, sys_mbase)
end

function make_renewable_dispatch(gen_name, d, bus, sys_mbase)
cost = RenewablePowerCost(; variable = InputOutputCostCurve(LinearFunctionData(0.0)))
cost = RenewableGenerationCost(; variable = InputOutputCostCurve(LinearFunctionData(0.0)))
base_conversion = sys_mbase / d["mbase"]

rating = calculate_rating(d["pmax"], d["qmax"])
Expand Down

0 comments on commit 31b848a

Please sign in to comment.