diff --git a/src/multi_optimization_container.jl b/src/multi_optimization_container.jl index 7864680..75bd083 100644 --- a/src/multi_optimization_container.jl +++ b/src/multi_optimization_container.jl @@ -160,9 +160,9 @@ end function init_optimization_container!( container::MultiOptimizationContainer, - ::Type{T}, + network_model::PSI.NetworkModel{<:PM.AbstractPowerModel}, sys::PSY.System, -) where {T <: PM.AbstractPowerModel} +) PSY.set_units_base_system!(sys, "SYSTEM_BASE") # The order of operations matter settings = PSI.get_settings(container) @@ -190,7 +190,7 @@ function init_optimization_container!( @debug "Initializing Container Subproblem $index" _group = PSI.LOG_GROUP_OPTIMIZATION_CONTAINER sub_problem.settings = deepcopy(settings) - PSI.init_optimization_container!(sub_problem, T, sys) + PSI.init_optimization_container!(sub_problem, network_model, sys) end return diff --git a/src/multiproblem_template.jl b/src/multiproblem_template.jl index 1f80e40..68a22a6 100644 --- a/src/multiproblem_template.jl +++ b/src/multiproblem_template.jl @@ -3,6 +3,11 @@ struct MultiProblemTemplate <: PSI.AbstractProblemTemplate sub_templates::Dict{String, PSI.ProblemTemplate} end +PSI.get_device_models(template::MultiProblemTemplate) = template.base_template.devices +PSI.get_branch_models(template::MultiProblemTemplate) = template.base_template.branches +PSI.get_service_models(template::MultiProblemTemplate) = template.base_template.services +PSI.get_network_model(template::MultiProblemTemplate) = template.base_template.network_model + function MultiProblemTemplate( base_template::PSI.ProblemTemplate, problem_keys::Vector{String}, diff --git a/src/problems/multi_region_problem.jl b/src/problems/multi_region_problem.jl index a78a04d..6bcbfbb 100644 --- a/src/problems/multi_region_problem.jl +++ b/src/problems/multi_region_problem.jl @@ -48,7 +48,7 @@ function build_pre_step!(model::PSI.DecisionModel{MultiRegionProblem}) @info "Initializing Optimization Container For a DecisionModel" init_optimization_container!( PSI.get_optimization_container(model), - PSI.get_network_formulation(PSI.get_template(model)), + PSI.get_network_model(PSI.get_template(model)), PSI.get_system(model), ) @info "Initializing ModelStoreParams"