.TH PGAGetSortPop l "05/01/95" " " "PGAPack"
.SH NAME
PGAGetSortPop \- returns an index from the array created by PGASortPop
.SH INPUT PARAMETERS
.PD 0
.TP
ctx
- context variable
.PD 0
.TP
n
- specified which index element is to be returned.
.PD 1
.SH OUTPUT PARAMETERS
.PD 0
.TP
none

.PD 1
.SH SYNOPSIS
.nf
#include "pgapack.h"
int  PGAGetSortPop(ctx, n)
PGAContext *ctx
int n
.fi
.SH LOCATION
heap.c
.SH EXAMPLE
.nf
Example:
The following code copies the five best strings from the old
population into the new one (the rest of the new population will
be created by recombination

PGAContext *ctx;
int i,j;
:
PGASetPopReplacement(ctx,PGA_POPREPL_BEST)
PGASortPop(ctx, PGA_OLDPOP);
for ( i=0; i < 5; i++) {
j = PGAGetSortPop(ctx, i);
PGACopyIndividual (ctx, j, PGA_OLDPOP, i, PGA_NEWPOP);

.fi
