Function PGAGetSelectType

Function Documentation

int PGAGetSelectType(PGAContext *ctx)

Return the type of selection selected.

Example

PGAContext *ctx;
int selecttype;

...
selecttype = PGAGetSelectType (ctx);
switch (selecttype) {
case PGA_SELECT_PROPORTIONAL:
    printf ("Selection Type = PGA_SELECT_PROPORTIONAL\n");
    break;
case PGA_SELECT_SUS:
    printf ("Selection Type = PGA_SELECT_SUS\n");
    break;
case PGA_SELECT_TOURNAMENT:
    printf ("Selection Type = PGA_SELECT_TOURNAMENT\n");
    break;
case PGA_SELECT_PTOURNAMENT:
    printf ("Selection Type = PGA_SELECT_PTOURNAMENT\n");
    break;
case PGA_SELECT_TRUNCATION:
    printf ("Selection Type = PGA_SELECT_TRUNCATION\n");
    break;
}

Parameters
  • ctx – context variable

Returns

Return the integer corresponding to the symbolic constant used to specify the type of selection specified