Function PGARealCreateString
Defined in File real.c
Function Documentation
-
void PGARealCreateString(PGAContext *ctx, int p, int pop, int initflag)
Allocate memory for a string of type real.
Description
Note that this function is set in
PGASetUp()as the create string user function for the real datatype by default. Parameterinitflagis used in conjunction withctx->ga.RandomInitto initialize the string either randomly or set to zero.Example
Allocates memory and assigns the address of the allocated memory to the real string field
ind->chromof the individual. Also, clears the string.PGAContext *ctx; int p; ... PGARealCreateString (ctx, p, PGA_NEWPOP, PGA_FALSE);
- Parameters:
ctx – context variable
p – string index
pop – symbolic constant of the population string p is in
initflag – A boolean flag to indicate random initialization
- Returns:
None