BBInvKinIndividual Class Reference

#include <BB2004InvKinWalkingEngine.h>

Inheritance diagram for BBInvKinIndividual:

BBIndividual List of all members.

Public Member Functions

 BBInvKinIndividual ()
 BBInvKinIndividual (const InvKinWalkingParameters &parameters)
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
double getSpeed () const
double getSmoothness () const
void setWalkCharacteristics (double speed, double smoothness)
void getParameters (InvKinWalkingParameters &parameters) const
void dump () const

Private Types

 numOfGenes = 27
enum  { numOfGenes = 27 }

Private Attributes

double genes [numOfGenes]
double fitness
double speed
double smoothness

Static Private Attributes

static double geneScale [numOfGenes]

Detailed Description

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

Definition at line 22 of file BB2004InvKinWalkingEngine.h.


Member Enumeration Documentation

anonymous enum [private]

Enumerator:
numOfGenes  The number of genes of the individual.

Definition at line 25 of file BB2004InvKinWalkingEngine.h.


Constructor & Destructor Documentation

BBInvKinIndividual::BBInvKinIndividual (  )  [inline]

Constructor.

Definition at line 39 of file BB2004InvKinWalkingEngine.h.

References fitness.

BBInvKinIndividual::BBInvKinIndividual ( const InvKinWalkingParameters parameters  ) 

Constructor.

Parameters:
parameters The parameters that copied into the genes.

Definition at line 84 of file BB2004InvKinWalkingEngine.cpp.

References ASSERT, InvKinWalkingParameters::bodyShiftOffset, InvKinWalkingParameters::bodyShiftX, InvKinWalkingParameters::bodyShiftY, InvKinWalkingParameters::foreCenterX, InvKinWalkingParameters::foreFootLift, InvKinWalkingParameters::foreFootTilt, InvKinWalkingParameters::foreHeight, InvKinWalkingParameters::foreWidth, genes, InvKinWalkingParameters::groundPhase, InvKinWalkingParameters::hindCenterX, InvKinWalkingParameters::hindFootLift, InvKinWalkingParameters::hindFootTilt, InvKinWalkingParameters::hindHeight, InvKinWalkingParameters::hindWidth, InvKinWalkingParameters::legPhase, InvKinWalkingParameters::legSpeedFactorR, InvKinWalkingParameters::legSpeedFactorX, InvKinWalkingParameters::legSpeedFactorY, InvKinWalkingParameters::liftPhase, InvKinWalkingParameters::loweringPhase, InvKinWalkingParameters::maxStepSizeX, InvKinWalkingParameters::maxStepSizeY, numOfGenes, and InvKinWalkingParameters::stepLen.


Member Function Documentation

void BBInvKinIndividual::dump (  )  const

The function prints the genes.

Definition at line 177 of file BB2004InvKinWalkingEngine.cpp.

References OutMessage::finishMessage(), getDebugOut(), OutMemory::getLength(), getParameters(), idText, and OutMessage::text.

Referenced by BB2004InvKinWalkingEngine::learn().

void BBInvKinIndividual::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 61 of file BB2004InvKinWalkingEngine.cpp.

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

virtual double BBInvKinIndividual::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 75 of file BB2004InvKinWalkingEngine.h.

References fitness.

Referenced by BB2004InvKinWalkingEngine::learn().

void BBInvKinIndividual::getParameters ( InvKinWalkingParameters parameters  )  const

The function copies the genes into walking parameters.

Parameters:
parameters The parameters the genes are copied to.

Definition at line 127 of file BB2004InvKinWalkingEngine.cpp.

