Function PGAUserFunctionGeneDistance

Function Documentation

static inline double PGAUserFunctionGeneDistance(PGAContext *ctx, int p1, int pop1, int p2, int pop2)

Call the genetic distance user function.

Description

Call the genetic distance user function. This calls the data-type specific user function for computing the genetic distance. For user-defined data types you need to register a genetic distance user function with PGASetUserFunction() with the constant PGA_USERFUNCTION_GEN_DISTANCE.

Parameters
  • ctx – context variable

  • p1 – first string index

  • pop1 – symbolic constant of the population the first string is in

  • p2 – second string index

  • pop2 – symbolic constant of the population the second string is in

Returns

Genetic distance of the two strings