Skip to content

Commit

Permalink
Comments adressed
Browse files Browse the repository at this point in the history
  • Loading branch information
SouthEndMusic committed Dec 3, 2024
1 parent de9ec5b commit bc9eeae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion core/src/callback.jl
Original file line number Diff line number Diff line change
Expand Up @@ -802,11 +802,14 @@ function update_allocation!(integrator)::Nothing
end

# Reset the mean flows
for mean_flows in (mean_input_flows..., mean_realized_flows)
for mean_flows in mean_input_flows
for edge in keys(mean_flows)
mean_flows[edge] = 0.0
end
end
for edge in keys(mean_realized_flows)
mean_realized_flows[edge] = 0.0
end
end

"Load updates from 'TabulatedRatingCurve / time' into the parameters"
Expand Down
7 changes: 5 additions & 2 deletions core/src/read.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1283,8 +1283,11 @@ function Allocation(db::DB, config::Config, graph::MetaGraph)::Allocation
id_source, _ = edge
if id_source.type in boundary_source_nodetypes
(; subnetwork_id) = graph[id_source]
subnetwork_idx = searchsortedfirst(subnetwork_ids, subnetwork_id)
mean_input_flows[subnetwork_idx][edge] = 0.0
# Check whether the source node is part of a subnetwork
if subnetwork_id 0
subnetwork_idx = searchsortedfirst(subnetwork_ids, subnetwork_id)
mean_input_flows[subnetwork_idx][edge] = 0.0
end
end
end

Expand Down

0 comments on commit bc9eeae

Please sign in to comment.