#include <population.h>
Inheritance diagram for Population:
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 
Chromosome *  pop 
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.

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

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

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

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

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

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


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

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

Fills the population with random values 

One iteration of Genetic Algorithm. This iteration includes


Size of elite 

maximum magnitude of mutations 

number of mutations to perform 

number of parameters to be used 

probability of cross over 

probability of mutation 

active population 

Size of population 

Size of tournament 