Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

Population Class Reference

Contains a pool of possible solutions for GA. More...

#include <population.h>

Inheritance diagram for Population:

Serializable List of all members.

Public Methods

Chromosome choose ()
void NextGeneration ()
virtual void Serialize (FILE *f)
virtual void Deserialize (FILE *f)
void fillRandom ()
 Population (char *filename)
float CalculateDiversity ()
int CalculateDiversityCount ()
int CalculateDiversityElitCount ()
float CalculateDiversityElit ()
float Distance (int i, int j)
int DistanceCount (int i, int j)

Public Attributes

int POP_SIZE
int T_SIZE
int ELIT_SIZE
int NPARAMS
float P_MUT
int N_MUT
float M_MUT
float P_CROSS
Chromosomepop

Detailed Description

Contains a pool of possible solutions for GA.

This class contains a pool of possible solutions used in Genetic Algorithm. Actually two populations are held in the class. These two populations are used in selection procedure. At an instant only one of them is active and this active one is visible to the user of the class.

Author:
Onur Soysal
Version:
0.1


Constructor & Destructor Documentation

Population::Population char *    filename
 

this constructor constructs the population from file rather than filling randomly.


Member Function Documentation

float Population::CalculateDiversity  
 

Calculate Diversity among whole population This function assumes that node number for each gene is same.

int Population::CalculateDiversityCount  
 

Calculate Diversity count among whole population This function assumes that node number for each gene is same

float Population::CalculateDiversityElit  
 

Calculate Diversity among elit individuals This function assumes that node number for each gene is same

int Population::CalculateDiversityElitCount  
 

Calculate Diversity count among Elit individuals This function assumes that node number for each gene is same

Chromosome Population::choose  
 

chooses an individual from population according to tournament selection. The algorithm used is as below:

  • Choose a random individual 'best'
  • for T_SIZE items
    • Choose a random individual 'a'
    • if fitness of 'a' is bigger than 'best'
      let 'best' be 'a'
  • return 'best'
Returns:
the choosen chromosome.

float Population::Distance int    i,
int    j
 

Calculate the Euclidean distance between two chromosomes with index 'i' and 'j' in population array

int Population::DistanceCount int    i,
int    j
 

Calculate the number of different weights/thresholds/parameters between two chromosomes with index 'i' and 'j' in population array

void Population::fillRandom  
 

Fills the population with random values

void Population::NextGeneration  
 

One iteration of Genetic Algorithm. This iteration includes

  • Calculation of fitness of current population
  • selection of individuals using choose
  • application of mutation and cross-over operations on individuals
See also:
choose


Member Data Documentation

int Population::ELIT_SIZE
 

Size of elite

float Population::M_MUT
 

maximum magnitude of mutations

int Population::N_MUT
 

number of mutations to perform

int Population::NPARAMS
 

number of parameters to be used

float Population::P_CROSS
 

probability of cross over

float Population::P_MUT
 

probability of mutation

Chromosome* Population::pop
 

active population

int Population::POP_SIZE
 

Size of population

int Population::T_SIZE
 

Size of tournament


The documentation for this class was generated from the following file:
Generated on Thu Feb 12 18:42:57 2004 for ParallelizedEvolutionSystem by doxygen1.2.18