geneticengine.representations.tree.utils

Attributes

T

Functions

relabel_nodes(i, g[, is_list])

Recomputes node specifics in the tree.

relabel_nodes_of_trees(i, g)

Recomputes all the nodes, depth and distance_to_term in the tree.

tree_node_fold(i, f)

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:
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.solutions.tree.TreeNode

geneticengine.representations.tree.utils.T
geneticengine.representations.tree.utils.tree_node_fold(i, f)

Recursively folds over all elements of the tree.

Parameters: