Skip to content

Commit

Permalink
remove demand max
Browse files Browse the repository at this point in the history
  • Loading branch information
SouthEndMusic committed Feb 13, 2024
1 parent 708359a commit abc02c7
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions core/src/allocation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -823,14 +823,11 @@ function set_objective_priority!(
ex = sum(problem[:F_abs])
end

demand_max = 0.0

# Terms for subnetworks as users
if is_main_network(allocation_network_id)
for connections_subnetwork in main_network_connections
for connection in connections_subnetwork
d = subnetwork_demands[connection][priority_idx]
demand_max = max(demand_max, d)
add_user_term!(ex, connection, objective_type, d, allocation_model)
end
end
Expand All @@ -852,25 +849,9 @@ function set_objective_priority!(
d = get_user_demand(user, node_id_user, priority_idx)
end

demand_max = max(demand_max, d)
add_user_term!(ex, edge_id, objective_type, d, allocation_model)
end

# Add flow cost
if objective_type == :linear_absolute
cost_per_flow = 0.5 / length(F)
for flow in F
JuMP.add_to_expression!(ex, cost_per_flow * flow)
end
elseif objective_type == :linear_relative
if demand_max > 0.0
cost_per_flow = 0.5 / (demand_max * length(F))
for flow in F
JuMP.add_to_expression!(ex, cost_per_flow * flow)
end
end
end

new_objective = JuMP.@expression(problem, ex)
JuMP.@objective(problem, Min, new_objective)
return nothing
Expand Down

0 comments on commit abc02c7

Please sign in to comment.