pub struct Mcts { /* private fields */ }Expand description
UCT Monte Carlo tree search for sequential games, with chance nodes.
Assumes exactly one active player per decision node (like Minimax) and
two-player zero-sum outcomes. All node values are kept from a fixed root
player’s perspective: the root maximizes, the opponent minimizes (a sign
flip in selection), and chance nodes average their sampled children, which
is exactly the expectiminimax behavior. Chance nodes are descended by
sampling Game::chance_outcomes, never by UCT.
Rollouts are uniform-random. Randomness (rollouts and chance sampling) comes from an internal seeded generator, so a run is reproducible.
Implementations§
Source§impl Mcts
impl Mcts
Sourcepub const fn new(iterations: u32, seed: u64) -> Self
pub const fn new(iterations: u32, seed: u64) -> Self
Creates a search running iterations simulations per move, seeded from
seed. Uses the standard UCT exploration constant (sqrt 2).
Sourcepub const fn with_exploration(self, exploration: f64) -> Self
pub const fn with_exploration(self, exploration: f64) -> Self
Sets the UCT exploration constant (higher explores more).