Function PGABinaryDuplicate

Function Documentation

int PGABinaryDuplicate(PGAContext *ctx, int p1, int pop1, int p2, int pop2)

Return true if bit string a is a duplicate of bit string b, else returns false.

Description

Note that this function is set in PGASetUp() as the duplicate checking user function for the binary datatype by default.

Example

Compare bit string x with y and print a message if they are the same.

PGAContext *ctx;
int x, y;

...
if (PGABinaryDuplicate (ctx, x, PGA_NEWPOP, y, PGA_NEWPOP)) {
    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

Return true/false if strings are duplicates