Function PGASelectNextNAMIndex

Function Documentation

int PGASelectNextNAMIndex(PGAContext *ctx, int p1, int popix)

Return the index of next individual in internal array taking into account the genetic distance if negative assortative mating (NAM) is configured.

Description

Select the next index out of NAMWindow items that is genetically most distant from the first selected individual given in p1. Ties are broken by considering better evaluation.

Example

PGAContext *ctx;
int l;

...
l = PGASelectNextNAMIndex (ctx, PGA_OLDPOP);

Parameters
  • ctx – context variable

  • p1 – Index of first individual selected

  • popix – the population index, typically PGA_OLDPOP

Returns

A population index for the next selected creature taking NAM into account