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

BBInvKinIndividual Class Reference

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

#include <BB2004InvKinWalkingEngine.h>

Inheritance diagram for BBInvKinIndividual:

Inheritance graph
[legend]
Collaboration diagram for BBInvKinIndividual:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BBInvKinIndividual ()
 Constructor.

 BBInvKinIndividual (const InvKinWalkingParameters &parameters)
 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.

double getSpeed () const
 The function returns the speed of the walk of the individual.

double getSmoothness () const
 The function returns the smoothness of the walk of the individual.

void setWalkCharacteristics (double speed, double smoothness)
 The function sets the speed and the smoothness of the walk using the individual.

void getParameters (InvKinWalkingParameters &parameters) const
 The function copies the genes into walking parameters.

void dump () const
 The function prints the genes.


Private Types

enum  { numOfGenes = 27 }

Private Attributes

double genes [numOfGenes]
 The genes.

double fitness
 The fitness of this individual.

double speed
 The speed of the walk using this individual.

double smoothness
 The smooothness of the walk using 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 22 of file BB2004InvKinWalkingEngine.h.


Member Enumeration Documentation

anonymous enum [private]
 

Enumeration values:
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.

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, 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, and InvKinWalkingParameters::stepLen.


Member Function Documentation

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, geneScale, and mutate().

Here is the call graph for this function:

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, and random().

Here is the call graph for this function:

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, and random().

Here is the call graph for this function:

void BBInvKinIndividual::mutate  )  [virtual]
 

The function mutates the current individual.

Implements BBIndividual.

Definition at line 55 of file BB2004InvKinWalkingEngine.cpp.

References geneScale, and random().

Referenced by init().

Here is the call graph for this function:

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.

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.

Referenced by 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().

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.

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, 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, and InvKinWalkingParameters::stepLen.

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

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().

Here is the call graph for this function:


Member Data Documentation

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 19 of file BB2004InvKinWalkingEngine.cpp.

Referenced by init(), and mutate().

double BBInvKinIndividual::genes[numOfGenes] [private]
 

The genes.

Definition at line 30 of file BB2004InvKinWalkingEngine.h.

Referenced by extrapolate(), and interpolate().

double BBInvKinIndividual::fitness [private]
 

The fitness of this individual.

Definition at line 31 of file BB2004InvKinWalkingEngine.h.

Referenced by extrapolate(), and interpolate().

double BBInvKinIndividual::speed [private]
 

The speed of the walk using this individual.

Definition at line 31 of file BB2004InvKinWalkingEngine.h.

double BBInvKinIndividual::smoothness [private]
 

The smooothness of the walk using this individual.

Definition at line 31 of file BB2004InvKinWalkingEngine.h.

Referenced by getSmoothness().


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