Crossover class - handles crossover of _individuals_ (as opposed to CrossoverOp class that crosses genotypes). More...
#include <Crossover.h>
Public Member Functions | |
bool | mate (IndividualP ind1, IndividualP ind2, IndividualP child) |
Crosses 2 individuals. | |
void | registerParameters (StateP) |
Register crossover related but Genotype unrelated parameters. | |
bool | initialize (StateP) |
Initialize all crossover operators of all active genotypes. | |
Public Attributes | |
std::vector< std::vector < CrossoverOpP > > | operators |
vectors of crx operators for each genotype | |
std::vector< std::vector < double > > | opProb |
usage probabilities for each CrossoverOp operator | |
Protected Attributes | |
StateP | state_ |
uint | crxGenotypes_ |
what genotypes (if more than one) to cross (random, all) | |
std::vector< bool > | protectedGenotypes_ |
protected (non-crossable) genotypes flags |
Crossover class - handles crossover of _individuals_ (as opposed to CrossoverOp class that crosses genotypes).
Crossover class is in fact a repository of every crossover operator (MutationOp) for every active Genotype (the genotypes used in individuals). Determines which CrossoverOp will be used for each genotype.
Definition at line 56 of file Crossover.h.
bool Crossover::mate | ( | IndividualP | ind1, | |
IndividualP | ind2, | |||
IndividualP | child | |||
) |
Crosses 2 individuals.
If any of the parent individuals is also the child, makes a copy of that individual. Determines which CrossoverOp will be used to cross each genotype.
Definition at line 95 of file Crossover.cpp.