Function PGAGeneDistance

Function Documentation

double PGAGeneDistance(PGAContext *ctx, int pop)

Calculate the mean genetic distance for a population.

Description

This function has effort \(O(n^2)\) in the population size \(n\). It is very useful for detecting premature convergence and is used when genetic distance reporting has been turned on with PGA_REPORT_GENE_DISTANCE.

Example

PGAContext *ctx;
double gd;

...
gd = PGAGeneDistance (ctx, PGA_NEWPOP);

Parameters
  • ctx – context variable

  • pop – symbolic constant of the population for which the genetic distance is to be calculated

Returns

The mean genetic distance in the population