#include <BB2004Evo.h>
Collaboration diagram for BBPopulation< T >:
Public Member Functions | |
BBPopulation (int size, const BBIndividual &initial) | |
Constructor. | |
~BBPopulation () | |
Destructor. | |
int | getSize () const |
The function returns the number of Individuals. | |
T & | operator[] (int index) |
The operator provides access to the individuals. | |
const T & | operator[] (int index) const |
The constant operator provides access to the individuals. | |
void | interpolate () |
The function evolves the population. | |
void | extrapolate () |
const BBIndividual & | getFittest () |
Statistics & | getStatistics () |
Private Member Functions | |
const T & | drawIndividual () |
The function draws an indiviual from the previous population. | |
void | updateFitness () |
The function updates the fitness of the whole population. | |
void | mutate () |
The function mutates the half of the population if a single individual was drawn too often. | |
Static Private Member Functions | |
double | random () |
The function provides random values. | |
Private Attributes | |
Statistics | statistics |
The object is used to do some statistics on drawing individuals. | |
T * | current |
The current set of individuals. | |
T * | old |
The previous set of individuals. | |
int | size |
The number of individuals in the population. | |
double * | fitness |
The fitnesses of the individuals. | |
double * | fitnessSum |
The accumulated fitnesses of the individuals. | |
double | overallFitness |
The sum of fitness in the current population. |
T | The class of the individuals. It has to be derived from class BBIndividual. |
Definition at line 143 of file BB2004Evo.h.
|
Constructor.
Definition at line 217 of file BB2004Evo.h. |
|
Destructor.
Definition at line 232 of file BB2004Evo.h. |
|
The function provides random values.
Definition at line 158 of file BB2004Evo.h. Referenced by BBPopulation< CalibrationIndividual >::drawIndividual(). |
|
The function draws an indiviual from the previous population. The probability of being drawn is based on the ratio of the individual fitness in relation to the overall fitness of the population.
Definition at line 166 of file BB2004Evo.h. Referenced by BBPopulation< CalibrationIndividual >::extrapolate(), and BBPopulation< CalibrationIndividual >::interpolate(). |
|
The function updates the fitness of the whole population. It also updates the overall fitness. Definition at line 187 of file BB2004Evo.h. Referenced by BBPopulation< CalibrationIndividual >::extrapolate(), BBPopulation< CalibrationIndividual >::getFittest(), and BBPopulation< CalibrationIndividual >::interpolate(). |
|
The function mutates the half of the population if a single individual was drawn too often.
Definition at line 201 of file BB2004Evo.h. Referenced by BBPopulation< CalibrationIndividual >::extrapolate(), and BBPopulation< CalibrationIndividual >::interpolate(). |
|
The function returns the number of Individuals.
Definition at line 244 of file BB2004Evo.h. |
|
The operator provides access to the individuals.
Definition at line 251 of file BB2004Evo.h. |
|
The constant operator provides access to the individuals.
Definition at line 258 of file BB2004Evo.h. |
|
The function evolves the population.
Definition at line 264 of file BB2004Evo.h. |
|
Definition at line 282 of file BB2004Evo.h. |
|
Definition at line 300 of file BB2004Evo.h. |
|
Definition at line 311 of file BB2004Evo.h. |
|
The object is used to do some statistics on drawing individuals.
Definition at line 146 of file BB2004Evo.h. |
|
The current set of individuals.
Definition at line 147 of file BB2004Evo.h. |
|
The previous set of individuals.
Definition at line 147 of file BB2004Evo.h. |
|
The number of individuals in the population.
Definition at line 149 of file BB2004Evo.h. |
|
The fitnesses of the individuals.
Definition at line 150 of file BB2004Evo.h. |
|
The accumulated fitnesses of the individuals.
Definition at line 151 of file BB2004Evo.h. |
|
The sum of fitness in the current population.
Definition at line 152 of file BB2004Evo.h. |