Function PGAIntegerCreateString

Function Documentation

void PGAIntegerCreateString(PGAContext *ctx, int p, int pop, int initflag)

Allocate memory for a string of type PGAInteger, and initializes or clears the string according to initflag.

Description

Note that this function is set in PGASetUp() as the create string user function for the integer datatype.

Example

Allocates and clears memory and assigns the address of the allocated memory to the string field ind->chrom of the individual.

PGAContext *ctx;
PGAIndividual *ind;

...
PGAIntegerCreateString (ctx, ind, PGA_FALSE);

Parameters
  • ctx – context variable

  • p – string index

  • pop – symbolic constant of the population string p is in

  • initflag – A true/false flag used in conjunction with ctx->ga.RandomInit to initialize the string either randomly or set to zero

Returns

None