Tree Visualization¶
- gymcts.gymcts_tree_plotter._generate_mcts_tree(start_node: GymctsNode = None, prefix: str = None, depth: int = None, exclude_unvisited_nodes_from_render: bool = True, action_space_n: int = None) Generator[str, Any | None, None][source]¶
Generates a tree representation of the MCTS tree starting from the given node.
This is a recursive function that generates a tree representation of the MCTS tree starting from the given node. The
- Parameters:
start_node – the node to start from
prefix – used to format the tree
depth – used to limit the depth of the tree
exclude_unvisited_nodes_from_render – used to exclude unvisited nodes from the render
action_space_n – the number of actions in the action space
- Returns:
a list of strings representing the tree
- gymcts.gymcts_tree_plotter.show_mcts_tree(start_node: GymctsNode = None, tree_max_depth: int = None, action_space_n: int = None) None[source]¶
Renders the MCTS tree starting from the given node.
- Parameters:
start_node – the node to start from
tree_max_depth – the maximum depth of the tree to render
action_space_n – the number of actions in the action space