source: trunk/optimizer/src/pgapack/pgapack/man/man8/PGADuplicate.8 @ 816

Last change on this file since 816 was 816, checked in by liveletlive, 17 years ago

Committing the newer version of PGAPack.

File size: 1.3 KB
Line 
1.TH PGADuplicate 8 "05/01/95" " " "PGAPack"
2.SH NAME
3PGADuplicate \- determines if a specified string is a duplicate of one
4already in an existing population
5.SH INPUT PARAMETERS
6.PD 0
7.TP
8ctx
9- context variable
10.PD 0
11.TP
12p
13- string index
14.PD 0
15.TP
16pop1
17- symbolic constant of the population containing string p
18.PD 0
19.TP
20pop2
21- symbolic constant of the (possibly partial) population containing
22strings to compare string p against
23.PD 0
24.TP
25n
26- the number of strings in pop2 to compare string p against
27.PD 0
28.TP
29n
30-1)
31.PD 1
32.SH OUTPUT PARAMETERS
33.PD 0
34.TP
35none
36
37.PD 1
38.SH SYNOPSIS
39.nf
40#include "pgapack.h"
41int  PGADuplicate(ctx, p, pop1, pop2, n)
42PGAContext *ctx
43int p
44int pop1
45int pop2
46int n
47.fi
48.SH LOCATION
49duplcate.c
50.SH EXAMPLE
51.nf
520,...,n-1 in population pop2.  Otherwise returns PGA_FALSE
53
54Example:
55Change any string in PGA_NEWPOP that is an exact copy of a string
56in PGA_OLDPOP.
57
58PGAContext *ctx;
59int b, n;
60:
61n  = PGAGetPopsize(ctx);
62for (b=0; b<n; b++)
63if (PGADuplicate(ctx, b, PGA_NEWPOP, PGA_OLDPOP, n))
64PGAChange(ctx, b, PGA_NEWPOP);
65
66
67Check if the best string in population PGA_OLDPOP is a duplicate of any
68of the strings in the first half of population PGA_NEWPOP.
69
70PGAContext *ctx;
71int b, n;
72:
73b  = PGAGetBestIndex(ctx, PGA_OLDPOP);
74n  = PGAGetPopsize(ctx) / 2;
75if (PGADuplicate(ctx, b, PGA_OLDPOP, PGA_NEWPOP, n))
76printf("A duplicate!\n");
77
78.fi
Note: See TracBrowser for help on using the repository browser.