Function PGASetNumDemes

Function Documentation

void PGASetNumDemes(PGAContext *ctx, int numdemes)

Set the number of demes to use in a neighborhood model GA.

Description

Currently must be the same as the number of processes in the default communicator. The default is one.

Example

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

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

Parameters
  • ctx – context variable

  • numdemes – number of demes

Returns

None