From 1b099061a3631d66a6a35759aedef72012ac83c7 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Fri, 20 Sep 2024 19:25:53 -0600 Subject: [PATCH] fix emulation model updating --- src/operation/operation_model_simulation_interface.jl | 2 +- src/parameters/update_container_parameter_values.jl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/operation/operation_model_simulation_interface.jl b/src/operation/operation_model_simulation_interface.jl index e857af8eb..3ec50b2c9 100644 --- a/src/operation/operation_model_simulation_interface.jl +++ b/src/operation/operation_model_simulation_interface.jl @@ -9,7 +9,7 @@ function update_model!(model::OperationModel, source::SimulationState, ini_cond_ end function update_parameters!(model::EmulationModel, state::SimulationState) - data = get_system_states(state) + data = get_decision_states(state) update_parameters!(model, data) return end diff --git a/src/parameters/update_container_parameter_values.jl b/src/parameters/update_container_parameter_values.jl index a61e7bdf0..5784c0964 100644 --- a/src/parameters/update_container_parameter_values.jl +++ b/src/parameters/update_container_parameter_values.jl @@ -305,7 +305,7 @@ function _update_parameter_values!( state::DatasetContainer{InMemoryDataset}, ) where {T <: Union{JuMP.VariableRef, Float64}, U <: PSY.Component} current_time = get_current_time(model) - @show state_values = get_dataset_values(state, get_attribute_key(attributes)) + state_values = get_dataset_values(state, get_attribute_key(attributes)) component_names, _ = axes(parameter_array) state_data = get_dataset(state, get_attribute_key(attributes)) state_timestamps = state_data.timestamps @@ -325,7 +325,7 @@ function _update_parameter_values!( "The value for the system state used in $(encode_key_as_string(get_attribute_key(attributes))): $(value) is out of the [0, 1] range", ) end - _set_param_value!(parameter_array, value, name, t) + _set_param_value!(parameter_array, value, name, 1) end return end