const nodelist_bn* GetNetNodes_bn ( const net_bn*  net )

Returns a list of all the nodes in net.

If net has no directed cycles, the list will be in topological order (i.e., a parent will always appear before its children).

To obtain the number of nodes in the net, use the length of the returned list (it will not contain duplicates or NULL entries).

If you need the list to persist, make a copy of the list returned (with DupNodeList_bn), since its contents may become invalid after further calls to Netica API (e.g., one that changes the nodes of a net, such as NewNode_bn). This is a list managed by Netica (declared const), so do not call any function to modify or free it (e.g., DeleteNodeList_bn).

Consecutive calls to this function may yield lists in different orders, so if you are depending on a consistent ordering (for example, by using integers to index the nodes), construct a fixed list by calling DupNodeList_bn on the list returned.


This function is available in all versions.

See also:

DeleteNode_bn    Removes a node from the net
NewNode_bn    Creates a new node for the net