#include <BB2004Calibrator.h>
Inheritance diagram for CalibrationIndividual:
Public Member Functions | |
CalibrationIndividual () | |
virtual void | init (const BBIndividual &initial) |
virtual void | interpolate (const BBIndividual &other) |
virtual void | extrapolate (const BBIndividual &other) |
virtual void | mutate () |
virtual double | getFitness () const |
void | setFitness (double fitness) |
void | select () const |
void | dump () const |
Private Types | |
numOfGenes = 7 | |
enum | { numOfGenes = 7 } |
Private Attributes | |
double | genes [numOfGenes] |
double | fitness |
Static Private Attributes | |
static double | geneScale [numOfGenes] |
Definition at line 30 of file BB2004Calibrator.h.
anonymous enum [private] |
Definition at line 33 of file BB2004Calibrator.h.
CalibrationIndividual::CalibrationIndividual | ( | ) | [inline] |
void CalibrationIndividual::dump | ( | ) | const |
The function prints the genes.
Definition at line 75 of file BB2004Calibrator.cpp.
References OutMessage::finishMessage(), genes, getDebugOut(), idText, numOfGenes, and text.
Referenced by BB2004Calibrator::evolve().
void CalibrationIndividual::extrapolate | ( | const BBIndividual & | other | ) | [virtual] |
The function extrapolates between the current individual and another one.
other | The other individual the current one is extrapolated with. |
Implements BBIndividual.
Definition at line 47 of file BB2004Calibrator.cpp.
References fitness, genes, numOfGenes, and random().
virtual double CalibrationIndividual::getFitness | ( | ) | const [inline, virtual] |
The function returns the fitness of the individual.
Implements BBIndividual.
Definition at line 75 of file BB2004Calibrator.h.
References fitness.
Referenced by BB2004Calibrator::evolve().
void CalibrationIndividual::init | ( | const BBIndividual & | initial | ) | [virtual] |
The function initializes the current individual with another one.
initial | The other individual the current one is initialized with. |
Implements BBIndividual.
Definition at line 20 of file BB2004Calibrator.cpp.
References fitness, genes, getRobotConfiguration(), and mutate().
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.
other | The other individual the current one is interpolated with. |
Implements BBIndividual.
Definition at line 28 of file BB2004Calibrator.cpp.
References fitness, genes, numOfGenes, and random().
void CalibrationIndividual::mutate | ( | ) | [virtual] |
The function mutates the current individual.
Implements BBIndividual.
Definition at line 41 of file BB2004Calibrator.cpp.
References genes, numOfGenes, and random().
Referenced by init().
void CalibrationIndividual::select | ( | ) | const |
The function copies the genes into the calibration parameters.
Definition at line 63 of file BB2004Calibrator.cpp.
References genes, getRobotConfiguration(), RobotCalibration::panFactor, RobotConfiguration::setRobotCalibration(), RobotCalibration::tilt2Factor, and RobotCalibration::tiltFactor.
void CalibrationIndividual::setFitness | ( | double | fitness | ) | [inline] |
The function sets the fitness of the individual.
fitness | The fitness. |
Definition at line 81 of file BB2004Calibrator.h.
double CalibrationIndividual::fitness [private] |
The fitness of this individual.
Definition at line 39 of file BB2004Calibrator.h.
Referenced by CalibrationIndividual(), extrapolate(), getFitness(), init(), and interpolate().
double CalibrationIndividual::genes[numOfGenes] [private] |
The genes.
Definition at line 38 of file BB2004Calibrator.h.
Referenced by dump(), extrapolate(), init(), interpolate(), mutate(), and select().
double CalibrationIndividual::geneScale[numOfGenes] [static, private] |
An array that estimates the range of value of a certain gene.
Definition at line 37 of file BB2004Calibrator.h.