Skip to main content

Validation

The diagram and tables below show the validation rules applied to the input to the Julia core before running the model. Some node types have more complex connectivity validation than shown here. See the Junction and UserDemand pages for their additional rules.

1 Allowed connectivity

The diagram below shows every allowed upstream and downstream node type for each node type that can have flow links. Each group has its own nodes, with upstream neighbors on the left, downstream neighbors on the right, and flow directed from left to right. This is a connectivity illustration, not a valid simulation model.

Code
%run ../../utils/plot_node_connectivity.py
import matplotlib.pyplot as plt

fig = plot_all_node_connectivity()
plt.show()
plt.close(fig)

2 Neighbor amounts

The tables below show the minimum and maximum numbers of incoming and outgoing neighbors for each node type, per link type. ∞ means there is no upper bound.

Code
from ribasim.validation import link_neighbor_amount


for link_type in ("flow", "control", "listen"):
    node_bounds = link_neighbor_amount[link_type]
    print(f"\n## {link_type.title()} links\n")
    print("| Node type | in_min | in_max | out_min | out_max |")
    print("|:----------|-------:|-------:|--------:|--------:|")
    for node_type, bounds in node_bounds.items():
        values = ["∞" if value == 2**63 - 1 else str(value) for value in bounds]
        print(f"| {node_type} | {' | '.join(values)} |")
    print()