realea::PopulationReal Class Reference
[Real Evolutionary Algorithms Common (Core classes)]

Stores the individuals (solutions). More...

#include <populationreal.h>

Collaboration diagram for realea::PopulationReal:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 PopulationReal (Random *random, unsigned int max, unsigned int pob)
virtual void reset (DomainRealPtr domain, int init=-1)
void removeWorses (void)
void random (void)
void sort (void)
tIndividualReal * getInd (unsigned int pos)
void replace (int pos, const tIndividualReal *ind)
void append (tIndividualReal *ind)
void change (unsigned int pos, const tChromosomeReal &sol, tFitness fitness)
void replace (unsigned pos, tIndividualRealPtr newind)
unsigned getBest (void)
tFitness getMedian (void)
tFitness getMean (void)
void getPercentils (double *percen, unsigned num)
vector< unsigned > getBests (unsigned num)
unsigned getWorst (void)
unsigned size (void)
unsigned ndim (void)
void eval (IEvalInd *fitness, unsigned newevals=-1)
void setObserver (PopulationObserver *observer)
virtual tIndividualReal * getInstance (tChromosomeReal &crom, tFitness fitness)
virtual tIndividualReal * getInstance (tChromosomeReal &crom)

Protected Member Functions

void notifyObservers (unsigned id)

Detailed Description

Stores the individuals (solutions).

Stores a group of individuals (its size m_minsize is fixed, but a temporal greater number m_aditionalsize is allowed)

Definition at line 44 of file populationreal.h.


Constructor & Destructor Documentation

PopulationReal::PopulationReal ( Random random,
unsigned int  max,
unsigned int  pob 
)

Constructor.

Parameters:
random generator of the population
max maximum population size.
pob normal population size.

Definition at line 37 of file populationreal.cc.


Member Function Documentation

void PopulationReal::append ( tIndividualReal *  ind  ) 

Append a new individual

Parameters:
ind new individual

Definition at line 264 of file populationreal.cc.

void PopulationReal::change ( unsigned int  pos,
const tChromosomeReal &  sol,
tFitness  fitness 
)

change the current position with individual sol

Definition at line 273 of file populationreal.cc.

void PopulationReal::eval ( IEvalInd fitness,
unsigned  newevals = -1 
)

The current new individuals are evaluated.

Parameters:
fitness Fitness class.
neweval maximum new evaluations (-1 not limit)

Definition at line 380 of file populationreal.cc.

unsigned PopulationReal::getBest ( void   ) 
Returns:
the position of best individual (by fitness)
See also:
getBests

Definition at line 279 of file populationreal.cc.

Here is the call graph for this function:

vector< unsigned > PopulationReal::getBests ( unsigned  num  ) 
Returns:
the positions of best individuals (by fitness)
Parameters:
num the number of best individuals to return. (if num == 1 it is equals that call to getBest)
See also:
getBest

Definition at line 329 of file populationreal.cc.

tIndividualReal * PopulationReal::getInd ( unsigned int  pos  ) 
Parameters:
pos the position
Returns:
the current individual in position pos

Definition at line 253 of file populationreal.cc.

tIndividualReal * PopulationReal::getInstance ( tChromosomeReal &  crom  )  [virtual]

get a new instance of a chromosome

Definition at line 112 of file populationreal.cc.

tIndividualReal * PopulationReal::getInstance ( tChromosomeReal &  crom,
tFitness  fitness 
) [virtual]

get a new instance of a chromosome

Definition at line 116 of file populationreal.cc.

tFitness PopulationReal::getMean ( void   ) 
Returns:
the mean of the population's fitness

Definition at line 441 of file populationreal.cc.

tFitness PopulationReal::getMedian ( void   ) 
Returns:
the Median of the population's fitness

Definition at line 454 of file populationreal.cc.

void PopulationReal::getPercentils ( double *  percen,
unsigned  num 
)

Obtain the difference percentiles (useful to test the behaviour population

Definition at line 470 of file populationreal.cc.

Here is the call graph for this function:

unsigned PopulationReal::getWorst ( void   ) 
Returns:
the position of worst individual (by fitness)

Definition at line 344 of file populationreal.cc.

Here is the call graph for this function:

unsigned PopulationReal::ndim ( void   ) 
Returns:
dimension of individuals

Definition at line 405 of file populationreal.cc.

void PopulationReal::notifyObservers ( unsigned  id  )  [protected]

Update the identifications of a specific individual

Parameters:
id individual id to notify

Definition at line 154 of file populationreal.cc.

void PopulationReal::random ( void   ) 

Orders randomly the individuals

Definition at line 232 of file populationreal.cc.

Here is the call graph for this function:

void PopulationReal::removeWorses ( void   ) 

Removes the (m_aditionalsize - m_minsize) worse individuals.

Definition at line 219 of file populationreal.cc.

Here is the call graph for this function:

void PopulationReal::replace ( unsigned  pos,
tIndividualRealPtr  newind 
)

Este método permite reemplazar un individuo de la población por un nuevo individuo

Definition at line 410 of file populationreal.cc.

Here is the call graph for this function:

void realea::PopulationReal::replace ( int  pos,
const tIndividualReal *  ind 
)

Replaces the current individual in position pos with new individual real

Parameters:
pos of the current individual to be removed (> 0 <= size())
ind new individual to be inserted
void PopulationReal::reset ( DomainRealPtr  domain,
int  init = -1 
) [virtual]

Reset the population size randomly.

Parameters:
domain domain of individuals.
init the begin position of individuals to be restarted. (init = -1 does not keep anyone. init == x keep the individual)

Definition at line 67 of file populationreal.cc.

Here is the call graph for this function:

void PopulationReal::setObserver ( PopulationObserver observer  ) 

add Observer

Definition at line 33 of file populationreal.cc.

unsigned PopulationReal::size ( void   ) 
Returns:
the actual size (ignoring individual)

Definition at line 397 of file populationreal.cc.

void PopulationReal::sort ( void   ) 

Sorts the individuals in function of its fitness

Definition at line 176 of file populationreal.cc.


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

Generated on Sun May 9 12:26:14 2010 for Realea by  doxygen 1.6.1