.TH PGARank 1 "05/01/95" " " "PGAPack" .SH NAME PGARank \- returns the rank of a string in a population. .SH DESCRIPTION This is a value between 1,...,N (the population size). The most fit string has rank 1, the least fit string has rank N. .SH INPUT PARAMETERS .PD 0 .TP ctx - context variable .PD 0 .TP p - the index of the string whose rank is desired .PD 0 .TP order - an array containing a unique rank for each string .PD 0 .TP n - the size of the array order .PD 1 .SH OUTPUT PARAMETERS .PD 0 .TP none .PD 1 .SH SYNOPSIS .nf #include "pgapack.h" int PGARank(ctx, p, order, n) PGAContext *ctx int p int *order int n .fi .SH LOCATION fitness.c .SH EXAMPLE .nf Example: Determine the rank of string p. PGAContext *ctx; int i, popsize, rank, *order; double *fitness; popsize = PGAGetPopsize(ctx); order = (int *) malloc(sizeof(int) * popsize); fitness = (double *)malloc(sizeof(double) * popsize); for(i=0;i