Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

CalibrationIndividual Class Reference

The class represents an individual for a set of walking parameters. More...

#include <BB2004Calibrator.h>

Inheritance diagram for CalibrationIndividual:

Inheritance graph
[legend]
Collaboration diagram for CalibrationIndividual:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CalibrationIndividual ()
 Constructor.

virtual void init (const BBIndividual &initial)
 The function initializes the current individual with another one.

virtual void interpolate (const BBIndividual &other)
 The function interpolates between the current individual and another one.

virtual void extrapolate (const BBIndividual &other)
 The function extrapolates between the current individual and another one.

virtual void mutate ()
 The function mutates the current individual.

virtual double getFitness () const
 The function returns the fitness of the individual.

void setFitness (double fitness)
 The function sets the fitness of the individual.

void select () const
 The function copies the genes into the calibration parameters.

void dump () const
 The function prints the genes.


Private Types

enum  { numOfGenes = 7 }

Private Attributes

double genes [numOfGenes]
 The genes.

double fitness
 The fitness of this individual.


Static Private Attributes

double geneScale [numOfGenes]
 An array that estimates the range of value of a certain gene.


Detailed Description

The class represents an individual for a set of walking parameters.

Definition at line 23 of file BB2004Calibrator.h.


Member Enumeration Documentation

anonymous enum [private]
 

Enumeration values:
numOfGenes  The number of genes of the individual.

Definition at line 26 of file BB2004Calibrator.h.


Constructor & Destructor Documentation

CalibrationIndividual::CalibrationIndividual  )  [inline]
 

Constructor.

Definition at line 38 of file BB2004Calibrator.h.


Member Function Documentation

void CalibrationIndividual::init const BBIndividual initial  )  [virtual]
 

The function initializes the current individual with another one.

Parameters:
initial The other individual the current one is initialized with.

Implements BBIndividual.

Definition at line 13 of file BB2004Calibrator.cpp.

References genes, getRobotConfiguration(), and mutate().

Here is the call graph for this function:

void CalibrationIndividual::interpolate const BBIndividual other  )  [virtual]
 

The function interpolates between the current individual and another one.

The result is stored in the current individual.

Parameters:
other The other individual the current one is interpolated with.

Implements BBIndividual.

Definition at line 21 of file BB2004Calibrator.cpp.

References fitness, genes, numOfGenes, and random().

Here is the call graph for this function:

void CalibrationIndividual::extrapolate const BBIndividual other  )  [virtual]
 

The function extrapolates between the current individual and another one.

Parameters:
other The other individual the current one is extrapolated with.

Implements BBIndividual.

Definition at line 40 of file BB2004Calibrator.cpp.

References fitness, genes, numOfGenes, and random().

Here is the call graph for this function:

void CalibrationIndividual::mutate  )  [virtual]
 

The function mutates the current individual.

Implements BBIndividual.

Definition at line 34 of file BB2004Calibrator.cpp.

References genes, numOfGenes, and random().

Referenced by init().

Here is the call graph for this function:

virtual double CalibrationIndividual::getFitness  )  const [inline, virtual]
 

The function returns the fitness of the individual.

Returns:
The fitness as a number >= 0. A higher result means a higher fitness.

Implements BBIndividual.

Definition at line 68 of file BB2004Calibrator.h.

Referenced by BB2004Calibrator::evolve().

void CalibrationIndividual::setFitness double  fitness  )  [inline]
 

The function sets the fitness of the individual.

Parameters:
fitness The fitness.

Definition at line 74 of file BB2004Calibrator.h.

void CalibrationIndividual::select  )  const
 

The function copies the genes into the calibration parameters.

Definition at line 56 of file BB2004Calibrator.cpp.

References genes, getRobotConfiguration(), RobotCalibration::panFactor, RobotConfiguration::setRobotCalibration(), RobotCalibration::tilt2Factor, and RobotCalibration::tiltFactor.

Here is the call graph for this function:

void CalibrationIndividual::dump  )  const
 

The function prints the genes.

Definition at line 68 of file BB2004Calibrator.cpp.

References OutMessage::finishMessage(), genes, getDebugOut(), idText, numOfGenes, and OutMessage::text.

Referenced by BB2004Calibrator::evolve().

Here is the call graph for this function:


Member Data Documentation

double CalibrationIndividual::geneScale[numOfGenes] [static, private]
 

An array that estimates the range of value of a certain gene.

Definition at line 30 of file BB2004Calibrator.h.

double CalibrationIndividual::genes[numOfGenes] [private]
 

The genes.

Definition at line 31 of file BB2004Calibrator.h.

Referenced by dump(), extrapolate(), init(), interpolate(), mutate(), and select().

double CalibrationIndividual::fitness [private]
 

The fitness of this individual.

Definition at line 32 of file BB2004Calibrator.h.

Referenced by extrapolate(), and interpolate().


The documentation for this class was generated from the following files:
Generated on Thu Sep 23 20:04:50 2004 for GT2004 by doxygen 1.3.6