PGAEvaluate(2)

NAME
PGAEvaluate - Calls a user-specified function to return an evaluation of each string in the population. The user-specified function is only called if the string has been changed (e.g., by crossover or mutation) or the user has explicitly signaled the string's evaluation is out-of-date by a call to PGASetEvalUpToDate with argument PGAFALSE

INPUT PARAMETERS
ctx - context variable
pop - symbolic constant of the population to be evaluated
f   - a pointer to a function to evaluate a string. This function will be called once for each string in population pop that requires evaluation. This function must return a double (the evaluation function value) and must have an argument list of the exact form double f (PGAContext *c, int p, int pop)

OUTPUT PARAMETERS
none

SYNOPSIS
#include "pgapack.h"
void  PGAEvaluate(ctx, pop, )
PGAContext *ctx
int pop
double (*f)(PGAContext *c, int p, int pop)

LOCATION
fitness.c

EXAMPLE
Example:
To evaluate all string in population PGA_NEWPOP using the user-defined
evaluation function energy use
double energy ( PGAContext *ctx, int p, int pop);
PGAContext *ctx;
:
PGAEvaluate(ctx, PGA_NEWPOP, energy);