Skip to content

Commit

Permalink
remove EnergyOutput auxvars
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigomha committed Dec 13, 2023
1 parent 3f6e556 commit bdff311
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 47 deletions.
1 change: 0 additions & 1 deletion src/PowerSimulations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ export LowerBoundFeedForwardSlack
export TimeDurationOn
export TimeDurationOff
export PowerOutput
export EnergyOutput

# Constraints
export AbsoluteValueConstraint
Expand Down
4 changes: 0 additions & 4 deletions src/core/auxiliary_variables.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ struct TimeDurationOff <: AuxVariableType end
Auxiliary Variable for Thermal Generation Models that solve for power above min
"""
struct PowerOutput <: AuxVariableType end
"""
Auxiliary Variable for Hydro and Storage Models that solve for total energy output
"""
struct EnergyOutput <: AuxVariableType end

should_write_resulting_value(::Type{<:AuxVariableType}) = true

Expand Down
42 changes: 0 additions & 42 deletions src/simulation/simulation_state.jl
Original file line number Diff line number Diff line change
Expand Up @@ -239,48 +239,6 @@ function update_decision_state!(
return
end

function update_decision_state!(
state::SimulationState,
key::AuxVarKey{EnergyOutput, T},
store_data::DenseAxisArray{Float64, 2},
simulation_time::Dates.DateTime,
model_params::ModelStoreParams,
) where {T <: PSY.Component}
state_data = get_decision_state_data(state, key)
model_resolution = get_resolution(model_params)
state_resolution = get_data_resolution(state_data)
resolution_ratio = model_resolution ÷ state_resolution
state_timestamps = state_data.timestamps
@assert_op resolution_ratio >= 1

if simulation_time > get_end_of_step_timestamp(state_data)
state_data_index = 1
state_data.timestamps[:] .=
range(
simulation_time;
step = state_resolution,
length = get_num_rows(state_data),
)
else
state_data_index = find_timestamp_index(state_timestamps, simulation_time)
end

offset = resolution_ratio - 1
result_time_index = axes(store_data)[2]
set_update_timestamp!(state_data, simulation_time)
column_names = axes(state_data.values)[1]
for t in result_time_index
state_range = state_data_index:(state_data_index + offset)
for name in column_names, i in state_range
state_data.values[name, i] = store_data[name, t] / resolution_ratio
end
set_last_recorded_row!(state_data, state_range[end])
state_data_index += resolution_ratio
end

return
end

function update_decision_state!(
state::SimulationState,
key::AuxVarKey{S, T},
Expand Down

0 comments on commit bdff311

Please sign in to comment.