MTK++ Latest version: 0.2.0

Public Member Functions | Protected Member Functions | Private Attributes
MTKpp::gaAverage Class Reference

Performs chromosome averaging. More...

#include <mtkpp/src/GA/gaAverage.h>

Collaboration diagram for MTKpp::gaAverage:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 gaAverage (gaOperators *parent, std::vector< int > genePerChr, int nChild=1, std::string aver="single-gene", int chrPerInd=1)
 gaAverage Constructor
virtual ~gaAverage ()
 gaAverage destructor
bool average (gaIndividual *ind1, gaIndividual *ind2, gaPopulation *pop, std::string name)
 Main function of gaAverage.

Protected Member Functions

bool __singleGene (gaIndividual *newInd, gaIndividual *parent)
 Single gene averaging.
bool __multipleGene (gaIndividual *newInd, gaIndividual *parent)
 Multiple gene averaging.

Private Attributes

gaOperatorspParent
 gaOperator pointer
int nChild
 Number of offspring produced by each pair of parents.
std::string aver
 Type of Averaging to be carried out.
int chrPerInd
 Number of gaChromsomes per gaIndividual.
std::vector< int > genePerChr
 Number of gaGenes per gaChromsome.

Detailed Description

Performs chromosome averaging.

Author:
Martin Peters
Version:
0.1
Date:
2005

Constructor & Destructor Documentation

MTKpp::gaAverage::gaAverage ( gaOperators parent,
std::vector< int >  genePerChr,
int  nChild = 1,
std::string  aver = "single-gene",
int  chrPerInd = 1 
)

gaAverage Constructor

Parameters:
parentgaOperators pointer
nChildnumber of gaIndividuals to be produced by averaging
averType of averaging procedure employed
chrPerIndNumber of gaChromosomes per gaIndividual
genePerChrNumber of gaGenes per gaChromosome

References aver, chrPerInd, genePerChr, nChild, and pParent.

MTKpp::gaAverage::~gaAverage ( ) [virtual]

gaAverage destructor


Member Function Documentation

bool MTKpp::gaAverage::average ( gaIndividual ind1,
gaIndividual ind2,
gaPopulation pop,
std::string  name 
)
bool MTKpp::gaAverage::__singleGene ( gaIndividual newInd,
gaIndividual parent 
) [protected]

Single gene averaging.

Parameters:
newIndFirst gaIndividual
parentSecond gaIndividual

References chrPerInd, genePerChr, MTKpp::ranNumBetweenZeroAndOne(), and MTKpp::gaIndividual::setGene().

Referenced by average().

bool MTKpp::gaAverage::__multipleGene ( gaIndividual newInd,
gaIndividual parent 
) [protected]

Multiple gene averaging.

Parameters:
newIndFirst gaIndividual
parentSecond gaIndividual

Member Data Documentation

gaOperator pointer

Referenced by gaAverage().

int MTKpp::gaAverage::nChild [private]

Number of offspring produced by each pair of parents.

Referenced by average(), and gaAverage().

std::string MTKpp::gaAverage::aver [private]

Type of Averaging to be carried out.

Referenced by average(), and gaAverage().

Number of gaChromsomes per gaIndividual.

Referenced by __singleGene(), average(), and gaAverage().

std::vector<int> MTKpp::gaAverage::genePerChr [private]

Number of gaGenes per gaChromsome.

Referenced by __singleGene(), average(), and gaAverage().


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

Generated on Fri Dec 23 2011 09:28:55 for MTK++ by Doxygen 1.7.5.1