ECF 1.7

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

Detailed Description

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.

Member Function Documentation

◆ initialize()

bool Crossover::initialize ( StateP state)

Initialize all crossover operators of all active genotypes.

Definition at line 22 of file Crossover.cpp.

◆ mate()

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.

◆ registerParameters()

void Crossover::registerParameters ( StateP state)

Register crossover related but Genotype unrelated parameters.

Definition at line 10 of file Crossover.cpp.

Member Data Documentation

◆ crxGenotypes_

uint Crossover::crxGenotypes_
protected

what genotypes (if more than one) to cross (random, all)

Definition at line 68 of file Crossover.h.

◆ operators

std::vector< std::vector<CrossoverOpP> > Crossover::operators

vectors of crx operators for each genotype

Definition at line 63 of file Crossover.h.

◆ opProb

std::vector< std::vector<double> > Crossover::opProb

usage probabilities for each CrossoverOp operator

Definition at line 64 of file Crossover.h.

◆ protectedGenotypes_

std::vector<bool> Crossover::protectedGenotypes_
protected

protected (non-crossable) genotypes flags

Definition at line 69 of file Crossover.h.

◆ state_

StateP Crossover::state_
protected

Definition at line 67 of file Crossover.h.


The documentation for this class was generated from the following files: