Skip to content

Commit

Permalink
Fix documentation optimization problem example
Browse files Browse the repository at this point in the history
  • Loading branch information
SouthEndMusic committed Feb 9, 2024
1 parent 59508a0 commit 1e27b36
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/core/allocation.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,11 @@ The following is an example of an optimization problem for the example shown [he
# | code-fold: true
using Ribasim
using SQLite
using ComponentArrays: ComponentVector
toml_path = normpath(@__DIR__, "../../generated_testmodels/allocation_example/ribasim.toml")
p = Ribasim.Model(toml_path).integrator.p
u = ComponentVector(; storage = zeros(length(p.basin.node_id)))
allocation_model = p.allocation.allocation_models[1]
t = 0.0
Expand All @@ -246,7 +248,7 @@ Ribasim.set_flow!(p.graph, Ribasim.NodeID(1), Ribasim.NodeID(2), 1.0)
Ribasim.adjust_source_capacities!(allocation_model, p, priority_idx)
Ribasim.adjust_edge_capacities!(allocation_model, p, priority_idx)
Ribasim.set_objective_priority!(allocation_model, p, t, priority_idx)
Ribasim.set_objective_priority!(allocation_model, p, u, t, priority_idx)
println(p.allocation.allocation_models[1].problem)
```

0 comments on commit 1e27b36

Please sign in to comment.