diff --git a/src/operation/initial_conditions_update_in_memory_store.jl b/src/operation/initial_conditions_update_in_memory_store.jl index 7c7793050..48d56e9af 100644 --- a/src/operation/initial_conditions_update_in_memory_store.jl +++ b/src/operation/initial_conditions_update_in_memory_store.jl @@ -2,12 +2,15 @@ ################## ic updates from store for emulation problems simulation ################# function update_initial_conditions!( - ics::Vector{T}, + ics::Vector{ + Union{ + InitialCondition{InitialTimeDurationOn, Nothing}, + InitialCondition{InitialTimeDurationOn, JuMP.VariableRef}, + }, + }, store::EmulationModelStore, ::Dates.Millisecond, -) where { - T <: InitialCondition{InitialTimeDurationOn, S}, -} where {S <: Union{Float64, JuMP.VariableRef}} +) for ic in ics var_val = get_value(store, TimeDurationOn(), get_component_type(ic)) set_ic_quantity!(ic, get_last_recorded_value(var_val)[get_component_name(ic)]) @@ -16,12 +19,15 @@ function update_initial_conditions!( end function update_initial_conditions!( - ics::Vector{T}, + ics::Vector{ + Union{ + InitialCondition{InitialTimeDurationOff, Nothing}, + InitialCondition{InitialTimeDurationOff, JuMP.VariableRef}, + }, + }, store::EmulationModelStore, ::Dates.Millisecond, -) where { - T <: InitialCondition{InitialTimeDurationOff, S}, -} where {S <: Union{Float64, JuMP.VariableRef}} +) for ic in ics var_val = get_value(store, TimeDurationOff(), get_component_type(ic)) set_ic_quantity!(ic, get_last_recorded_value(var_val)[get_component_name(ic)]) @@ -30,12 +36,15 @@ function update_initial_conditions!( end function update_initial_conditions!( - ics::Vector{T}, + ics::Vector{ + Union{ + InitialCondition{DevicePower, Nothing}, + InitialCondition{DevicePower, JuMP.VariableRef}, + }, + }, store::EmulationModelStore, ::Dates.Millisecond, -) where { - T <: InitialCondition{DevicePower, S}, -} where {S <: Union{Float64, JuMP.VariableRef}} +) for ic in ics var_val = get_value(store, ActivePowerVariable(), get_component_type(ic)) set_ic_quantity!(ic, get_last_recorded_value(var_val)[get_component_name(ic)]) @@ -44,12 +53,15 @@ function update_initial_conditions!( end function update_initial_conditions!( - ics::Vector{T}, + ics::Vector{ + Union{ + InitialCondition{DeviceStatus, Nothing}, + InitialCondition{DeviceStatus, JuMP.VariableRef}, + }, + }, store::EmulationModelStore, ::Dates.Millisecond, -) where { - T <: InitialCondition{DeviceStatus, S}, -} where {S <: Union{Float64, JuMP.VariableRef}} +) for ic in ics var_val = get_value(store, OnVariable(), get_component_type(ic)) set_ic_quantity!(ic, get_last_recorded_value(var_val)[get_component_name(ic)]) @@ -58,12 +70,15 @@ function update_initial_conditions!( end function update_initial_conditions!( - ics::Vector{T}, + ics::Vector{ + Union{ + InitialCondition{DeviceAboveMinPower, Nothing}, + InitialCondition{DeviceAboveMinPower, JuMP.VariableRef}, + }, + }, store::EmulationModelStore, ::Dates.Millisecond, -) where { - T <: InitialCondition{DeviceAboveMinPower, S}, -} where {S <: Union{Float64, JuMP.VariableRef}} +) for ic in ics var_val = get_value(store, PowerAboveMinimumVariable(), get_component_type(ic)) @@ -72,6 +87,7 @@ function update_initial_conditions!( return end +#= Unused without the AGC model enabled function update_initial_conditions!( ics::Vector{T}, store::EmulationModelStore, @@ -85,14 +101,18 @@ function update_initial_conditions!( end return end +=# function update_initial_conditions!( - ics::Vector{T}, + ics::Vector{ + Union{ + InitialCondition{InitialEnergyLevel, Nothing}, + InitialCondition{InitialEnergyLevel, JuMP.VariableRef}, + }, + }, store::EmulationModelStore, ::Dates.Millisecond, -) where { - T <: InitialCondition{InitialEnergyLevel, S}, -} where {S <: Union{Float64, JuMP.VariableRef}} +) for ic in ics var_val = get_value(store, EnergyVariable(), get_component_type(ic)) set_ic_quantity!(ic, get_last_recorded_value(var_val)[get_component_name(ic)])