PGAFitness3
Maps the user's evaluation function value to a fitness value. first, the user's evaluation function value is translated to all positive values if any are negative. next, this positive sequence is translated to a maximization problem if the user's optimization direction was minimization. this positive sequence is then mapped to a fitness value using linear ranking, linear normalization fitness, or the identity (i.e., the evaluation function value). this routine is usually used after pgaevaluate is called.
Usage
void PGAFitness(ctx,
popindex)
PGAContext *ctx
int popindex
Input parameters
ctx
|
- context variable |
|---|---|
pop
|
- symbolic constant of the population to calculate fitness for |
Output parameters
- none
Location
fitness.c
Examples
Example: Calculate the fitness of all strings in population PGA_NEWPOP after calling PGAEvaluate to calculate the strings evaluation value. double energy(PGAContext *ctx, int p, int pop); PGAContext *ctx; : PGAEvaluate(ctx, PGA_NEWPOP, energy); PGAFitness (ctx, PGA_NEWPOP);
Releases
8 releases since Debian 1.1 (Buzz); the text changed 1 time.