|
GALib-Parallel
Header-only C++ library for parallel evolutionary algorithms
|
Performs traditional single-point crossover. More...
#include <SinglePointCrossover.h>
Public Member Functions | |
| SinglePointCrossover ()=default | |
| std::pair< Individual< GeneType >, Individual< GeneType > > | crossover (const Individual< GeneType > &parent1, const Individual< GeneType > &parent2) override |
| Swaps genotype segments at a random crossover point. | |
Public Member Functions inherited from galib::Crossover< GeneType > | |
| virtual | ~Crossover ()=default |
Performs traditional single-point crossover.
A random crossover point is chosen, and the genetic material after that point is swapped between the two parents to create two children.
| GeneType | The numeric type of the genes. |
Definition at line 24 of file SinglePointCrossover.h.
|
default |
|
inlineoverridevirtual |
Swaps genotype segments at a random crossover point.
| parent1 | First parent. |
| parent2 | Second parent. |
| std::invalid_argument | if parents have different genotype sizes. |
Implements galib::Crossover< GeneType >.
Definition at line 35 of file SinglePointCrossover.h.
References galib::Individual< GeneType >::getGenotype().