GeneticAlgorithm Class Reference

#include <GeneticAlgorithm.h>

Inheritance diagram for GeneticAlgorithm:

GeneticAlgorithm_MPI

List of all members.

Public Member Functions

 GeneticAlgorithm (Gene *G, Fitness *F, const unsigned int &PopSize, glotzmath::RandomNumberGenerator *RG)
 GeneticAlgorithm (Gene **G, Fitness *F, const unsigned int &PopSize, const unsigned int &TopToKeep, const unsigned int &BottomToDrop, const double &MutationRate, glotzmath::RandomNumberGenerator *RG)
 GeneticAlgorithm (Gene **G, Fitness *F, const unsigned int &PopSize, const unsigned int &TopToKeep, const unsigned int &BottomToDrop, glotzmath::RandomNumberGenerator *RG)
 GeneticAlgorithm (std::ifstream &Input, Fitness *F, glotzmath::RandomNumberGenerator *RG)
bool Run (const unsigned int &NumSteps)
void ChangeGene (const unsigned int &Index, Gene *G)
double GetAverageFitness ()
double GetBestFitness ()
unsigned int GetPopSize () const
GeneGetCopyOfGeneAtLocation (const unsigned int &Loc) const
void PrintGenes ()
void PrintGenes_Divisible ()
void EvaluateAllFitness_External (GeneticAlgorithm *RHS, const bool &StepTaken)
virtual bool EvaluateAllFitness (Gene **G, double *FA, const unsigned int PS)
GeneGetGene () const
void SaveGAToFile (std::ofstream &Output) const
 ~GeneticAlgorithm ()

Protected Member Functions

void StochasticUniversalSampling ()
void TruncationSelection ()
void MakeFitnessNeedUpdating ()
void TakeStep ()
bool DoesFitnessNeedUpdating () const

Private Member Functions

void Breeding (const unsigned int &TopSkipped, const unsigned int &MaxSelected, Gene **TempGenesArray)
void Mutation (Gene **TempGenesArray)
double CalcMutationRate (const unsigned int &PopSize, const unsigned int &EffectiveLength)
void EvaluateAllFitness ()
void SelectionSort (unsigned int SortedList[])

Private Attributes

RandomNumberGenerator * MyRandGen
unsigned int MyTopToKeep
unsigned int MyBottomToDrop
double MyMutationRate
unsigned int CurrentStep
unsigned int MyPopSize
double * FitnessArray
Gene ** MyGenesArray
GeneMyGene
FitnessMyFitness
bool FitnessNeedsMeasuring


Constructor & Destructor Documentation

GeneticAlgorithm::GeneticAlgorithm ( Gene G,
Fitness F,
const unsigned int &  PopSize,
glotzmath::RandomNumberGenerator RG 
)

GeneticAlgorithm::GeneticAlgorithm ( Gene **  G,
Fitness F,
const unsigned int &  PopSize,
const unsigned int &  TopToKeep,
const unsigned int &  BottomToDrop,
const double &  MutationRate,
glotzmath::RandomNumberGenerator RG 
)

GeneticAlgorithm::GeneticAlgorithm ( Gene **  G,
Fitness F,
const unsigned int &  PopSize,
const unsigned int &  TopToKeep,
const unsigned int &  BottomToDrop,
glotzmath::RandomNumberGenerator RG 
)

GeneticAlgorithm::GeneticAlgorithm ( std::ifstream &  Input,
Fitness F,
glotzmath::RandomNumberGenerator RG 
)

GeneticAlgorithm::~GeneticAlgorithm (  ) 


Member Function Documentation

bool GeneticAlgorithm::Run ( const unsigned int &  NumSteps  ) 

Reimplemented in GeneticAlgorithm_MPI.

void GeneticAlgorithm::ChangeGene ( const unsigned int &  Index,
Gene G 
)

double GeneticAlgorithm::GetAverageFitness (  ) 

Reimplemented in GeneticAlgorithm_MPI.

double GeneticAlgorithm::GetBestFitness (  ) 

Reimplemented in GeneticAlgorithm_MPI.

unsigned int GeneticAlgorithm::GetPopSize (  )  const

Gene * GeneticAlgorithm::GetCopyOfGeneAtLocation ( const unsigned int &  Loc  )  const

void GeneticAlgorithm::PrintGenes (  ) 

Reimplemented in GeneticAlgorithm_MPI.

void GeneticAlgorithm::PrintGenes_Divisible (  ) 

Reimplemented in GeneticAlgorithm_MPI.

void GeneticAlgorithm::EvaluateAllFitness_External ( GeneticAlgorithm RHS,
const bool &  StepTaken 
)

bool GeneticAlgorithm::EvaluateAllFitness ( Gene **  G,
double *  FA,
const unsigned int  PS 
) [virtual]

Reimplemented in GeneticAlgorithm_MPI.

Gene * GeneticAlgorithm::GetGene (  )  const

void GeneticAlgorithm::SaveGAToFile ( std::ofstream &  Output  )  const

Reimplemented in GeneticAlgorithm_MPI.

void GeneticAlgorithm::StochasticUniversalSampling (  )  [protected]

void GeneticAlgorithm::TruncationSelection (  )  [protected]

void GeneticAlgorithm::MakeFitnessNeedUpdating (  )  [protected]

void GeneticAlgorithm::TakeStep (  )  [protected]

bool GeneticAlgorithm::DoesFitnessNeedUpdating (  )  const [protected]

void GeneticAlgorithm::Breeding ( const unsigned int &  TopSkipped,
const unsigned int &  MaxSelected,
Gene **  TempGenesArray 
) [private]

void GeneticAlgorithm::Mutation ( Gene **  TempGenesArray  )  [private]

double GeneticAlgorithm::CalcMutationRate ( const unsigned int &  PopSize,
const unsigned int &  EffectiveLength 
) [private]

void GeneticAlgorithm::EvaluateAllFitness (  )  [private]

void GeneticAlgorithm::SelectionSort ( unsigned int  SortedList[]  )  [private]


Member Data Documentation

RandomNumberGenerator* GeneticAlgorithm::MyRandGen [private]

unsigned int GeneticAlgorithm::MyTopToKeep [private]

unsigned int GeneticAlgorithm::MyBottomToDrop [private]

double GeneticAlgorithm::MyMutationRate [private]

unsigned int GeneticAlgorithm::CurrentStep [private]

unsigned int GeneticAlgorithm::MyPopSize [private]

double* GeneticAlgorithm::FitnessArray [private]

Gene** GeneticAlgorithm::MyGenesArray [private]

Gene* GeneticAlgorithm::MyGene [private]

Fitness* GeneticAlgorithm::MyFitness [private]

Reimplemented in GeneticAlgorithm_MPI.

bool GeneticAlgorithm::FitnessNeedsMeasuring [private]


The documentation for this class was generated from the following files:
Generated on Tue Feb 24 20:53:08 2009 by  doxygen 1.5.3