Qatium may go through the following stages to calculate orientation until it gets a result:
- It calculates the shortest distance by counting the elements between water sources.
If the distance is the same for different orientations, supply sources take priority over tanks, so that orientation is selected.
If the distance is the same but all orientations point to the same upstream, that upstream will be selected, as it’s the only solution.
- If distance is the same but we have different possible upstream, none is selected as upstream. In this case, Qatium looks for the shortest path based on the distance of the pipes - as long as it doesn’t include closed valves or pumps.
- If the previous stage also fails to produce an orientation result, Qatium looks at the direction the pipe was drawn. The pipe pointing towards the element is considered upstream, and all other connections are considered downstream.
Reversely, the pipe pointing away is considered downstream; and all others are considered upstream.