References ASSERT, InvKinWalkingParameters::bodyShiftOffset, InvKinWalkingParameters::bodyShiftX, InvKinWalkingParameters::bodyShiftY, InvKinWalkingParameters::counterRotation, InvKinWalkingParameters::footMode, InvKinWalkingParameters::foreCenterX, InvKinWalkingParameters::foreFootLift, InvKinWalkingParameters::foreFootTilt, InvKinWalkingParameters::foreHeight, InvKinWalkingParameters::foreWidth, genes, InvKinWalkingParameters::groundPhase, InvKinWalkingParameters::halfCircle, InvKinWalkingParameters::hindCenterX, InvKinWalkingParameters::hindFootLift, InvKinWalkingParameters::hindFootTilt, InvKinWalkingParameters::hindHeight, InvKinWalkingParameters::hindWidth, int(), InvKinWalkingParameters::legPhase, InvKinWalkingParameters::legSpeedFactorR, InvKinWalkingParameters::legSpeedFactorX, InvKinWalkingParameters::legSpeedFactorY, InvKinWalkingParameters::liftPhase, InvKinWalkingParameters::loweringPhase, InvKinWalkingParameters::maxStepSizeX, InvKinWalkingParameters::maxStepSizeY, numOfGenes, and InvKinWalkingParameters::stepLen.

Referenced by dump(), and BB2004InvKinWalkingEngine::learn().

double BBInvKinIndividual::getSmoothness (  )  const [inline]

The function returns the smoothness of the walk of the individual.

Returns:
The smoothness.

Definition at line 87 of file BB2004InvKinWalkingEngine.h.

References smoothness.

Referenced by BB2004InvKinWalkingEngine::learn().

double BBInvKinIndividual::getSpeed (  )  const [inline]

The function returns the speed of the walk of the individual.

Returns:
The speed.

Definition at line 81 of file BB2004InvKinWalkingEngine.h.

References speed.

Referenced by BB2004InvKinWalkingEngine::learn().

void BBInvKinIndividual::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 34 of file BB2004InvKinWalkingEngine.cpp.

References ASSERT, fitness, geneScale, mutate(), and numOfGenes.

void BBInvKinIndividual::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 42 of file BB2004InvKinWalkingEngine.cpp.

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

void BBInvKinIndividual::mutate (  )  [virtual]

The function mutates the current individual.

Implements BBIndividual.

Definition at line 55 of file BB2004InvKinWalkingEngine.cpp.

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

Referenced by init().

void BBInvKinIndividual::setWalkCharacteristics ( double  speed,
double  smoothness 
)

The function sets the speed and the smoothness of the walk using the individual.

Parameters:
speed The speed.
smoothness The smoothness.

Definition at line 77 of file BB2004InvKinWalkingEngine.cpp.

References fitness.

Referenced by BB2004InvKinWalkingEngine::learn().


Member Data Documentation

double BBInvKinIndividual::fitness [private]

The fitness of this individual.

Definition at line 31 of file BB2004InvKinWalkingEngine.h.

Referenced by BBInvKinIndividual(), extrapolate(), getFitness(), init(), interpolate(), and setWalkCharacteristics().

double BBInvKinIndividual::genes[numOfGenes] [private]

The genes.

Definition at line 30 of file BB2004InvKinWalkingEngine.h.

Referenced by BBInvKinIndividual(), extrapolate(), getParameters(), interpolate(), and mutate().

double BBInvKinIndividual::geneScale [static, private]

Initial value:

{
  200, 200, 200, 
  200, 200, 200,
  50, 50, 
  1, 1,
  1, 1, 1,
  50, 50,
  100,
  1, 1, 1, 
  1, 1, 1,
  0.5, 0.5,
  10, 10, 10
}
An array that estimates the range of value of a certain gene.

Definition at line 29 of file BB2004InvKinWalkingEngine.h.

Referenced by init(), and mutate().

double BBInvKinIndividual::smoothness [private]

The smooothness of the walk using this individual.

Definition at line 31 of file BB2004InvKinWalkingEngine.h.

Referenced by getSmoothness().

double BBInvKinIndividual::speed [private]

The speed of the walk using this individual.

Definition at line 31 of file BB2004InvKinWalkingEngine.h.

Referenced by getSpeed().


The documentation for this class was generated from the following files:
Generated on Thu Dec 7 01:19:12 2006 for DT2005.panorama by  doxygen 1.4.7