GPLIB++
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
gplib::GeneralPopulation Class Reference

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

#include <GeneralPopulation.h>

Inheritance diagram for gplib::GeneralPopulation:
Inheritance graph
[legend]

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. More...
 
virtual GeneralPopulationoperator= (const GeneralPopulation &source)
 
virtual ~GeneralPopulation ()
 

Protected Member Functions

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

Protected Attributes

tpopulation Population
 The population of the current iteration. More...
 

Detailed Description

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

Definition at line 13 of file GeneralPopulation.h.

Constructor & Destructor Documentation

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

Definition at line 6 of file GeneralPopulation.cpp.

gplib::GeneralPopulation::GeneralPopulation ( GeneralPopulation Old)

Definition at line 17 of file GeneralPopulation.cpp.

gplib::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.

gplib::GeneralPopulation::~GeneralPopulation ( )
virtual

Definition at line 13 of file GeneralPopulation.cpp.

Member Function Documentation

const tcrowddistv& gplib::GeneralPopulation::GetCrowdingDistances ( ) const
inline

Definition at line 62 of file GeneralPopulation.h.

int gplib::GeneralPopulation::GetGenesize ( ) const
inline

Definition at line 89 of file GeneralPopulation.h.

References Population.

const tpopulation& gplib::GeneralPopulation::GetOldPopulation ( ) const
inline

Definition at line 34 of file GeneralPopulation.h.

int gplib::GeneralPopulation::GetPopsize ( ) const
inline
const tpopulation& gplib::GeneralPopulation::GetPopulation ( ) const
inline

Definition at line 52 of file GeneralPopulation.h.

References Population.

Referenced by gplib::StandardPropagation::NextGeneration().

const tprobabilityv& gplib::GeneralPopulation::GetProbabilities ( ) const
inline

Definition at line 57 of file GeneralPopulation.h.

Referenced by gplib::AnnealingGA::GetBestIndex().

virtual void gplib::GeneralPopulation::InitPop ( )
inlinevirtual

Reimplemented in gplib::BinaryPopulation.

Definition at line 30 of file GeneralPopulation.h.

GeneralPopulation & gplib::GeneralPopulation::operator= ( const GeneralPopulation source)
virtual

Definition at line 41 of file GeneralPopulation.cpp.

References Population.

Referenced by gplib::BinaryPopulation::operator=().

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

Definition at line 100 of file GeneralPopulation.cpp.

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

Definition at line 54 of file GeneralPopulation.cpp.

References Population.

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

Definition at line 91 of file GeneralPopulation.cpp.

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

Definition at line 75 of file GeneralPopulation.cpp.

References Population, and ResizePop().

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

Change the population size.

Definition at line 67 of file GeneralPopulation.cpp.

References Population.

Referenced by ReadPopulation().

void gplib::GeneralPopulation::SetCrowdingDistances ( const tcrowddistv LocalDist)
inline

Definition at line 79 of file GeneralPopulation.h.

void gplib::GeneralPopulation::SetPopulation ( const tpopulation LocalPop)
inline

Definition at line 67 of file GeneralPopulation.h.

References Population.

Referenced by gplib::StandardPropagation::NextGeneration().

void gplib::GeneralPopulation::SetProbabilities ( const tprobabilityv LocalProb)
inline
void gplib::GeneralPopulation::StoreOldPopulation ( )
inline

Definition at line 42 of file GeneralPopulation.h.

References Population.

Referenced by gplib::GeneralGA::DoIteration().

Member Data Documentation

tpopulation gplib::GeneralPopulation::Population
protected

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