Refactor allocation code #1465
Labels
allocation
Allocation layer
core
Issues related to the computational core in Julia
improvement
Improvements of the usability of existing functionality
These refactoring points came out of the knowledge sharing session (which was more of a code review session):
is_main_network
here:Ribasim/core/src/allocation_optim.jl
Line 1035 in 61b3a17
allocation_util.jl
file with allocation utility functions. This might need some discussion though, I'm not sure what counts as a utility functionallocate!
: Dispatch onoptimization_type
, so severalif
statements can be removedallocate!
andallocate_priority!
need to be renamed, maybe simply tooptimize!
andoptimize_priority!
, as they are not always allocating, depending on theoptimization_type
allocate_priority
AbstractParameterNode
type for nodes. We can add a more specific abstract node type in between, sayAbstractDemandNode
, for nodes that define a demand.adjust_demands_*
functions, loop over theAbstractDemandNode
subtypes and dispatch on them. Alternatively, for all theadjust_*
functions, dispatch on the constraint set names.The text was updated successfully, but these errors were encountered: