I'm looking at making these variable bounds lazy:
|
function branch_rate_bounds!( |
|
container::OptimizationContainer, |
|
::DeviceModel{B, T}, |
|
network_model::NetworkModel{<:AbstractPowerModel}, |
|
) where {B <: PSY.ACTransmission, T <: AbstractBranchFormulation} |
|
time_steps = get_time_steps(container) |
|
net_reduction_data = get_network_reduction(network_model) |
|
all_branch_maps_by_type = net_reduction_data.all_branch_maps_by_type |
|
for var in _get_flow_variable_vector(container, network_model, B) |
|
for (name, (arc, reduction)) in PNM.get_name_to_arc_map(net_reduction_data, B) |
|
# TODO: entry is not type stable here, it can return any type ACTransmission. |
|
# It might have performance implications. Possibly separate this into other functions |
|
reduction_entry = all_branch_maps_by_type[reduction][B][arc] |
|
# Use the same limit values as FlowRateConstraint for consistency. |
|
limits = get_min_max_limits(reduction_entry, FlowRateConstraint, T) |
|
for t in time_steps |
|
@assert limits.min <= limits.max "Infeasible rate limits for branch $(name)" |
|
JuMP.set_upper_bound(var[name, t], limits.max) |
|
JuMP.set_lower_bound(var[name, t], limits.min) |
|
end |
|
end |
|
end |
|
return |
|
end |
and I ran into an issue: this function loops over multiple occurrences of the same var[name, t].
Is this expected (and just a minor performance issue to be re-setting existing bounds)? Or is it a bug somewhere?
I'm looking at making these variable bounds lazy:
PowerOperationsModels.jl/src/ac_transmission_models/AC_branches.jl
Lines 211 to 234 in 0b29d0d
and I ran into an issue: this function loops over multiple occurrences of the same
var[name, t].Is this expected (and just a minor performance issue to be re-setting existing bounds)? Or is it a bug somewhere?