---
name: "PGASetMutationOrCrossoverFlag"
section: "3"
platform: "linux"
package: "pgapack"
version: "1.0.0.1-3"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/PGASetMutationOrCrossoverFlag/3"
---

# PGASetMutationOrCrossoverFlag(3)

A boolean flag to indicate if recombination uses exactly one of crossover or mutation on selected strings.

## NAME

PGASetMutationOrCrossoverFlag - A boolean flag to indicate if recombination uses exactly one of crossover or mutation on selected strings.

## INPUT PARAMETERS

- ctx

  \- context variable

- flag

  \- PGA\_TRUE (default) or PGA\_FALSE

## OUTPUT PARAMETERS

- none

  ## SYNOPSIS

```
#include "pgapack.h"
void  PGASetMutationOrCrossoverFlag(ctx, flag)
PGAContext *ctx
int flag
```

## LOCATION

pga.c

## EXAMPLE

```
Example:
Set the genetic algorithm to use mutation only when crossover is
not used.
PGAContext *ctx;
:
PGASetMutationOrCrossoverFlag(ctx,PGA_FALSE);
```
