|
GALib-Parallel
Header-only C++ library for parallel evolutionary algorithms
|
Implementation of the Island Model Genetic Algorithm (Coarse-Grained Parallel GA). More...
#include <IslandGA.h>
Public Member Functions | |
| IslandGA (FitnessFunction< GeneType > &ff, std::unique_ptr< Selection< GeneType > > sel, std::unique_ptr< Mutation< GeneType > > mu, std::unique_ptr< Crossover< GeneType > > cs, std::unique_ptr< DemeReplacer< GeneType > > replacer, std::unique_ptr< DemeSelector< GeneType > > selector, std::unique_ptr< internal::MigrationBuffer< GeneType > > buffer, std::unique_ptr< internal::Communicator< GeneType > > comm, std::unique_ptr< const Topology > topology, std::unique_ptr< internal::Serializer< GeneType > > serializer, const IslandGAParams &config, const bool elitism=true) | |
| Constructs an IslandGA instance. | |
| void | run (Population< GeneType > &population) override |
| Runs the evolutionary loop for this island. | |
Public Member Functions inherited from galib::Algorithm< GeneType > | |
| virtual | ~Algorithm ()=default |
| 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. | |
Additional Inherited Members | |
Protected Member Functions inherited from galib::Algorithm< GeneType > | |
| void | notifyLoggers (std::size_t gen, const Population< GeneType > &pop) |
| Notifies all active loggers to record the current state. | |
Protected Attributes inherited from galib::Algorithm< GeneType > | |
| std::unique_ptr< utils::ConsoleLogger< GeneType > > | console_logger_m |
| std::unique_ptr< utils::FileLogger< GeneType > > | file_logger_m |
Implementation of the Island Model Genetic Algorithm (Coarse-Grained Parallel GA).
This algorithm manages a single "Island" in an Archipelago. It evolves a local population independently and periodically migrates individuals to/from neighboring islands based on a defined topology. Parallelization within the island is handled via OpenMP.
| GeneType | The numeric type of each gene (default: double). |
Definition at line 39 of file IslandGA.h.
|
inline |
Constructs an IslandGA instance.
| ff | Fitness function to minimize. |
| sel | Selection operator for reproduction. |
| mu | Mutation operator. |
| cs | Crossover operator. |
| replacer | Policy for integrating arrived migrants. |
| selector | Policy for choosing individuals to migrate out. |
| buffer | Thread-safe buffer for incoming migrants. |
| comm | MPI communicator for network transport. |
| topology | The logical graph structure of the archipelago. |
| serializer | Object responsible for binary serialization. |
| config | Island-specific parameters (migration interval, size, etc.). |
| elitism | Whether to preserve the best individual locally (default: true). |
Definition at line 177 of file IslandGA.h.
|
inlineoverridevirtual |
Runs the evolutionary loop for this island.
Executes the local GA loop while handling asynchronous migration events and final global synchronization of the best result.
| population | The local population to evolve. |
Implements galib::Algorithm< GeneType >.
Definition at line 212 of file IslandGA.h.
References galib::Population< GeneType >::empty(), galib::Population< GeneType >::getNumGenes(), galib::AlgorithmConfig::max_generations, galib::Algorithm< GeneType >::notifyLoggers(), and galib::Population< GeneType >::size().