Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add fix to service bid #1096

Merged
merged 2 commits into from
Mar 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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 @@
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]

Check warning on line 347 in src/devices_models/devices/common/objective_functions.jl

View check run for this annotation

Codecov / codecov/patch

src/devices_models/devices/common/objective_functions.jl#L346-L347

Added lines #L346 - L347 were not covered by tests
else
error("$(eltype(forecast_data_values)) not supported for MarketBidCost")
end

reserve_variable = get_variable(container, U(), T, PSY.get_name(service))
reserve_variable =

Check warning on line 352 in src/devices_models/devices/common/objective_functions.jl

View check run for this annotation

Codecov / codecov/patch

src/devices_models/devices/common/objective_functions.jl#L352

Added line #L352 was not covered by tests
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
Loading