GEP::Core::Float::FitnessFunctions::FitnessFunction::FitnessFunction ( int  teachingVariableCasesStartIndex,
int  teachingVariableCasesEndIndex,
int  testVariableCasesStartIndex,
int  testVariableCasesEndIndex,
float  expectedOutput[][],
int  maxN_CasesOfNaNorInfinityToIgnore 
) [inline]

Parameters:
teachingVariableCasesStartIndex Indicates from what index teaching / learning cases start. From these cases fitness and subsequent mating probability is formed. All variables must have an equal number of cases.
teachingVariableCasesEndIndex Indicates the last index of testing cases. After the population has been evolving on the basis of teaching / learning variable cases, the behavior of the genotype can be tested on data it has not seen. All variables must have an equal number of cases.
testVariableCasesStartIndex Indicates from what index testing cases start. After the population has been evolving on the basis of teaching / learning variable cases, the behavior of the genotype can be tested on data it has not seen. All variables must have an equal number of cases.
testVariableCasesEndIndex Indicates the last index of testing cases. After the population has been evolving on the basis of teaching / learning variable cases, the behavior of the genotype can be tested on data it has not seen. All variables must have an equal number of cases.
expectedOutput The output expected for each variable case. This is an array of variable cases. With every variable case different output of a Genotype is generated. This the output that a genotype should produce on the learning set.
maxN_CasesOfNaNorInfinityToIgnore Specifies on how many variable cases a genotype, while evaluating fitness, can return an invalid number, but still be considered fit.

Let's say somewhere in the genotype the expression [1 / (v1 - v2)] occurs. As long sa v1 and v2 have different values the expression will be defined. But it may happen that on some variable case v1 be equal to v2. So there will be division by 0, which will return "not a number". If there are 300 teaching variable cases and on only 2, 3 of them the genotype returns NaN or ininity, this does not mean it is unfit.

Now let's consider another expression, [1 / (v1 - v1)]. Obviously this expression will return NaN always. Genotype having it in its structure will always return NaN. So it is obviously unfit.

It is left up to the one formulating the problem to decide what is the maximum number of cases a genotype can return NaN or infinity. After that the genotype is considered unfit.

Definition at line 62 of file FitnessFunction.cs.

GEP .NET Framwork Main Page
SourceForge.net Logo