Function PGAFitnessLinearRank

Function Documentation

static void PGAFitnessLinearRank(PGAContext *ctx, int popindex)

Calculate fitness using linear ranking.

Description

The fitness function is of the form

\[\frac{1}{N} \cdot \left(\max - (\max-\min) * \frac{i-1}{N-1}\right)\]

where \(\min = 2-\max\) and \(1 \le \max \le 2\). See Baker [Bak87], Bäck and Hoffmeister [BH91], Grefenstette and Baker [GB89] and Whitley’s linear function on p. 121 in [Whi89].

Parameters
  • ctx – context variable

  • popindex – population index to calculate fitness for

Returns

Calculates the fitness for each string in the population via side effect