Benchmark driver comparing BitBully against Pascal Pons' Connect-4 solver. More...
#include <chrono>#include <fstream>#include <iomanip>#include <iostream>#include <numeric>#include <sstream>#include <string>#include <thirdParty/connect4/Solver.hpp>#include <tuple>#include <unordered_map>#include <vector>#include "BitBully.h"#include "Board.h"Go to the source code of this file.
Typedefs | |
| using | Clock = std::chrono::high_resolution_clock |
| Wall-clock used for the per-call timing measurements. | |
Functions | |
| void | writeToCSV (const std::vector< std::tuple< float, float > > &data, const std::string &filename) |
| Persist per-position timing pairs to a CSV file. | |
| std::unordered_map< std::string, std::string > | parseArgs (const int argc, const char *const argv[]) |
| Parse --key value pairs from the program command line. | |
| int | main (const int argc, const char *const argv[]) |
| Entry point of the benchmark binary. | |
Benchmark driver comparing BitBully against Pascal Pons' Connect-4 solver.
Generates a stream of random positions, asks both solvers to evaluate them with full perfect-play depth and compares the resulting scores. Per-call solve times are dumped to a CSV for offline analysis.
Command-line flags:
N positions Definition in file main.cpp.
| using Clock = std::chrono::high_resolution_clock |
| int main | ( | const int | argc, |
| const char *const | argv[] ) |
Entry point of the benchmark binary.
| argc | Number of CLI arguments (as forwarded by the OS). |
| argv | CLI arguments. |
0 on success, EXIT_FAILURE if the two solvers disagree on any position or on argument-parsing errors. Definition at line 108 of file main.cpp.
| std::unordered_map< std::string, std::string > parseArgs | ( | const int | argc, |
| const char *const | argv[] ) |
Parse --key value pairs from the program command line.
Exits with EXIT_FAILURE if a key is missing its value.
| argc | Number of CLI tokens (as received by main). |
| argv | CLI tokens. |
Definition at line 84 of file main.cpp.
| void writeToCSV | ( | const std::vector< std::tuple< float, float > > & | data, |
| const std::string & | filename ) |
Persist per-position timing pairs to a CSV file.
The file is written with header Bitbully,Pons-C4 and one row per (BitBully, Pons-C4) timing tuple, with five-digit fixed precision.
| data | Pairs of (time_bitbully, time_pons_c4) in seconds. |
| filename | Destination CSV path. |
Definition at line 54 of file main.cpp.