From d00da1e8c0c17eb9ebe4c2a15ae9797bb757e21f Mon Sep 17 00:00:00 2001 From: Daniel Thom Date: Thu, 21 Sep 2023 17:21:38 -0600 Subject: [PATCH] Use getter function --- .../device_constructors/branch_constructor.jl | 2 +- .../device_constructors/load_constructor.jl | 8 ++--- .../renewablegeneration_constructor.jl | 4 +-- .../thermalgeneration_constructor.jl | 32 +++++++++---------- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/devices_models/device_constructors/branch_constructor.jl b/src/devices_models/device_constructors/branch_constructor.jl index f6048b1118..c15958c239 100644 --- a/src/devices_models/device_constructors/branch_constructor.jl +++ b/src/devices_models/device_constructors/branch_constructor.jl @@ -106,7 +106,7 @@ function construct_device!( container, devices, device_model, - typeof(network_model).parameters[1], + get_network_formulation(network_model), ) end return diff --git a/src/devices_models/device_constructors/load_constructor.jl b/src/devices_models/device_constructors/load_constructor.jl index e41b458d2a..ad5766db1e 100644 --- a/src/devices_models/device_constructors/load_constructor.jl +++ b/src/devices_models/device_constructors/load_constructor.jl @@ -67,7 +67,7 @@ function construct_device!( ) add_feedforward_constraints!(container, model, devices) - objective_function!(container, devices, model, typeof(network_model).parameters[1]) + objective_function!(container, devices, model, get_network_formulation(network_model)) add_constraint_dual!(container, sys, model) return @@ -124,7 +124,7 @@ function construct_device!( ) add_feedforward_constraints!(container, model, devices) - objective_function!(container, devices, model, typeof(network_model).parameters[1]) + objective_function!(container, devices, model, get_network_formulation(network_model)) add_constraint_dual!(container, sys, model) return @@ -197,7 +197,7 @@ function construct_device!( ) add_feedforward_constraints!(container, model, devices) - objective_function!(container, devices, model, typeof(network_model).parameters[1]) + objective_function!(container, devices, model, get_network_formulation(network_model)) add_constraint_dual!(container, sys, model) return @@ -252,7 +252,7 @@ function construct_device!( ) add_feedforward_constraints!(container, model, devices) - objective_function!(container, devices, model, typeof(network_model).parameters[1]) + objective_function!(container, devices, model, get_network_formulation(network_model)) add_constraint_dual!(container, sys, model) return diff --git a/src/devices_models/device_constructors/renewablegeneration_constructor.jl b/src/devices_models/device_constructors/renewablegeneration_constructor.jl index 186cd9122e..aa678bb0f2 100644 --- a/src/devices_models/device_constructors/renewablegeneration_constructor.jl +++ b/src/devices_models/device_constructors/renewablegeneration_constructor.jl @@ -103,7 +103,7 @@ function construct_device!( ) add_feedforward_constraints!(container, model, devices) - objective_function!(container, devices, model, typeof(network_model).parameters[1]) + objective_function!(container, devices, model, get_network_formulation(network_model)) add_constraint_dual!(container, sys, model) return @@ -196,7 +196,7 @@ function construct_device!( end add_feedforward_constraints!(container, model, devices) - objective_function!(container, devices, model, typeof(network_model).parameters[1]) + objective_function!(container, devices, model, get_network_formulation(network_model)) add_constraint_dual!(container, sys, model) diff --git a/src/devices_models/device_constructors/thermalgeneration_constructor.jl b/src/devices_models/device_constructors/thermalgeneration_constructor.jl index c4378e8ffb..c060f35c5d 100644 --- a/src/devices_models/device_constructors/thermalgeneration_constructor.jl +++ b/src/devices_models/device_constructors/thermalgeneration_constructor.jl @@ -140,7 +140,7 @@ function construct_device!( add_feedforward_constraints!(container, model, devices) - objective_function!(container, devices, model, typeof(network_model).parameters[1]) + objective_function!(container, devices, model, get_network_formulation(network_model)) add_constraint_dual!(container, sys, model) return end @@ -235,7 +235,7 @@ function construct_device!( add_feedforward_constraints!(container, model, devices) - objective_function!(container, devices, model, typeof(network_model).parameters[1]) + objective_function!(container, devices, model, get_network_formulation(network_model)) add_constraint_dual!(container, sys, model) return @@ -344,7 +344,7 @@ function construct_device!( add_feedforward_constraints!(container, model, devices) - objective_function!(container, devices, model, typeof(network_model).parameters[1]) + objective_function!(container, devices, model, get_network_formulation(network_model)) add_constraint_dual!(container, sys, model) return end @@ -435,7 +435,7 @@ function construct_device!( add_feedforward_constraints!(container, model, devices) - objective_function!(container, devices, model, typeof(network_model).parameters[1]) + objective_function!(container, devices, model, get_network_formulation(network_model)) add_constraint_dual!(container, sys, model) return end @@ -540,7 +540,7 @@ function construct_device!( add_feedforward_constraints!(container, model, devices) - objective_function!(container, devices, model, typeof(network_model).parameters[1]) + objective_function!(container, devices, model, get_network_formulation(network_model)) add_constraint_dual!(container, sys, model) return end @@ -628,7 +628,7 @@ function construct_device!( add_feedforward_constraints!(container, model, devices) - objective_function!(container, devices, model, typeof(network_model).parameters[1]) + objective_function!(container, devices, model, get_network_formulation(network_model)) add_constraint_dual!(container, sys, model) return end @@ -727,7 +727,7 @@ function construct_device!( add_feedforward_constraints!(container, model, devices) - objective_function!(container, devices, model, typeof(network_model).parameters[1]) + objective_function!(container, devices, model, get_network_formulation(network_model)) add_constraint_dual!(container, sys, model) return end @@ -808,7 +808,7 @@ function construct_device!( add_feedforward_constraints!(container, model, devices) - objective_function!(container, devices, model, typeof(network_model).parameters[1]) + objective_function!(container, devices, model, get_network_formulation(network_model)) return end @@ -951,7 +951,7 @@ function construct_device!( add_feedforward_constraints!(container, model, devices) - objective_function!(container, devices, model, typeof(network_model).parameters[1]) + objective_function!(container, devices, model, get_network_formulation(network_model)) add_constraint_dual!(container, sys, model) return end @@ -1073,7 +1073,7 @@ function construct_device!( add_feedforward_constraints!(container, model, devices) - objective_function!(container, devices, model, typeof(network_model).parameters[1]) + objective_function!(container, devices, model, get_network_formulation(network_model)) add_constraint_dual!(container, sys, model) return end @@ -1191,7 +1191,7 @@ function construct_device!( add_feedforward_constraints!(container, model, devices) - objective_function!(container, devices, model, typeof(network_model).parameters[1]) + objective_function!(container, devices, model, get_network_formulation(network_model)) add_constraint_dual!(container, sys, model) return end @@ -1294,7 +1294,7 @@ function construct_device!( add_feedforward_constraints!(container, model, devices) - objective_function!(container, devices, model, typeof(network_model).parameters[1]) + objective_function!(container, devices, model, get_network_formulation(network_model)) add_constraint_dual!(container, sys, model) return end @@ -1408,7 +1408,7 @@ function construct_device!( add_feedforward_constraints!(container, model, devices) - objective_function!(container, devices, model, typeof(network_model).parameters[1]) + objective_function!(container, devices, model, get_network_formulation(network_model)) add_constraint_dual!(container, sys, model) return end @@ -1507,7 +1507,7 @@ function construct_device!( add_feedforward_constraints!(container, model, devices) - objective_function!(container, devices, model, typeof(network_model).parameters[1]) + objective_function!(container, devices, model, get_network_formulation(network_model)) add_constraint_dual!(container, sys, model) return end @@ -1635,7 +1635,7 @@ function construct_device!( add_feedforward_constraints!(container, model, devices) - objective_function!(container, devices, model, typeof(network_model).parameters[1]) + objective_function!(container, devices, model, get_network_formulation(network_model)) add_constraint_dual!(container, sys, model) return end @@ -1730,7 +1730,7 @@ function construct_device!( add_feedforward_constraints!(container, model, devices) - objective_function!(container, devices, model, typeof(network_model).parameters[1]) + objective_function!(container, devices, model, get_network_formulation(network_model)) add_constraint_dual!(container, sys, model) return end