---
name: "PGASetStoppingRuleType"
section: "8"
platform: "linux"
package: "pgapack"
version: "1.1.1-3"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/PGASetStoppingRuleType"
---

# PGASetStoppingRuleType(8)

specify a stopping criterion.

## NAME

PGASetStoppingRuleType - specify a stopping criterion.

## DESCRIPTION

If called more than once the different stopping criterion are ORed together.  Valid choices are PGA\_STOP\_MAXITER, PGA\_STOP\_TOOSIMILAR, or PGA\_STOP\_NOCHANGE to specify iteration limit reached, population too similar, or no change in the best solution found in a given number of iterations, respectively. The default is to stop when a maximum iteration limit is reached (by default, 1000 iterations).

## INPUT PARAMETERS

- ctx

  \- context variable

- stoprule

  \- symbolic constant to specify stopping rule

## OUTPUT PARAMETERS

- none

  ## SYNOPSIS

```
#include "pgapack.h"
void  PGASetStoppingRuleType(ctx, stoprule)
PGAContext *ctx
int stoprule
```

## LOCATION

stop.c

## EXAMPLE

```
Example:
PGAContext *ctx;
:
PGASetStoppingRuleType(ctx, PGA_STOP_TOOSIMILAR);
```
