chipiron.players.move_selector.treevalue.node_selector.uniform package
Submodules
chipiron.players.move_selector.treevalue.node_selector.uniform.uniform module
This module contains the implementation of the Uniform Node selector.
The Uniform Node selector is responsible for selecting nodes to expand in a tree-based move selector algorithm. It uses an opening instructor to determine the moves to open for each node and generates opening instructions accordingly.
Classes: - Uniform: The Uniform Node selector class.
- class chipiron.players.move_selector.treevalue.node_selector.uniform.uniform.Uniform(opening_instructor: OpeningInstructor)[source]
Bases:
objectThe Uniform Node selector
- choose_node_and_move_to_open(tree: MoveAndValueTree, latest_tree_expansions: TreeExpansions) OpeningInstructions[source]
Chooses a node to expand and determines the moves to open for that node.
Args: - tree (trees.MoveAndValueTree): The move and value tree. - latest_tree_expansions (tree_man.TreeExpansions): The latest tree expansions.
Returns: - OpeningInstructions: The opening instructions for the chosen node.
- get_current_depth_to_expand() int[source]
Gets the current depth to expand.
Returns: - int: The current depth to expand.
- opening_instructor: OpeningInstructor
Module contents
This module provides a uniform selection strategy for nodes in a tree.
The Uniform selection strategy selects nodes uniformly at random from the available options.
- Example usage:
from .uniform import Uniform
uniform_selector = Uniform() selected_node = uniform_selector.select_node(nodes)
- class chipiron.players.move_selector.treevalue.node_selector.uniform.Uniform(opening_instructor: OpeningInstructor)[source]
Bases:
objectThe Uniform Node selector
- choose_node_and_move_to_open(tree: MoveAndValueTree, latest_tree_expansions: TreeExpansions) OpeningInstructions[source]
Chooses a node to expand and determines the moves to open for that node.
Args: - tree (trees.MoveAndValueTree): The move and value tree. - latest_tree_expansions (tree_man.TreeExpansions): The latest tree expansions.
Returns: - OpeningInstructions: The opening instructions for the chosen node.
- get_current_depth_to_expand() int[source]
Gets the current depth to expand.
Returns: - int: The current depth to expand.
- opening_instructor: OpeningInstructor