|
GALib-Parallel
Header-only C++ library for parallel evolutionary algorithms
|
Abstract base class for all optimization algorithms. More...
#include <Algorithm.h>
Public Member Functions | |
| virtual | ~Algorithm ()=default |
| virtual void | run (Population< GeneType > &population)=0 |
| Executes the optimization process on the given population. | |
| virtual void | enableConsoleLogging (const std::size_t interval) |
| Enables logging of progress to the standard output. | |
| virtual void | enableFileLogging (const std::string &path, std::size_t interval) |
| Enables logging of population snapshots to a CSV file. | |
| virtual void | enableLogging (const std::string &) |
| Placeholder for generic logging configuration. | |
Protected Member Functions | |
| void | notifyLoggers (std::size_t gen, const Population< GeneType > &pop) |
| Notifies all active loggers to record the current state. | |
Protected Attributes | |
| std::unique_ptr< utils::ConsoleLogger< GeneType > > | console_logger_m |
| std::unique_ptr< utils::FileLogger< GeneType > > | file_logger_m |
Abstract base class for all optimization algorithms.
Defines the core interface for running an evolutionary process and provides common functionality for logging to console and files.
| GeneType | The type of the genes (e.g., double, int). |
Definition at line 22 of file Algorithm.h.
|
virtualdefault |
|
inlinevirtual |
Enables logging of progress to the standard output.
| interval | The frequency of logging (every N generations). 0 disables. |
Definition at line 59 of file Algorithm.h.
References galib::Algorithm< GeneType >::console_logger_m.
|
inlinevirtual |
Enables logging of population snapshots to a CSV file.
| path | The path where the CSV file will be created. |
| interval | The frequency of logging (every N generations). 0 disables. |
Definition at line 68 of file Algorithm.h.
References galib::Algorithm< GeneType >::file_logger_m.
|
inlinevirtual |
Placeholder for generic logging configuration.
Definition at line 75 of file Algorithm.h.
|
inlineprotected |
Notifies all active loggers to record the current state.
| gen | The current generation index. |
| pop | The current population. |
Definition at line 32 of file Algorithm.h.
References galib::Algorithm< GeneType >::console_logger_m, and galib::Algorithm< GeneType >::file_logger_m.
Referenced by galib::CellularGA< GeneType >::run(), galib::DifferentialEvolutionGA< GeneType >::run(), galib::IslandGA< GeneType >::run(), and galib::StandardGA< GeneType >::run().
|
pure virtual |
Executes the optimization process on the given population.
This is a pure-virtual method that must be implemented by concrete algorithms (e.g., StandardGA, IslandGA).
| population | The population to optimize. Modified in-place. |
Implemented in galib::CellularGA< GeneType >, galib::DifferentialEvolutionGA< GeneType >, galib::IslandGA< GeneType >, galib::StandardGA< GeneType >, and galib::cuda::StandardGACUDA< GeneType >.
|
protected |
Definition at line 24 of file Algorithm.h.
Referenced by galib::Algorithm< GeneType >::enableConsoleLogging(), galib::Algorithm< GeneType >::notifyLoggers(), and galib::StandardGA< GeneType >::run().
|
protected |
Definition at line 25 of file Algorithm.h.
Referenced by galib::Algorithm< GeneType >::enableFileLogging(), and galib::Algorithm< GeneType >::notifyLoggers().