# exponentialRankWeights

> **exponentialRankWeights**(`scores`, `objective`): readonly `number`\[]

Defined in: [packages/evolution/src/selection.ts:108](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/evolution/src/selection.ts#L108)

Return exponential competition-rank weights aligned to the source scores.

Rank zero is best and receives weight `Math.exp(-rank)`, so a one-candidate population returns `[1]`. Equal scores share the rank of their first ordered position; the next distinct score’s rank includes every preceding candidate. Source index breaks sorting ties without changing tied weights. Very low-ranked weights may become zero only when `Math.exp(-rank)` underflows. The input is not mutated.

## Parameters

### scores

readonly `number`\[]

### objective

[`Objective`](/reference/knotkit/evolution/type-aliases/objective/)

## Returns

readonly `number`\[]

## Throws

With code `EMPTY_POPULATION` for no scores, `INVALID_SCORE` for a non-finite score, or `INVALID_OBJECTIVE` for an unsupported objective.
