naUTilus establishes branch node connectivity by creating an incidence matrix. This matrix is an two dimensional array with n rows and m columns, where:
To create this matrix, the naUTilus input file reads the following for each node:
The script creates the required lines for each node in the system. It begins by creating a new table (nodecon.dbf) consisting of two fields. It creates several lists which are used to fill the two fields with the appropriate values. The lists created are:
The script goes through these lists several times. First, the script fills the naUTList. If the value in naUTList is zero, the first loop is ignored because the node is not considered by naUTilus. For nodes which are numbered in both the ArcView and naUTilus systems, a record is added to the new table. Then, the node number is found in TNodeList using the command FindByValue. Because the command FindByValue only finds the first occurrence of a value in a list, to find the number of occurrences in the list, the script deletes the values once they are found. In this way, the number of branches which flow into the nodes is found. This number is stored in NumConList.
For each branch flowing into a node, the script adds a record to the table. It also adds one line for the outflowing branch and one line to hold the number of inflowing/outflowing branches and the node type. To fill the records with the appropriate values, values in TNodeList are restored to the original values and the lists are processed again.
The first line entered for each node is the number of branches (inflowing or outflowing) connected to the node. This value is read from the NumConList. The script then checks to see if that node is a manhole or a junction. The second value of the first line (for each node) is then set as 1 for junction or 2 for manhole.
The value from NumConList also indicates the number of iterations to be made by the next loop. The loop searches through TNodeList to find which branches flow into the node. The index number from TNodeList indicates which branch flows to the node. By searching through FNodeList, the branch which flows out of the nodes is found. The branches are recorded in the next 2-4 lines of the table. Note that some manipulation is done to adjust for the difference in ArcView and naUTilus numbering.
Key Avenue commands used: