ECF 1.5
|
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. More... | |
void | registerParameters (StateP) |
Register crossover related but Genotype unrelated parameters. More... | |
bool | initialize (StateP) |
Initialize all crossover operators of all active genotypes. More... | |
Public Attributes | |
std::vector< std::vector< CrossoverOpP > > | operators |
vectors of crx operators for each genotype More... | |
std::vector< std::vector< double > > | opProb |
usage probabilities for each CrossoverOp operator More... | |
Protected Attributes | |
StateP | state_ |
uint | crxGenotypes_ |
what genotypes (if more than one) to cross (random, all) More... | |
std::vector< bool > | protectedGenotypes_ |
protected (non-crossable) genotypes flags More... | |
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::initialize | ( | StateP | state | ) |
Initialize all crossover operators of all active genotypes.
Definition at line 22 of file Crossover.cpp.
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.
void Crossover::registerParameters | ( | StateP | state | ) |
Register crossover related but Genotype unrelated parameters.
Definition at line 10 of file Crossover.cpp.
|
protected |
what genotypes (if more than one) to cross (random, all)
Definition at line 68 of file Crossover.h.
std::vector< std::vector<CrossoverOpP> > Crossover::operators |
vectors of crx operators for each genotype
Definition at line 63 of file Crossover.h.
std::vector< std::vector<double> > Crossover::opProb |
usage probabilities for each CrossoverOp operator
Definition at line 64 of file Crossover.h.
|
protected |
protected (non-crossable) genotypes flags
Definition at line 69 of file Crossover.h.
|
protected |
Definition at line 67 of file Crossover.h.