Function PGARealDuplicate
Defined in File real.c
Function Documentation
-
int PGARealDuplicate(PGAContext *ctx, int p1, int pop1, int p2, int pop2)
Returns true if real-valued string a is a duplicate of real-valued string b, else returns false.
Description
Note that this function is set in
PGASetUp()
as the duplicate checking user function for the real datatype by default.Example
Compare strings
x
withy
to see if they are duplicates.PGAContext *ctx; int x, y; ... if (PGARealDuplicate (ctx, x, PGA_OLDPOP, y, PGA_OLDPOP)) { printf ("strings are duplicates\n"); }
- Parameters:
ctx – context variable
p1 – string index of the first string to compare
pop1 – symbolic constant of the population string p1 is in
p2 – string index of the second string to compare
pop2 – symbolic constant of the population string p2 is in
- Returns:
Returns true/false if strings are duplicates