neat.STree.getNodesInSubtree

STree.getNodesInSubtree(ref_node, subtree_root=None)[source]

Returns the nodes in the subtree that contains the given reference nodes and has the given subtree root as root. If the subtree root is not provided, the subtree of the first child node of the root on the path to the reference node is given (plus the root)

Parameters
  • ref_node (neat.SNode) – the reference node that is in the subtree

  • subtree_root (neat.SNode) – what is to be the root of the subtree. If this node is not on the path from reference node to root, a ValueError is raised

Returns

List of all nodes in the subtree. It’s root is in the first position

Return type

list of neat.SNode