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

# PGASetCrossoverProb(3)

Probability that a selected string will undergo crossover.

## NAME

PGASetCrossoverProb - Probability that a selected string will undergo crossover.

## DESCRIPTION

The default is 0.85.

## INPUT PARAMETERS

- ctx

  \- context variable

- p

  \- the crossover probability

## OUTPUT PARAMETERS

- none

  ## SYNOPSIS

```
#include "pgapack.h"
void  PGASetCrossoverProb(ctx, crossover_prob)
PGAContext *ctx
double crossover_prob
```

## LOCATION

cross.c

## EXAMPLE

```
Example:
Make crossover happen infrequently.
PGAContext *ctx;
:
PGASetCrossoverProb(ctx,0.001);
```
