GALib-Parallel
Header-only C++ library for parallel evolutionary algorithms
Loading...
Searching...
No Matches
AlgorithmConfig.h
Go to the documentation of this file.
1#ifndef ALGORITHM_CONFIG_H
2#define ALGORITHM_CONFIG_H
3
4#pragma once
5
6#include <cstddef>
7
8namespace galib {
9
18 std::size_t max_generations = 100;
19
21 double mutation_rate = 0.05;
22
24 double crossover_rate = 0.8;
25
27 bool use_elitism = true;
28 std::size_t threads = 1;
29
31 std::size_t num_threads = 0;
32
33 virtual ~AlgorithmConfig() = default;
34 };
35
36} // namespace galib
37
38#endif // ALGORITHM_CONFIG_H
Base structure for common genetic algorithm configuration parameters.
double mutation_rate
Probability of mutation occurring for each individual [0.0, 1.0].
virtual ~AlgorithmConfig()=default
bool use_elitism
Whether to preserve the best individual across generations.
std::size_t max_generations
Maximum number of generations to evolve.
double crossover_rate
Probability of crossover between parents [0.0, 1.0].
std::size_t num_threads
Number of OpenMP threads to use. 0 means use system default (omp_get_max_threads).