Function PGAEvalSort
Defined in File utility.c
Function Documentation
-
void PGAEvalSort(PGAContext *ctx, int pop, int *idx)
Sort list of population indeces by evaluation.
Description
Note that the given list
idx
of indeces need not be initialized. It just has to have the correct size of course. Think of this as sorting individuals by “better” evaluation or increasing constraint violations. The best individals are sorted first.Example
PGAContext *ctx; int indexes [ctx->ga.PopSize]; ... PGAEvalSort (ctx, PGA_OLDPOP, indexes);
- Parameters:
ctx – context variable
pop – symbolic constant of population to sort
idx – Array of integer indeces into population pop
- Returns:
Array idx sorted by evalation