pub fn update_iteration<R : Rng + ?Sized>(&mut self, rollout_strategy : RolloutStrategy,
                                              network_config : &NetworkConfig, 
                                              rng : &mut R) -> f32 {
        let mut traverser = self.traverse_from_root();
        while (traverser.has_expanded_children(&self) && traverser.has_remaining_turns()) {
            traverser.move_to_best_child(self, rng);
        }
        if (!traverser.has_remaining_turns()) {
            //All-expanded children, but we ran out of turns. No big deal,
            //this traversal was still probably useful to update the edge visit-counts
            return traverser.game_state.get_distance();
        }
        //Otherwise, we must be at a place where we should expand all of the children.
        let child_values = traverser.expand_children(self, rollout_strategy, network_config, rng);        
        let mut minimal_child_value = f32::INFINITY; 
        for child_value in child_values.iter() {
            if (*child_value < minimal_child_value) {
                minimal_child_value = *child_value;
            }
        }
        traverser.update_distributions_to_root(self, child_values);

        minimal_child_value
    }
///Updates this game tree using MCTS with playouts determined by the passed network config
///and with random choices determined by the passed Rng. Returns the minimal distance to
///the target along the paths taken in the MCTS iteration, which includes the minimal
///distances achieved by the playouts during node-expansion.
Updates this game tree using MCTS with playouts determined by the passed network config
and with random choices determined by the passed Rng. Returns the minimal distance to
the target along the paths taken in the MCTS iteration, which includes the minimal
distances achieved by the playouts during node-expansion.
Updates this game tree using MCTS with playouts determined by the passed network config and with random choices determined by the passed Rng . Returns the minimal distance to the target along the paths taken in the MCTS iteration which includes the minimal distances achieved by the playouts during node - expansion .
pub fn update_iteration<R : Rng + ?Sized>(&mut self, rollout_strategy : RolloutStrategy,
                                              network_config : &NetworkConfig, 
                                              rng : &mut R) -> f32 {
        let mut traverser = self.traverse_from_root();
        while (traverser.has_expanded_children(&self) && traverser.has_remaining_turns()) {
            traverser.move_to_best_child(self, rng);
        }
        if (!traverser.has_remaining_turns()) {
            //All-expanded children, but we ran out of turns. No big deal,
            //this traversal was still probably useful to update the edge visit-counts
            return traverser.game_state.get_distance();
        }
        //Otherwise, we must be at a place where we should expand all of the children.
        let child_values = traverser.expand_children(self, rollout_strategy, network_config, rng);        
        let mut minimal_child_value = f32::INFINITY; 
        for child_value in child_values.iter() {
            if (*child_value < minimal_child_value) {
                minimal_child_value = *child_value;
            }
        }
        traverser.update_distributions_to_root(self, child_values);
        minimal_child_value
    }
pub fn update_iteration < R : Rng + ? Sized > ( & mut self , rollout_strategy : RolloutStrategy , network_config : & NetworkConfig , rng : & mut R ) -> f32 { let mut traverser = self . traverse_from_root ( ) ; while ( traverser . has_expanded_children ( & self ) && traverser . has_remaining_turns ( ) ) { traverser . move_to_best_child ( self , rng ) ; } if ( ! traverser . has_remaining_turns ( ) ) { //All-expanded children, but we ran out of turns. No big deal, //this traversal was still probably useful to update the edge visit-counts return traverser . game_state . get_distance ( ) ; } //Otherwise, we must be at a place where we should expand all of the children. let child_values = traverser . expand_children ( self , rollout_strategy , network_config , rng ) ; let mut minimal_child_value = f32 :: INFINITY ; for child_value in child_values . iter ( ) { if ( * child_value < minimal_child_value ) { minimal_child_value = * child_value ; } } traverser . update_distributions_to_root ( self , child_values ) ; minimal_child_value }
Updates this game tree using MCTS with playouts determined by the passed network config
and with random choices determined by the passed Rng.
Updates this game tree using MCTS with playouts determined by the passed network config and with random choices determined by the passed Rng .
&mut self
rollout_strategy
RolloutStrategy
network_config
&NetworkConfig
rng
&mut R
&mut self
rollout_strategy
RolloutStrategy
network_config
&NetworkConfig
rng
&mut R