pub fn complete_rollouts<R : Rng + ?Sized>(self, game_state : GameState, 
                                              network_config : &NetworkConfig, rng : &mut R) -> Vec<f32> {
        if let RolloutStrategy::NetworkConfig = self {
            let mut network_rollout = NetworkRolloutState::new(game_state, network_config);
            while (network_rollout.remaining_turns > 0) {
                network_rollout = network_rollout.step(network_config);
            }
            let result = network_rollout.min_distances.into();
            result
        } else {
            let mut result = Vec::new();
            let current_set_size = game_state.matrix_set.size();
            for i in 0..current_set_size {
                for j in 0..current_set_size {
                    let child_game_state = game_state.clone().perform_move(i, j);
                    let value = match (self) {
                        RolloutStrategy::Random => child_game_state.complete_random_rollout(rng),
                        RolloutStrategy::Greedy => child_game_state.complete_greedy_rollout(),
                        _ => panic!()
                    };
                    result.push(value);
                }
            }
            result
        }
    }
///Takes a starting game state and the network config and rng to a vec filled with k^2 rollout results, one
///for each potential next move in the current game-state with k matrices
Takes a starting game state and the network config and rng to a vec filled with k^2 rollout results, one
for each potential next move in the current game-state with k matrices
Takes a starting game state and the network config and rng to a vec filled with k^2 rollout results one for each potential next move in the current game - state with k matrices
pub fn complete_rollouts<R : Rng + ?Sized>(self, game_state : GameState, 
                                              network_config : &NetworkConfig, rng : &mut R) -> Vec<f32> {
        if let RolloutStrategy::NetworkConfig = self {
            let mut network_rollout = NetworkRolloutState::new(game_state, network_config);
            while (network_rollout.remaining_turns > 0) {
                network_rollout = network_rollout.step(network_config);
            }
            let result = network_rollout.min_distances.into();
            result
        } else {
            let mut result = Vec::new();
            let current_set_size = game_state.matrix_set.size();
            for i in 0..current_set_size {
                for j in 0..current_set_size {
                    let child_game_state = game_state.clone().perform_move(i, j);
                    let value = match (self) {
                        RolloutStrategy::Random => child_game_state.complete_random_rollout(rng),
                        RolloutStrategy::Greedy => child_game_state.complete_greedy_rollout(),
                        _ => panic!()
                    };
                    result.push(value);
                }
            }
            result
        }
    }
pub fn complete_rollouts < R : Rng + ? Sized > ( self , game_state : GameState , network_config : & NetworkConfig , rng : & mut R ) -> Vec < f32 > { if let RolloutStrategy :: NetworkConfig = self { let mut network_rollout = NetworkRolloutState :: new ( game_state , network_config ) ; while ( network_rollout . remaining_turns > 0 ) { network_rollout = network_rollout . step ( network_config ) ; } let result = network_rollout . min_distances . into ( ) ; result } else { let mut result = Vec :: new ( ) ; let current_set_size = game_state . matrix_set . size ( ) ; for i in 0 .. current_set_size { for j in 0 .. current_set_size { let child_game_state = game_state . clone ( ) . perform_move ( i , j ) ; let value = match ( self ) { RolloutStrategy :: Random => child_game_state . complete_random_rollout ( rng ) , RolloutStrategy :: Greedy => child_game_state . complete_greedy_rollout ( ) , _ => panic ! ( ) } ; result . push ( value ) ; } } result } }
Takes a starting game state and the network config and rng to a vec filled with k^2 rollout results, one
for each potential next move in the current game-state with k matrices
Takes a starting game state and the network config and rng to a vec filled with k^2 rollout results one for each potential next move in the current game - state with k matrices
self
game_state
GameState
network_config
&NetworkConfig
rng
&mut R
self
game_state
GameState
network_config
&NetworkConfig
rng
&mut R