Skip to content

Commit

Permalink
comments adressed
Browse files Browse the repository at this point in the history
  • Loading branch information
SouthEndMusic committed Apr 2, 2024
1 parent 43c5331 commit d1df84d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions core/src/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,11 @@ function formulate_flow!(
# effectively allocated = demand.
for priority_idx in eachindex(allocated[i])
alloc_prio = allocated[i][priority_idx]
demand_prio =
demand_from_timeseries[i] ? demand_itp[i][priority_idx](t) :
demand_prio = if demand_from_timeseries[i]
demand_itp[i][priority_idx](t)
else
get_user_demand(p, id, priority_idx; reduced = false)
end
alloc = min(alloc_prio, demand_prio)
q += alloc
end
Expand Down
2 changes: 1 addition & 1 deletion docs/core/allocation.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ within this *Allocation* section the main network is also considered to be a sub
The allocation algorithm contains 3 types of optimization:

- `internal_sources`, where flows are allocated within a subnetwork by only using sources inside the subnetwork;
- `collect_demands`, where flows are allocated within a subnetwork by only using the main network inlet as a source, with demands reduced by allocations in `internal_sources`;
- `collect_demands`, where flows are allocated within a subnetwork by only using the main network inlet(s) as a source, with demands reduced by allocations in `internal_sources`. The allocated flows in this optimization type are not used. The goal is to see the flow through the main network inlet(s), which is interpreted as the subnetwork demand;
- `allocate`, where all available sources are used and the final allocated flows for the users are determined.

The full algorithm goes through the following steps:
Expand Down

0 comments on commit d1df84d

Please sign in to comment.