PGAGetSortedPopIndex(3)

PGAGetSortedPopIndex3

Returns a population string index from the array created by pgasortpop().

Part of PGAGetSortedPopIndex(8).

Usage

int PGAGetSortedPopIndex(ctx, n)

PGAContext *ctx

int n

Input parameters

ctx

- context variable

n

- specified which index element is to be returned.

Output parameters

none

Location

pop.c

Examples

Example:
Copy the five best strings from the old population into the new
population.  The rest of the new population will be created by
recombination, and is not shown.
PGAContext *ctx;
int i,j;
:
PGASetPopReplaceType(ctx,PGA_POPREPL_BEST)
PGASortPop(ctx, PGA_OLDPOP);
for ( i=0; i < 5; i++) {
j = PGAGetSortedPopIndex(ctx, i);
PGACopyIndividual (ctx, j, PGA_OLDPOP, i, PGA_NEWPOP);
:

Releases

8 releases since Debian 1.1 (Buzz); the text changed 1 time.

  1. 1.1
  2. 1.2–3.1

From pgapack 1.0.0.1-3 in Debian 3.1 (Sarge). Parsed by carta from the page's man source.