Last change
on this file since 816 was
816,
checked in by liveletlive, 16 years ago
|
Committing the newer version of PGAPack.
|
File size:
850 bytes
|
Line | |
---|
1 | .TH PGAGetSortedPopIndex 8 "05/01/95" " " "PGAPack" |
---|
2 | .SH NAME |
---|
3 | PGAGetSortedPopIndex \- returns a population string index from the array |
---|
4 | created by PGASortPop(). |
---|
5 | .SH INPUT PARAMETERS |
---|
6 | .PD 0 |
---|
7 | .TP |
---|
8 | ctx |
---|
9 | - context variable |
---|
10 | .PD 0 |
---|
11 | .TP |
---|
12 | n |
---|
13 | - specified which index element is to be returned. |
---|
14 | .PD 1 |
---|
15 | .SH OUTPUT PARAMETERS |
---|
16 | .PD 0 |
---|
17 | .TP |
---|
18 | none |
---|
19 | |
---|
20 | .PD 1 |
---|
21 | .SH SYNOPSIS |
---|
22 | .nf |
---|
23 | #include "pgapack.h" |
---|
24 | int PGAGetSortedPopIndex(ctx, n) |
---|
25 | PGAContext *ctx |
---|
26 | int n |
---|
27 | .fi |
---|
28 | .SH LOCATION |
---|
29 | pop.c |
---|
30 | .SH EXAMPLE |
---|
31 | .nf |
---|
32 | Example: |
---|
33 | Copy the five best strings from the old population into the new |
---|
34 | population. The rest of the new population will be created by |
---|
35 | recombination, and is not shown. |
---|
36 | |
---|
37 | PGAContext *ctx; |
---|
38 | int i,j; |
---|
39 | : |
---|
40 | PGASetPopReplaceType(ctx,PGA_POPREPL_BEST) |
---|
41 | PGASortPop(ctx, PGA_OLDPOP); |
---|
42 | for ( i=0; i < 5; i++) { |
---|
43 | j = PGAGetSortedPopIndex(ctx, i); |
---|
44 | PGACopyIndividual (ctx, j, PGA_OLDPOP, i, PGA_NEWPOP); |
---|
45 | : |
---|
46 | |
---|
47 | .fi |
---|
Note: See
TracBrowser
for help on using the repository browser.