GetFitness

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

GetFitness

Return to chapter overview

 

GetFitness(Population As Integer, Individual As Integer, Fitness As Single)

 

Purpose: This function returns the fitness of a specified individual.  Usually, this function is not needed since the user usually assigns the fitness.  However, the user may use this function for advanced or experimental operations with fitness.  As the ScaleFitness function changes fitness values, with the help of GetFitness the user can control actual fitness values applied by the genetic algorithm.

 

Note: The user should calculate the fitness of an individual. GetFitness only returns the value previously stored by the PutFitness function.

 

Arguments:

Population is the number of the population with which you are working.

Individual is the number of the individual whose fitness you want to return.  Individual numbers start with 0.

Fitness is a variable where the fitness value will be stored.

 

Example: i = GetFitness(PopNum, 3, FitVal)

 

This example stores the fitness of individual 3 of the population PopNum into the FitVal variable.

 

Related Functions: PutFitness