pub fn make_action(&mut self, action: Move) {
        // Re-root tree, panicking if the move is invalid
        let new_root = self.root.apply_move(action).unwrap();
        self.root = new_root;

        // Free all memory for positions which we know are unreachable from the root.
        // Since moves can't remove pieces, a good guess is any node with less pieces than the root.
        let root_pieces = self.root.board.occupied_mask().count_occupied();
        let min_reachable_state_pieces = if self.root.get_moves().is_empty() {
            // Next move is a pass -> states with as many pieces as the root may be reachable
            root_pieces
        } else {
            // Next move is not a pass -> only states with more pieces are reachable
            root_pieces + 1
        };
        self.positions.retain(|&game, _| {
            (game == new_root)
                || (game.board.occupied_mask().count_occupied() >= min_reachable_state_pieces)
        });
    }
/// Commit to an action, re-rooting the tree at the resulting node.
Commit to an action, re-rooting the tree at the resulting node.
Commit to an action re - rooting the tree at the resulting node .
pub fn make_action(&mut self, action: Move) {
        // Re-root tree, panicking if the move is invalid
        let new_root = self.root.apply_move(action).unwrap();
        self.root = new_root;
        // Free all memory for positions which we know are unreachable from the root.
        // Since moves can't remove pieces, a good guess is any node with less pieces than the root.
        let root_pieces = self.root.board.occupied_mask().count_occupied();
        let min_reachable_state_pieces = if self.root.get_moves().is_empty() {
            // Next move is a pass -> states with as many pieces as the root may be reachable
            root_pieces
        } else {
            // Next move is not a pass -> only states with more pieces are reachable
            root_pieces + 1
        };
        self.positions.retain(|&game, _| {
            (game == new_root)
                || (game.board.occupied_mask().count_occupied() >= min_reachable_state_pieces)
        });
    }
pub fn make_action ( & mut self , action : Move ) { // Re-root tree, panicking if the move is invalid let new_root = self . root . apply_move ( action ) . unwrap ( ) ; self . root = new_root ; // Free all memory for positions which we know are unreachable from the root. // Since moves can't remove pieces, a good guess is any node with less pieces than the root. let root_pieces = self . root . board . occupied_mask ( ) . count_occupied ( ) ; let min_reachable_state_pieces = if self . root . get_moves ( ) . is_empty ( ) { // Next move is a pass -> states with as many pieces as the root may be reachable root_pieces } else { // Next move is not a pass -> only states with more pieces are reachable root_pieces + 1 } ; self . positions . retain ( | & game , _ | { ( game == new_root ) || ( game . board . occupied_mask ( ) . count_occupied ( ) >= min_reachable_state_pieces ) } ) ; }
Commit to an action, re-rooting the tree at the resulting node.
Commit to an action re - rooting the tree at the resulting node .
&mut self
action
Move
&mut self
action
Move