Function PGABinaryGeneDistance
Defined in File binary.c
Function Documentation
-
double PGABinaryGeneDistance(PGAContext *ctx, int p1, int pop1, int p2, int pop2)
Compute genetic difference of two strings.
Description
For binary genes this is the Hamming distance. It is used in the default setting of the
PGA_USERFUNCTION_GEN_DISTANCE
user function for the binary data type. Internal function. Use the gene distance user functionPGAUserFunctionGeneDistance()
.- 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