neat.STree.add_node_with_parent_from_index

STree.add_node_with_parent_from_index(node_index, pnode, *args, **kwargs)[source]

Create a node with the given index and add it to the tree under a specific parent node.

Parameters:
  • node_index (int) – index of the new node

  • pnode (neat.SNode) – parent node of the newly added node

Raises:

ValueError – if node_index is already in the tree