pub struct SearchTree<S: GameState<A, Pl>, A: GameAction, Pl: Player, Po: TreePolicy<A, Pl>> { /* private fields */ }Expand description
Represents a MCTS search tree.
Implementations§
Source§impl<S, A, Pl, Po> SearchTree<S, A, Pl, Po>
impl<S, A, Pl, Po> SearchTree<S, A, Pl, Po>
pub fn new(game: S, tree_policy: Po) -> SearchTree<S, A, Pl, Po>
Sourcepub fn run(&mut self, iterations: usize)
pub fn run(&mut self, iterations: usize)
Runs the MCTS algorithm for the given number of iterations.
Sourcepub fn get_best_action(&mut self) -> Option<A>
pub fn get_best_action(&mut self) -> Option<A>
Returns the best action according to the MCTS algorithm.
Trait Implementations§
Source§impl<S, A, Pl, Po> Display for SearchTree<S, A, Pl, Po>
impl<S, A, Pl, Po> Display for SearchTree<S, A, Pl, Po>
Auto Trait Implementations§
impl<S, A, Pl, Po> Freeze for SearchTree<S, A, Pl, Po>
impl<S, A, Pl, Po> RefUnwindSafe for SearchTree<S, A, Pl, Po>
impl<S, A, Pl, Po> Send for SearchTree<S, A, Pl, Po>
impl<S, A, Pl, Po> Sync for SearchTree<S, A, Pl, Po>
impl<S, A, Pl, Po> Unpin for SearchTree<S, A, Pl, Po>
impl<S, A, Pl, Po> UnwindSafe for SearchTree<S, A, Pl, Po>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more