|
GALib-Parallel
Header-only C++ library for parallel evolutionary algorithms
|
Logger for writing optimization progress to a CSV file. More...
#include <FileLogger.h>
Public Member Functions | |
| FileLogger (const std::string &path, const std::size_t interval) | |
| Constructs a file logger. | |
| void | log (std::size_t gen, const Population< GeneType > &pop) |
| Appends current population data to the CSV file. | |
Logger for writing optimization progress to a CSV file.
Records the fitness and genotype of every individual in the population at defined intervals, creating a detailed audit trail of the evolution.
| GeneType | The gene type of the population. |
Definition at line 22 of file FileLogger.h.
|
inline |
Constructs a file logger.
| path | Output CSV file path. |
| interval | Generation frequency for recording data. |
Definition at line 34 of file FileLogger.h.
|
inline |
Appends current population data to the CSV file.
| gen | Current generation index. |
| pop | Current population state. |
Definition at line 42 of file FileLogger.h.
References galib::Population< GeneType >::getNumGenes(), and galib::Population< GeneType >::size().