pub struct MctsConfig<const N: usize> {
pub exploration_coef: f64,
pub selection_function: SelectionFunction<N>,
}Expand description
Configuration parameters for a single Monte Carlo Tree Search (MCTS) instance.
This struct allows customization of MCTS behavior, including the exploration-exploitation balance and the specific function used to calculate node selection scores.
§Type Parameters
N: The number of possible actions in the game.
Fields§
§exploration_coef: f64The exploration coefficient (often denoted as C_p or C_u) used in the selection phase.
A higher value encourages more exploration of less-visited nodes, while a lower value prioritizes exploitation of known good paths.
selection_function: SelectionFunction<N>The function used to calculate the selection score for a child node during MCTS traversal.
This function typically balances exploitation (based on value) and exploration (based on visits).
You can use provided functions like ucb1 or default_selection_score, or define your own.
Implementations§
Source§impl<const N: usize> MctsConfig<N>
impl<const N: usize> MctsConfig<N>
Sourcepub const DEFAULT: MctsConfig<N>
pub const DEFAULT: MctsConfig<N>
The default MCTS configuration.
exploration_coef:std::f64::consts::SQRT_2(approximately 1.414), a common choice for UCB1.selection_function:default_selection_score, the default formula.