PGASetRealInitRange(3)

PGASetRealInitRange3

Sets the upper and lower bounds for randomly initializing real-valued genes. for each gene these bounds define an interval from which the initial allele value is selected uniformly randomly. the user specifies two arrays containing lower and bound for each gene to define the interval. this is the default strategy for initializing real-valued strings. the default interval is $[0,1.0]$ for each gene.

Usage

#include "pgapack.h"
void  PGASetRealInitRange(ctx, min, max)
PGAContext *ctx
double *min
double *max

Input parameters

ctx

- context variable

min

- array containing the lower bound of the interval for each gene

mac

- array containing the upper bound of the interval for each gene

Output parameters

none

Location

real.c

Examples

Set the initialization routines to select a value for each real-valued
gene i uniformly randomly from the interval [-10.,i]
Assumes all strings are of the same length.
PGAContext *ctx;
double *low, *high;
int i, stringlen;
:
stringlen = PGAGetStringLength(ctx);
low  = (double *) malloc(stringlen*sizeof(double));
high = (double *) malloc(stringlen*sizeof(double));
for(i=0;i<stringlen;i++) {
low[i]  = -10.0;
high[i] = i;
}
PGASetRealInitRange(ctx, low, high);

Releases

8 releases since Debian 1.1 (Buzz); the text changed 1 time.

  1. 1.1
  2. 1.2–3.1

From pgapack 1.0.0.1-3 in Debian 3.1 (Sarge). Parsed by carta from the page's man source.