geneticengine.representations.tree.utils
Attributes
Functions
|
Recomputes node specifics in the tree. |
|
Recomputes all the nodes, depth and distance_to_term in the tree. |
|
Recursively folds over all elements of the tree. |
Module Contents
- geneticengine.representations.tree.utils.relabel_nodes(i, g, is_list=False)
Recomputes node specifics in the tree. Returns the number of nodes,
distance to terminal (depth), typed this way, and the weighted number of nodes (counting depth points instead of nodes).
- Parameters:
is_list (bool)
- Return type:
tuple[int, int, dict[type, list[Any]], int]
- geneticengine.representations.tree.utils.relabel_nodes_of_trees(i, g)
Recomputes all the nodes, depth and distance_to_term in the tree.
- Parameters:
- Return type:
- geneticengine.representations.tree.utils.T
- geneticengine.representations.tree.utils.tree_node_fold(i, f)
Recursively folds over all elements of the tree.
- Parameters:
f (Callable[[Any, list[T]], T])