Skip to content

Commit

Permalink
Allow no allocation model (#1134)
Browse files Browse the repository at this point in the history
Fixes #1133

---------

Co-authored-by: Bart de Koning <[email protected]>
  • Loading branch information
visr and SouthEndMusic authored Feb 16, 2024
1 parent 46f194b commit 5dfae3d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/callback.jl
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ function set_control_params!(p::Parameters, node_id::NodeID, control_state::Stri
end

# Set new fractional flow fractions in allocation problem
if node isa FractionalFlow && field == :fraction
if is_active(p.allocation) && node isa FractionalFlow && field == :fraction
set_fractional_flow_in_allocation!(p, node_id, value)
end
end
Expand Down
2 changes: 2 additions & 0 deletions core/src/parameter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ struct Allocation
}
end

is_active(allocation::Allocation) = !isempty(allocation.allocation_models)

"""
Type for storing metadata of nodes in the graph
type: type of the node
Expand Down

0 comments on commit 5dfae3d

Please sign in to comment.