15#ifndef INCLUDE_TOURNAMENT_HPP_
16#define INCLUDE_TOURNAMENT_HPP_
35#pragma GCC diagnostic push
36#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
37#include <boost/python.hpp>
38#pragma GCC diagnostic pop
61 std::vector<double>
win;
140 void set_win(
const std::vector<double> &win_);
151 void set_lose(
const std::vector<double> &lose_);
248 void operator()(std::vector<SolversIndividuals> &population,
bool is_white_evolving);
253 std::vector<SolversIndividuals> &population,
258 std::vector<SolversIndividuals> &population,
260 bool is_white_evolving);
262void evol_thread(
const std::vector<ThreadGamePlayer> & gps,
263 std::vector<SolversIndividuals> &population,
265 bool is_white_evolving);
Alpha-Beta algorithm declaration.
Result
Used to return the current state of a game.
Definition: Types.hpp:52
The AlphaBeta class inherits from the ChineseCheckers class and provides an implementation of the alp...
Definition: AlphaBeta.hpp:43
This class simulates a game between two solvers.
Definition: tournament.hpp:187
void set_black_player(SolversIndividuals &solver)
Sets black_player.
Definition: tournament.cpp:504
void set_white_player(SolversIndividuals &solver)
Sets white_player.
Definition: tournament.cpp:499
AlphaBeta white_player
A solver using AlphaBeta.
Definition: tournament.hpp:190
void print_players_info()
Prints information on the players.
Definition: tournament.cpp:565
AlphaBeta black_player
A solver using AlphaBeta.
Definition: tournament.hpp:192
int constructor_test()
Debug function used to test the constructors.
Definition: tournament.cpp:583
void set_depth(const int &depth_)
Sets depth.
Definition: tournament.cpp:509
int depth
The depth AlphaBeta will use.
Definition: tournament.hpp:194
double playGame()
Member used to simulate a game between white_player and black_player.
Definition: tournament.cpp:513
GamePlayer()
Default constructor.
Definition: tournament.cpp:483
This class is designed to represent individuals in a solver population and contains various methods f...
Definition: tournament.hpp:51
friend bool operator<(SolversIndividuals const &s1, SolversIndividuals const &s2)
Operator used to compare two SolversIndividuals.
Definition: tournament.cpp:297
SolversIndividuals()
Default constructor.
Definition: tournament.cpp:262
void print_info_as_matrix_to_file(std::ofstream &file)
Prints information on win and lose to a file given as a parameter.
Definition: tournament.cpp:426
void set_score(const double &score_)
Sets score with the parameter.
Definition: tournament.cpp:332
std::vector< double > lose
The matrix used to compute the heuristic value for the adversary of the player we are playing.
Definition: tournament.hpp:71
std::vector< double > get_lose()
Returns lose.
Definition: tournament.cpp:320
double score
The score the individual got at its last game.
Definition: tournament.hpp:76
std::vector< double > get_win()
Returns win.
Definition: tournament.cpp:316
void set_win(const std::vector< double > &win_)
Sets win with the parameter.
Definition: tournament.cpp:324
void set_lose(const std::vector< double > &lose_)
Sets lose with the parameter.
Definition: tournament.cpp:328
void print_info()
Print information about the SolversIndividuals.
Definition: tournament.cpp:369
void init_at_random()
Inits win and lose at random.
Definition: tournament.cpp:283
void mutate()
Mutates a solver.
Definition: tournament.cpp:341
std::vector< double > win
The matrix used to compute the heuristic value for the player we are playing.
Definition: tournament.hpp:61
void crossOver(const SolversIndividuals &Parent1, const SolversIndividuals &Parent2)
Definition: tournament.cpp:461
SolversIndividuals & operator=(const SolversIndividuals &other)
Operator used to compare two SolversIndividuals.
Definition: tournament.cpp:305
void print_info_as_matrix()
Prints information on win and lose.
Definition: tournament.cpp:390
double get_score()
Returns score.
Definition: tournament.cpp:336
Definition: tournament.hpp:242
void operator()(std::vector< SolversIndividuals > &population, bool is_white_evolving)
Definition: tournament.cpp:767
int end
Definition: tournament.hpp:245
ThreadGamePlayer()
Definition: tournament.cpp:764
int start
Definition: tournament.hpp:244
GamePlayer gp
Definition: tournament.hpp:246
void evol(GamePlayer *gp, std::vector< SolversIndividuals > &population, SolversIndividuals *best_player, bool is_white_evolving)
Definition: tournament.cpp:621
void evol_thread(const std::vector< ThreadGamePlayer > &gps, std::vector< SolversIndividuals > &population, SolversIndividuals *best_player, bool is_white_evolving)
Definition: tournament.cpp:695
void write_scores(std::ofstream &file, std::vector< SolversIndividuals > &population, SolversIndividuals &best_to_write, const int &gen)
Definition: tournament.cpp:606
void print_matrix(const std::vector< double > &matrix)
Definition: tournament.cpp:472
Result playGame(AlphaBeta &player0, AlphaBeta &player1, const int &depth)