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

# PGAGetFitness(3)

returns the fitness value for a string

## NAME

PGAGetFitness - returns the fitness value for a string

## INPUT PARAMETERS

- ctx

  \- context variable

- p

  \- string index

- pop

  \- symbolic constant of the population the string is in

## OUTPUT PARAMETERS

- none

  ## SYNOPSIS

```
#include "pgapack.h"
double  PGAGetFitness(ctx, p, pop)
PGAContext *ctx
int p
int pop
```

## LOCATION

fitness.c

## EXAMPLE

```
Example:
PGAContext *ctx;
int p;
double fit;
:
fit = PGAGetFitness(ctx, p, PGA_NEWPOP);
```
