Skip to content

Commit

Permalink
Fix variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-thom committed Mar 27, 2024
1 parent 67cb58c commit 117b085
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions src/devices_models/device_constructors/branch_constructor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function construct_device!(
if has_subnetworks(network_model)
devices = get_available_components(model, sys)

if get_use_slacks(device_model)
if get_use_slacks(model)
add_variables!(
container,
FlowActivePowerSlackUpperBound,
Expand Down Expand Up @@ -84,7 +84,7 @@ function construct_device!(
NetworkModel{AreaBalancePowerModel},
},
) where {T <: PSY.ACBranch}
if get_use_slacks(device_model)
if get_use_slacks(model)
throw(ArgumentError("StaticBranchBounds is not compatible with the use of slacks"))
end
if has_subnetworks(network_model)
Expand Down Expand Up @@ -201,7 +201,7 @@ function construct_device!(
device_model::DeviceModel{T, StaticBranch},
network_model::NetworkModel{<:PM.AbstractActivePowerModel},
) where {T <: PSY.ACBranch}
devices = get_available_components(model, sys)
devices = get_available_components(device_model, sys)
if get_use_slacks(device_model)
add_variables!(
container,
Expand All @@ -218,7 +218,7 @@ function construct_device!(
end
add_feedforward_arguments!(container, device_model, devices)

add_feedforward_arguments!(container, model, devices)
add_feedforward_arguments!(container, device_model, devices)
end

# For DC Power only. Implements constraints
Expand All @@ -231,7 +231,7 @@ function construct_device!(
) where {T <: PSY.ACBranch, U <: PM.AbstractActivePowerModel}
@debug "construct_device" _group = LOG_GROUP_BRANCH_CONSTRUCTIONS

devices = get_available_components(model, sys)
devices = get_available_components(device_model, sys)
add_constraints!(container, RateLimitConstraint, devices, device_model, network_model)
add_feedforward_constraints!(container, device_model, devices)
objective_function!(container, devices, device_model, U)
Expand All @@ -248,7 +248,7 @@ function construct_device!(
network_model::NetworkModel{PTDFPowerModel},
) where {T <: PSY.ACBranch}
devices = get_available_components(model, sys)
if get_use_slacks(device_model)
if get_use_slacks(model)
add_variables!(
container,
FlowActivePowerSlackUpperBound,
Expand Down Expand Up @@ -283,10 +283,10 @@ function construct_device!(
network_model::NetworkModel{PTDFPowerModel},
) where {T <: PSY.ACBranch}
devices = get_available_components(model, sys)
add_constraints!(container, NetworkFlowConstraint, devices, device_model, network_model)
add_constraints!(container, RateLimitConstraint, devices, device_model, network_model)
objective_function!(container, devices, device_model, PTDFPowerModel)
add_constraint_dual!(container, sys, device_model)
add_constraints!(container, NetworkFlowConstraint, devices, model, network_model)
add_constraints!(container, RateLimitConstraint, devices, model, network_model)
objective_function!(container, devices, model, PTDFPowerModel)
add_constraint_dual!(container, sys, model)
return
end

Expand All @@ -299,7 +299,7 @@ function construct_device!(
) where {T <: PSY.ACBranch}
devices = get_available_components(model, sys)

if get_use_slacks(device_model)
if get_use_slacks(model)
throw(ArgumentError("StaticBranchBounds is not compatible with the use of slacks"))
end

Expand Down Expand Up @@ -375,8 +375,7 @@ function construct_device!(
device_model::DeviceModel{T, StaticBranch},
network_model::NetworkModel{<:PM.AbstractPowerModel},
) where {T <: PSY.ACBranch}
devices =
get_available_components(T, sys, get_attribute(device_model, "filter_function"))
devices = get_available_components(device_model, sys) #, get_attribute(device_model, "filter_function"))

if get_use_slacks(device_model)
# Only one slack is needed for this formulations in AC
Expand All @@ -398,7 +397,7 @@ function construct_device!(
device_model::DeviceModel{T, StaticBranch},
network_model::NetworkModel{U},
) where {T <: PSY.ACBranch, U <: PM.AbstractPowerModel}
devices = get_available_components(model, sys)
devices = get_available_components(device_model, sys)
add_constraints!(
container,
RateLimitConstraintFromTo,
Expand Down Expand Up @@ -442,7 +441,7 @@ function construct_device!(
device_model::DeviceModel{T, StaticBranchBounds},
network_model::NetworkModel{<:PM.AbstractPowerModel},
) where {T <: PSY.ACBranch}
devices = get_available_components(model, sys)
devices = get_available_components(device_model, sys)
branch_rate_bounds!(container, devices, device_model, network_model)
add_constraints!(
container,
Expand All @@ -469,7 +468,7 @@ function construct_device!(
device_model::DeviceModel{T, StaticBranchBounds},
network_model::NetworkModel{<:PM.AbstractActivePowerModel},
) where {T <: PSY.ACBranch}
devices = get_available_components(model, sys)
devices = get_available_components(device_model, sys)
branch_rate_bounds!(container, devices, device_model, network_model)
add_constraint_dual!(container, sys, device_model)
return
Expand Down

0 comments on commit 117b085

Please sign in to comment.