Function PGARun

Function Documentation

void PGARun(PGAContext *ctx, double (*evaluate)(PGAContext *c, int p, int pop, double*))

Highest level routine to execute the genetic algorithm.

Description

It is called after PGACreate() and PGASetup() have been called.

Example

PGAContext *ctx;
double f (PGAContext *ctx, int p, int pop, double *aux);

ctx = PGACreate (&argc, argv, PGA_DATATYPE_BINARY, 100, PGA_MAXIMIZE);
PGASetUp (ctx);
PGARun (ctx, f);
PGADestroy (ctx);

Parameters
  • ctx – context variable

  • evaluate – a pointer to the user’s evaluation function, which must have the calling sequence shown in the example

Returns

None