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

Initalizes the given values in the instance.

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.
maxN_CasesOfNaNorInfinityToIgnore Specifies how many times a fitness function, with different variable cases, can be an invalid number, but still the genotype 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 return always 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 93 of file FitnessFunction.cs.

GEP .NET Framwork Main Page
SourceForge.net Logo