Function PGACheckStoppingConditions

Function Documentation

int PGACheckStoppingConditions(PGAContext *ctx)

Return boolean to indicate if the configured PGAPack termination conditions have been met.

Description

The default termination conditions are given in Constants for Stopping Conditions and more details are found in section Stopping Criteria of the user guide.

Example

Useful in a user-defined function that is registered as a stopping condition function. We can use this to keep the builtin stopping conditions in addition to a user-defined condition.

int StopCond (PGAContext *ctx)
{
    if (my_stop_check (ctx)) {
        return PGA_TRUE;
    }
    return PGACheckStoppingConditions (ctx);
}

Parameters
  • ctx – context variable

Returns

return true if at least one of the termination conditions has been met