Function PGAGetBestReportIndex
Defined in File utility.c
Function Documentation
-
int PGAGetBestReportIndex(PGAContext *ctx, int pop, int idx)
Return the index of the string with the best evaluation function value in population pop for the given evaluation index.
Description
The evaluation function index must be 0 <
idx
<=NumAuxEval
. So for single evaluation only the index 0 is allowed and the return is the same as fromPGAGetBestIndex()
. Note that this accesses the pre-computed statistics and therefore onlyPGA_OLDPOP
is allowed for the population constant.Example
PGAContext *ctx; int best; ... best = PGAGetBestReportIndex (ctx, PGA_OLDPOP, 1);
- Parameters:
ctx – context variable
pop – symbolic constant of the population to find the best string in
idx – Index of the evaluation function, 0 for the one return by your evaluation function 1 .. NumAuxEval for the auxiliary evaluations
- Returns:
Index of the string with the best evaluation function value