Struct gomoku::ia::decision::Decision
[−]
[src]
pub struct Decision { player: Team, nb_layers: u32, nb_node: usize, nb_final: usize, time_in_heuristic: Duration, total_time: Duration, result: (usize, usize), }
Fields
player | |
nb_layers | |
nb_node | |
nb_final | |
time_in_heuristic | |
total_time | |
result |
Methods
impl Decision
fn playing_team(turn: &Turn, teams: &(Team, Team), player: &Team) -> Team
fn updated_team((tb, tw): &(Team, Team), new_team: Team) -> (Team, Team)
Return the tuple (team black, team white) with the new team
fn splitted_moves_to_evaluate(board: &GoBoard) -> Vec<Vec<(usize, usize)>>
fn compute_one_move(&mut self, coords: (usize, usize), board: &mut GoBoard, playing_team: Team, teams: (Team, Team), nb_layers: u32, turn: Turn, albet: (i32, i32), heuristic: HeuristicFn) -> ((usize, usize), i32)
launch the recursive for one of the move to evaluate
fn recursive(&mut self, board: &mut GoBoard, turn: Turn, teams: (Team, Team), nb_layers: u32, (alpha, beta): (i32, i32), heuristic: HeuristicFn) -> ((usize, usize), i32)
albet: alpha < beta algo explication
fn one_thread(&mut self, moves: Vec<(usize, usize)>, board: &mut GoBoard, teams: (Team, Team), nb_layers: u32, (alpha, beta): (i32, i32), heuristic: HeuristicFn) -> ((usize, usize), i32)
albet: alpha < beta algo explication
fn launch_threads(&mut self, board: &mut GoBoard, teams: (Team, Team), nb_layers: u32, (alpha, beta): (i32, i32), heuristic: HeuristicFn) -> ((usize, usize), i32)
fn print_result(&self)
fn get_optimal_move(board: &mut GoBoard, teams: &(Team, Team), player: Team, nb_layers: u32, heuristic: HeuristicFn) -> Decision
Return the coordinates of the move which is considered to maximise the odds of victory for the team.
teams the two teams, black first and white second
player is the team for which we want to find the optimal move
nb_layers is the number of move which is going to be evaluated by the ia to evaluate the best move. The higher will improve the quality of result but also computationnal time.