Type Alias SelectionFunction

Source
pub type SelectionFunction<const N: usize> = fn(value: f64, policy: f64, n_visits: f64, parent_n_visits: f64, exploration_coef: f64) -> f64;
Expand description

Type alias for a function pointer used to determine a node’s selection score during MCTS.

This function takes the following parameters:

  • value: The current mean value of the node.
  • policy: The initial policy probability for the action leading to this node (from the parent’s perspective).
  • n_visits: The number of times the node has been visited.
  • parent_n_visits: The number of times the parent node has been visited.
  • exploration_coef: The exploration coefficient from MctsConfig.

It returns an f64 score used to rank nodes for selection.