Skip to content

Commit

Permalink
Merge branch 'main' into rh/add_pwl_twoterminalhvdc
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigomha authored Oct 2, 2024
2 parents de63f6f + 86d9c12 commit 3c5d9db
Show file tree
Hide file tree
Showing 29 changed files with 1,101 additions and 791 deletions.
5 changes: 4 additions & 1 deletion src/PowerSimulations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,6 @@ include("feedforward/feedforward_arguments.jl")
include("feedforward/feedforward_constraints.jl")

include("parameters/add_parameters.jl")
include("parameters/update_parameters.jl")

include("simulation/optimization_output_cache.jl")
include("simulation/optimization_output_caches.jl")
Expand All @@ -534,6 +533,10 @@ include("simulation/simulation_internal.jl")
include("simulation/simulation.jl")
include("simulation/simulation_results_export.jl")
include("simulation/simulation_results.jl")
include("operation/operation_model_simulation_interface.jl")
include("parameters/update_container_parameter_values.jl")
include("parameters/update_cost_parameters.jl")
include("parameters/update_parameters.jl")

include("devices_models/devices/common/objective_function/common.jl")
include("devices_models/devices/common/objective_function/linear_curve.jl")
Expand Down
9 changes: 9 additions & 0 deletions src/core/parameters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ struct TimeSeriesAttributes{T <: PSY.TimeSeriesData} <: ParameterAttributes
name::String
multiplier_id::Base.RefValue{Int}
component_name_to_ts_uuid::Dict{String, String}
subsystem::Base.RefValue{String}
end

function TimeSeriesAttributes(
Expand All @@ -18,6 +19,7 @@ function TimeSeriesAttributes(
name,
Base.RefValue{Int}(multiplier_id),
component_name_to_ts_uuid,
Base.RefValue{String}(""),
)
end

Expand All @@ -29,6 +31,13 @@ function set_time_series_multiplier_id!(attr::TimeSeriesAttributes, val::Int)
return
end

get_subsystem(attr::TimeSeriesAttributes) = attr.subsystem[]
function set_subsystem!(attr::TimeSeriesAttributes, val::String)
attr.subsystem[] = val
return
end
set_subsystem!(::TimeSeriesAttributes, ::Nothing) = nothing

function add_component_name!(attr::TimeSeriesAttributes, name::String, uuid::String)
if haskey(attr.component_name_to_ts_uuid, name)
throw(ArgumentError("$name is already stored"))
Expand Down
4 changes: 4 additions & 0 deletions src/core/settings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ struct Settings
export_pwl_vars::Bool
allow_fails::Bool
rebuild_model::Bool
export_optimization_model::Bool
store_variable_names::Bool
check_numerical_bounds::Bool
ext::Dict{String, Any}
Expand All @@ -41,6 +42,7 @@ function Settings(
allow_fails::Bool = false,
check_numerical_bounds = true,
rebuild_model = false,
export_optimization_model = false,
store_variable_names = false,
ext = Dict{String, Any}(),
)
Expand Down Expand Up @@ -77,6 +79,7 @@ function Settings(
export_pwl_vars,
allow_fails,
rebuild_model,
export_optimization_model,
store_variable_names,
check_numerical_bounds,
ext,
Expand Down Expand Up @@ -151,6 +154,7 @@ get_detailed_optimizer_stats(settings::Settings) = settings.detailed_optimizer_s
get_direct_mode_optimizer(settings::Settings) = settings.direct_mode_optimizer
get_store_variable_names(settings::Settings) = settings.store_variable_names
get_rebuild_model(settings::Settings) = settings.rebuild_model
get_export_optimization_model(settings::Settings) = settings.export_optimization_model
use_time_series_cache(settings::Settings) = settings.time_series_cache_size > 0

function set_horizon!(settings::Settings, horizon::Dates.TimePeriod)
Expand Down
Loading

0 comments on commit 3c5d9db

Please sign in to comment.