#include <Individual.h>
Inheritance diagram for Individual:
Public Types | |
typedef enum Individual::ValueType | ValueType |
valueInt | |
valueDouble | |
value2PiDouble | |
enum | ValueType { valueInt, valueDouble, value2PiDouble } |
Public Member Functions | |
Individual () | |
virtual void | getDimension (int &dim1, int &dim2)=0 |
virtual void | getValue (int index1, int index2, double &min, double &max, double &value, ValueType &type)=0 |
virtual void | setValue (int index1, int index2, double value)=0 |
void | mutationOf (Individual *father, double rate, double amount, bool uniformNoise=false) |
void | crossingOverOf (Individual *father, Individual *mother) |
Public Attributes | |
double | fitness |
Definition at line 19 of file Individual.h.
typedef enum Individual::ValueType Individual::ValueType |
Individual::Individual | ( | ) |
Constructor.
Definition at line 14 of file Individual.cpp.
void Individual::crossingOverOf | ( | Individual * | father, | |
Individual * | mother | |||
) |
let this Individual be the crossing over of father and mother even genes are taken from father, uneven from mother
father | Take this as original father to copy one half of the genes from | |
mother | Take this as original mother to copy one half of the genes from |
Definition at line 65 of file Individual.cpp.
References fitness, getDimension(), getValue(), random(), setValue(), and val.
virtual void Individual::getDimension | ( | int & | dim1, | |
int & | dim2 | |||
) | [pure virtual] |
Implemented in GT2004Parameters, and InvKinWalkingParameters.
Referenced by crossingOverOf(), and mutationOf().
virtual void Individual::getValue | ( | int | index1, | |
int | index2, | |||
double & | min, | |||
double & | max, | |||
double & | value, | |||
ValueType & | type | |||
) | [pure virtual] |
Referenced by crossingOverOf(), and mutationOf().
void Individual::mutationOf | ( | Individual * | father, | |
double | rate, | |||
double | amount, | |||
bool | uniformNoise = false | |||
) |
let this Individual be the mutation of another one: maximum rate of the genes are mutated by maximum amount of (max-min)
father | Take this as original to copy from before mutation | |
rate | Do mutate with this maximum rate, 0.0...1.0 is useful, 0.5 would mutate up to every second gene | |
amount | Do mutate single genes at maximum amount*(maxValue-minValue) | |
uniformNoise | Do mutate with uniform distributed noise if true, with normal distributed otherwise |
Definition at line 18 of file Individual.cpp.
References fitness, getDimension(), getValue(), log(), max, min, pi, pi2, random(), setValue(), val, value2PiDouble, valueDouble, and valueInt.
Referenced by GT2004BasicBehaviorEvolveOmniParameters::GT2004BasicBehaviorEvolveOmniParameters(), and CInvKinParametersDlgBar::OnButtonMutate().
virtual void Individual::setValue | ( | int | index1, | |
int | index2, | |||
double | value | |||
) | [pure virtual] |
Implemented in GT2004Parameters, and InvKinWalkingParameters.
Referenced by crossingOverOf(), and mutationOf().
double Individual::fitness |
Definition at line 47 of file Individual.h.
Referenced by crossingOverOf(), GT2004BasicBehaviorEvolveOmniParameters::execute(), GT2004Parameters::GT2004Parameters(), InvKinWalkingParameters::InvKinWalkingParameters(), mutationOf(), CInvKinParametersDlgBar::OnWalkParamStop(), CInvKinParametersDlgBar::setSpeed(), and CInvKinParametersDlgBar::WriteLogFile().