PGASetUserFunction(8)

NAME
PGASetUserFunction - specifies the name of a user-written function to call to provide a specific GA capability (e.g., crossover, mutation, etc.). This function MUST be used when using a nonnative datatype and must be called once for each of PGA_USERFUNCTION_CREATESTRING, PGA_USERFUNCTION_MUTATION, PGA_USERFUNCTION_CROSSOVER, PGA_USERFUNCTION_WRITESTRING, PGA_USERFUNCTION_COPYSTRING, PGA_USERFUNCTION_DUPLICATE, PGA_USERFUNCTION_RANDOMIZE to specify string creation, mutation, crossover, writing, copying, duplicating, and random initializing, respectively. It MAY be called when using a native datatype to replace the built-in functions PGAPack has for that datatype (For example, if the Integer data type is used for a traveling salesperson problem, the user may want to provide their own custom cvrossover operator). See the user guide and the examples in

INPUT PARAMETERS
ctx - context variable
constant
    - symbolic constant .......
f   - name of the function to use

OUTPUT PARAMETERS
none

SYNOPSIS
#include "pgapack.h"
void  PGASetUserFunction(ctx, constant, f)
PGAContext *ctx
int constant
void *f

LOCATION
set.c

EXAMPLE
Example:
void MyRandomize(PGAContext *, void *);
PGAContext *ctx;
:
PGASetUserRandomize(ctx, PGA_USERFUNCTION_RANDOMIZE, MyRandomize);