Trait minimax::strategies::mcts::RolloutPolicy
source · pub trait RolloutPolicy {
type G: Game;
// Required method
fn random_move(
&self,
state: &mut <Self::G as Game>::S,
move_scratch: &mut Vec<<Self::G as Game>::M>,
rng: &mut ThreadRng
) -> <Self::G as Game>::M;
// Provided method
fn rollout(
&self,
options: &MCTSOptions,
state: &<Self::G as Game>::S
) -> i32
where <Self::G as Game>::S: Clone { ... }
}
Expand description
Advanced random rollout policy for Monte Carlo Tree Search.
Required Associated Types§
Required Methods§
sourcefn random_move(
&self,
state: &mut <Self::G as Game>::S,
move_scratch: &mut Vec<<Self::G as Game>::M>,
rng: &mut ThreadRng
) -> <Self::G as Game>::M
fn random_move( &self, state: &mut <Self::G as Game>::S, move_scratch: &mut Vec<<Self::G as Game>::M>, rng: &mut ThreadRng ) -> <Self::G as Game>::M
Custom function to choose random move during rollouts. Implementations can bias towards certain moves, ensure winning moves, etc. The provided move vec is for scratch space.