GeneralPopulation Class Reference
[Genetic algorithm optimization]

The base class for the population of a genetic algorithm, implements storage and access functions. More...

#include <GeneralPopulation.h>

Inheritance diagram for GeneralPopulation:

Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual void InitPop ()
const tpopulationGetOldPopulation () const
void StoreOldPopulation ()
void PrintPopulation (std::ostream &output) const
void ReadPopulation (std::istream &input)
void PrintProbabilities (std::ostream &output) const
void PrintDistances (std::ostream &output) const
const tpopulationGetPopulation () const
const tprobabilityvGetProbabilities () const
const tcrowddistvGetCrowdingDistances () const
void SetPopulation (const tpopulation &LocalPop)
void SetProbabilities (const tprobabilityv &LocalProb)
void SetCrowdingDistances (const tcrowddistv &LocalDist)
int GetPopsize () const
int GetGenesize () const
 GeneralPopulation (const int popsize, const int genesize)
 GeneralPopulation (GeneralPopulation &Old)
 GeneralPopulation (const tpopulation &FirstHalf, const tpopulation &SecondHalf)
 Merge two populations in a new population object.
virtual GeneralPopulationoperator= (const GeneralPopulation &source)
virtual ~GeneralPopulation ()

Protected Member Functions

void ResizePop (const int popsize, const int genesize)
 Change the population size.

Protected Attributes

tpopulation Population
 The population of the current iteration.


Detailed Description

The base class for the population of a genetic algorithm, implements storage and access functions.

Definition at line 11 of file GeneralPopulation.h.


Constructor & Destructor Documentation

GeneralPopulation::GeneralPopulation ( const int  popsize,
const int  genesize 
)

Definition at line 4 of file GeneralPopulation.cpp.

GeneralPopulation::GeneralPopulation ( GeneralPopulation Old  ) 

Definition at line 15 of file GeneralPopulation.cpp.

References OldStored.

GeneralPopulation::GeneralPopulation ( const tpopulation FirstHalf,
const tpopulation SecondHalf 
)

Merge two populations in a new population object.

Definition at line 24 of file GeneralPopulation.cpp.

References Population.

GeneralPopulation::~GeneralPopulation (  )  [virtual]

Definition at line 12 of file GeneralPopulation.cpp.


Member Function Documentation

const tcrowddistv& GeneralPopulation::GetCrowdingDistances (  )  const [inline]

Definition at line 38 of file GeneralPopulation.h.

Referenced by main().

int GeneralPopulation::GetGenesize (  )  const [inline]

Definition at line 43 of file GeneralPopulation.h.

References Population.

Referenced by ParetoGA::Elitism().

const tpopulation& GeneralPopulation::GetOldPopulation (  )  const [inline]

Definition at line 28 of file GeneralPopulation.h.

Referenced by ParetoGA::Elitism().

int GeneralPopulation::GetPopsize (  )  const [inline]

Definition at line 42 of file GeneralPopulation.h.

References Population.

Referenced by ParetoGA::CalcProbabilities(), and ParetoGA::Elitism().

const tpopulation& GeneralPopulation::GetPopulation (  )  const [inline]

Definition at line 36 of file GeneralPopulation.h.

References Population.

Referenced by ParetoGA::Elitism(), and StandardPropagation::NextGeneration().

const tprobabilityv& GeneralPopulation::GetProbabilities (  )  const [inline]

Definition at line 37 of file GeneralPopulation.h.

Referenced by AnnealingGA::GetBestIndex(), and main().

virtual void GeneralPopulation::InitPop (  )  [inline, virtual]

Reimplemented in BinaryPopulation.

Definition at line 27 of file GeneralPopulation.h.

GeneralPopulation & GeneralPopulation::operator= ( const GeneralPopulation source  )  [virtual]

Definition at line 38 of file GeneralPopulation.cpp.

References CrowdingDistances, OldPopulation, Population, and Probabilities.

void GeneralPopulation::PrintDistances ( std::ostream &  output  )  const

Definition at line 96 of file GeneralPopulation.cpp.

void GeneralPopulation::PrintPopulation ( std::ostream &  output  )  const

Definition at line 50 of file GeneralPopulation.cpp.

References Population.

void GeneralPopulation::PrintProbabilities ( std::ostream &  output  )  const

Definition at line 87 of file GeneralPopulation.cpp.

void GeneralPopulation::ReadPopulation ( std::istream &  input  ) 

Definition at line 71 of file GeneralPopulation.cpp.

References Population, and ResizePop().

void GeneralPopulation::ResizePop ( const int  popsize,
const int  genesize 
) [protected]

Change the population size.

Definition at line 63 of file GeneralPopulation.cpp.

References Population.

Referenced by ReadPopulation().

void GeneralPopulation::SetCrowdingDistances ( const tcrowddistv LocalDist  )  [inline]

Definition at line 41 of file GeneralPopulation.h.

void GeneralPopulation::SetPopulation ( const tpopulation LocalPop  )  [inline]

Definition at line 39 of file GeneralPopulation.h.

References Population.

Referenced by ParetoGA::Elitism(), and StandardPropagation::NextGeneration().

void GeneralPopulation::SetProbabilities ( const tprobabilityv LocalProb  )  [inline]

Definition at line 40 of file GeneralPopulation.h.

Referenced by ParetoGA::CalcProbabilities().

void GeneralPopulation::StoreOldPopulation (  )  [inline]

Definition at line 31 of file GeneralPopulation.h.

References Population.

Referenced by GeneralGA::DoIteration().


Member Data Documentation


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

Generated on Tue Aug 4 16:04:19 2009 for GPLIB++ by  doxygen 1.5.8