Skip to content

Commit

Permalink
Merge pull request #1096 from NREL-Sienna/jd/fix_service_bid
Browse files Browse the repository at this point in the history
add fix to service bid
  • Loading branch information
jd-lara authored Mar 27, 2024
2 parents 8adee35 + 36ef59b commit 9730681
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/devices_models/devices/common/objective_functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,8 @@ end
function _add_service_bid_cost!(
container::OptimizationContainer,
component::PSY.Component,
service::PSY.Reserve{T},
) where {T <: PSY.ReserveDirection}
service::T,
) where {T <: PSY.Reserve{<:PSY.ReserveDirection}}
time_steps = get_time_steps(container)
initial_time = get_initial_time(container)
base_power = get_base_power(container)
Expand All @@ -343,13 +343,14 @@ function _add_service_bid_cost!(
if eltype(forecast_data_values) == Float64
data_values = forecast_data_values
# Single Price/Quantity Bid
elseif eltype(forecast_data_values) == NTuple{2, Float64}
data_values = [v[1] for v in forecast_data_values]
elseif eltype(forecast_data_values) == Vector{NTuple{2, Float64}}
data_values = [v[1][1] for v in forecast_data_values]
else
error("$(eltype(forecast_data_values)) not supported for MarketBidCost")
end

reserve_variable = get_variable(container, U(), T, PSY.get_name(service))
reserve_variable =
get_variable(container, ActivePowerReserveVariable(), T, PSY.get_name(service))
component_name = PSY.get_name(component)
for t in time_steps
add_to_objective_invariant_expression!(
Expand Down

0 comments on commit 9730681

Please sign in to comment.