genetiK::Population Class Reference
[Common GenetiK framework]

Population is a collection of Individual objects. More...

#include <Population.h>

Collaboration diagram for genetiK::Population:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Population (unsigned int size)
 creates a new Population able to hold size Individuals
virtual ~Population (void)
 destroys this population and the Idividual objects it contains
unsigned int getSize () const
 retrieves the size of the population
Individual ** getIndividuals ()
 retrieves the Individual collection
IndividualgetBest ()
 retrieves the Individual having highest fitness in the Population
void sort (bool ascending=true)
 sort individuals by fitness

Detailed Description

Population is a collection of Individual objects.

The Population class represents a single generation of Individuals in a given stage of the execution of an EvolutionaryAlgorithm

See also:
Individual


Constructor & Destructor Documentation

genetiK::Population::~Population void   )  [virtual]
 

destroys this population and the Idividual objects it contains

See also:
Individual::~Individual(void);


Member Function Documentation

Individual * genetiK::Population::getBest  ) 
 

retrieves the Individual having highest fitness in the Population

Returns:
the best Individual
See also:
Individual::fitness()

Individual** genetiK::Population::getIndividuals  )  [inline]
 

retrieves the Individual collection

Deprecated:
This method should be changed soon
Returns:
all the Individual objects

unsigned int genetiK::Population::getSize  )  const [inline]
 

retrieves the size of the population

Returns:
the size

void genetiK::Population::sort bool  ascending = true  ) 
 

sort individuals by fitness

Sorts the Individuals in this Population by fitness, in ascending or descending order

Parameters:
ascending specifies if sorting is ascending or not
See also:
fitness


The documentation for this class was generated from the following files:
Generated on Thu Feb 23 12:21:59 2006 for GenetiK by  doxygen 1.4.6