ChineseCheckers
This project is a solver for two players' Chinese Checkers game using the Alpha Beta pruning algorithm. The program is written in C++ and uses a number of heuristics to improve the performance of the algorithm. Overall, the Chinese Checkers solver program has been built with performance in mind, and is designed to deliver fast and efficient game play. Whether you are playing against a bot or using the program as a library in your own project, you can be confident that the program will deliver high-performance results.
|
This class is designed to represent individuals in a solver population and contains various methods for manipulating and printing their characteristics. More...
#include <tournament.hpp>
Public Member Functions | |
SolversIndividuals () | |
Default constructor. | |
SolversIndividuals (std::vector< double > &win_, std::vector< double > &lose_) | |
Constructor used to set win and lose. | |
SolversIndividuals & | operator= (const SolversIndividuals &other) |
Operator used to compare two SolversIndividuals. | |
std::vector< double > | get_win () |
Returns win. | |
std::vector< double > | get_lose () |
Returns lose. | |
double | get_score () |
Returns score. | |
void | init_at_random () |
Inits win and lose at random. | |
void | set_win (const std::vector< double > &win_) |
Sets win with the parameter. | |
void | set_lose (const std::vector< double > &lose_) |
Sets lose with the parameter. | |
void | set_score (const double &score_) |
Sets score with the parameter. | |
void | mutate () |
Mutates a solver. | |
void | print_info () |
Print information about the SolversIndividuals. | |
void | print_info_as_matrix () |
Prints information on win and lose. | |
void | print_info_as_matrix_to_file (std::ofstream &file) |
Prints information on win and lose to a file given as a parameter. | |
void | crossOver (const SolversIndividuals &Parent1, const SolversIndividuals &Parent2) |
Private Attributes | |
std::vector< double > | win |
The matrix used to compute the heuristic value for the player we are playing. | |
std::vector< double > | lose |
The matrix used to compute the heuristic value for the adversary of the player we are playing. | |
double | score |
The score the individual got at its last game. | |
Friends | |
bool | operator< (SolversIndividuals const &s1, SolversIndividuals const &s2) |
Operator used to compare two SolversIndividuals. | |
This class is designed to represent individuals in a solver population and contains various methods for manipulating and printing their characteristics.
SolversIndividuals::SolversIndividuals | ( | ) |
Default constructor.
SolversIndividuals::SolversIndividuals | ( | std::vector< double > & | win_, |
std::vector< double > & | lose_ | ||
) |
void SolversIndividuals::crossOver | ( | const SolversIndividuals & | Parent1, |
const SolversIndividuals & | Parent2 | ||
) |
std::vector< double > SolversIndividuals::get_lose | ( | ) |
std::vector< double > SolversIndividuals::get_win | ( | ) |
void SolversIndividuals::init_at_random | ( | ) |
void SolversIndividuals::mutate | ( | ) |
Mutates a solver.
SolversIndividuals & SolversIndividuals::operator= | ( | const SolversIndividuals & | other | ) |
Operator used to compare two SolversIndividuals.
void SolversIndividuals::print_info | ( | ) |
Print information about the SolversIndividuals.
void SolversIndividuals::print_info_as_matrix | ( | ) |
void SolversIndividuals::print_info_as_matrix_to_file | ( | std::ofstream & | file | ) |
Prints information on win and lose to a file given as a parameter.
file | A pointer to the file we want to print information to. |
void SolversIndividuals::set_lose | ( | const std::vector< double > & | lose_ | ) |
void SolversIndividuals::set_score | ( | const double & | score_ | ) |
void SolversIndividuals::set_win | ( | const std::vector< double > & | win_ | ) |
|
friend |
Operator used to compare two SolversIndividuals.
|
private |
|
private |
The score the individual got at its last game.
|
private |