PGAMutate3
This routine performs mutation on a string.
Usage
#include "pgapack.h" int PGAMutate(ctx, p, pop) PGAContext *ctx int p int pop
Overview
The type of mutation depends on the data type. Refer to the user guide for data-specific examples.
Input parameters
ctx
|
- context variable |
|---|---|
p
|
- index of string to mutate |
pop
|
- symbolic constant of the population containing p |
Output parameters
- none
Location
mutation.c
Examples
Example:
Mutate the best string in the population, until 10 or more mutations
have occured.
PGAContext *ctx;
int p, count = 0;
:
p = PGAGetBestIndex(ctx, PGA_NEWPOP);
while (count < 10) {
count += PGAMutate(ctx, p, PGA_NEWPOP);
}
Releases
12 releases since Debian 1.1 (Buzz); the text changed 1 time.