fn ucb_action_index(&self, position: &InternalPosition) -> usize {
        assert_ne!(position.actions.len(), 0, "Cannot get action for a leaf.");

        let num_visits = position.num_visits();
        let mut best_index = usize::MAX;
        let mut best_score: f64 = f64::NEG_INFINITY;
        for (index, action) in position.actions.iter().enumerate() {
            let score = action.ucb_score(self.prior_weight, num_visits);

            if score > best_score {
                best_index = index;
                best_score = score;
            }
        }

        best_index
    }
/// Get the index of the UCB-suggested action out of a position.
Get the index of the UCB-suggested action out of a position.
Get the index of the UCB - suggested action out of a position .
fn ucb_action_index(&self, position: &InternalPosition) -> usize {
        assert_ne!(position.actions.len(), 0, "Cannot get action for a leaf.");
        let num_visits = position.num_visits();
        let mut best_index = usize::MAX;
        let mut best_score: f64 = f64::NEG_INFINITY;
        for (index, action) in position.actions.iter().enumerate() {
            let score = action.ucb_score(self.prior_weight, num_visits);
            if score > best_score {
                best_index = index;
                best_score = score;
            }
        }
        best_index
    }
fn ucb_action_index ( & self , position : & InternalPosition ) -> usize { assert_ne ! ( position actions len ( ) 0 " " ) ; let num_visits = position . num_visits ( ) ; let mut best_index = usize :: MAX ; let mut best_score : f64 = f64 :: NEG_INFINITY ; for ( index , action ) in position . actions . iter ( ) . enumerate ( ) { let score = action . ucb_score ( self . prior_weight , num_visits ) ; if score > best_score { best_index = index ; best_score = score ; } } best_index }
Get the index of the UCB-suggested action out of a position.
Get the index of the UCB - suggested action out of a position .
&self
position
&InternalPosition
&self
position
&InternalPosition