neat

neat/neat.adaptive.ts

ANNEAL_BASELINE_GENERATIONS

ANNEAL_PROGRESS_MAX

applyAdaptiveMutation

() => void

applyAncestorUniqAdaptive

() => void

applyComplexityBudget

() => void

Apply complexity budget scheduling to the evolving population.

This routine updates this.options.maxNodes (and optionally this.options.maxConns) according to a configured complexity budget strategy. Two modes are supported:

Internal state used/maintained on the this object:

The method is intended to be called on the NEAT engine instance with this bound appropriately (i.e. a NeatapticTS Neat-like object).

Returns: Updates this.options.maxNodes and possibly this.options.maxConns in-place; no value is returned.

applyMinimalCriterionAdaptive

() => void

Apply adaptive minimal criterion (MC) acceptance.

This method maintains an MC threshold used to decide whether an individual genome is considered acceptable. It adapts the threshold based on the proportion of the population that meets the current threshold, trying to converge to a target acceptance rate.

Behavior summary:

applyOperatorAdaptation

() => void

applyPhasedComplexity

() => void

Toggle phased complexity mode between 'complexify' and 'simplify'.

Phased complexity supports alternating periods where the algorithm is encouraged to grow (complexify) or shrink (simplify) network structures. This can help escape local minima or reduce bloat.

The current phase and its start generation are stored on this as _phase and _phaseStartGeneration so the state persists across generations.

Returns: Mutates this._phase and this._phaseStartGeneration.

DEFAULT_ADAPT_EVERY

DEFAULT_ANCESTOR_UNIQ_ADJUST

DEFAULT_ANCESTOR_UNIQ_COOLDOWN

DEFAULT_ANCESTOR_UNIQ_HIGH_THRESHOLD

DEFAULT_ANCESTOR_UNIQ_LOW_THRESHOLD

DEFAULT_INITIAL_MUTATION_RATE

DEFAULT_LINEAGE_PRESSURE_STRENGTH

DEFAULT_MAX_MUTATION_AMOUNT

DEFAULT_MAX_MUTATION_RATE

DEFAULT_MIN_MUTATION_AMOUNT

DEFAULT_MIN_MUTATION_RATE

DEFAULT_MUTATION_AMOUNT

DEFAULT_MUTATION_AMOUNT_SIGMA

DEFAULT_MUTATION_SIGMA

EXPLORE_LOW_DECREASE_MULTIPLIER

EXPLORE_LOW_INCREASE_MULTIPLIER

HALF_INDEX_DIVISOR

LINEAGE_PRESSURE_DECREASE_MULTIPLIER

LINEAGE_PRESSURE_INCREASE_MULTIPLIER

MUTATION_SIGMA_SCALE

MUTATION_STRATEGY_ANNEAL

MUTATION_STRATEGY_EXPLORE_LOW

MUTATION_STRATEGY_TWO_TIER

NeatLikeWithAdaptive

Minimal interface for NEAT instances with adaptive features. Exported for use in tests and type-safe function calls.

RNG_CENTER_OFFSET

RNG_SPREAD_MULTIPLIER

neat/neat.adaptive.utils.ts

adjustConnectionBudget

(engine: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.adaptive.utils").NeatLikeWithAdaptive, config: { enabled?: boolean | undefined; mode?: string | undefined; improvementWindow?: number | undefined; increaseFactor?: number | undefined; stagnationFactor?: number | undefined; maxNodesStart?: number | undefined; maxNodesEnd?: number | undefined; minNodes?: number | undefined; maxConnsStart?: number | undefined; maxConnsEnd?: number | undefined; horizon?: number | undefined; }, trends: { improvement: number; slope: number; }, factors: { increaseFactor: number; stagnationFactor: number; }, noveltyFactor: number, history: number[]) => void

Adjust connection budget based on trends and factors.

Parameters:

adjustNodeBudget

(engine: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.adaptive.utils").NeatLikeWithAdaptive, config: { enabled?: boolean | undefined; mode?: string | undefined; improvementWindow?: number | undefined; increaseFactor?: number | undefined; stagnationFactor?: number | undefined; maxNodesStart?: number | undefined; maxNodesEnd?: number | undefined; minNodes?: number | undefined; maxConnsStart?: number | undefined; maxConnsEnd?: number | undefined; horizon?: number | undefined; }, trends: { improvement: number; slope: number; }, factors: { increaseFactor: number; stagnationFactor: number; }, noveltyFactor: number, history: number[]) => void

Adjust node budget based on trends and factors.

Parameters:

ANNEAL_BASELINE_GENERATIONS

ANNEAL_PROGRESS_MAX

applyAdaptiveSchedule

(engine: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.adaptive.utils").NeatLikeWithAdaptive, config: { enabled?: boolean | undefined; mode?: string | undefined; improvementWindow?: number | undefined; increaseFactor?: number | undefined; stagnationFactor?: number | undefined; maxNodesStart?: number | undefined; maxNodesEnd?: number | undefined; minNodes?: number | undefined; maxConnsStart?: number | undefined; maxConnsEnd?: number | undefined; horizon?: number | undefined; }) => void

Apply adaptive complexity budget scheduling.

Parameters:

applyAnnealDelta

(baseDelta: number, settings: MutationSettings) => number

Apply annealing adjustments to a delta.

Parameters:

Returns: Adjusted delta.

applyComplexityBudgetSchedule

(engine: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.adaptive.utils").NeatLikeWithAdaptive, config: { enabled?: boolean | undefined; mode?: string | undefined; improvementWindow?: number | undefined; increaseFactor?: number | undefined; stagnationFactor?: number | undefined; maxNodesStart?: number | undefined; maxNodesEnd?: number | undefined; minNodes?: number | undefined; maxConnsStart?: number | undefined; maxConnsEnd?: number | undefined; horizon?: number | undefined; }) => void

Apply the complexity budget schedule for the configured mode.

Parameters:

applyEpsilonAdjustment

(engine: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.adaptive.utils").NeatLikeWithAdaptive, ancestorUniq: number, thresholds: { lowThreshold: number; highThreshold: number; }, adjustMagnitude: number) => void

Apply dominance-epsilon adjustments when configured.

Parameters:

applyExploreLowDelta

(baseDelta: number, genome: { [key: string]: unknown; score?: number | undefined; _mutRate?: number | null | undefined; _mutAmount?: number | null | undefined; }, bottomHalfSet: Set<{ [key: string]: unknown; score?: number | undefined; _mutRate?: number | null | undefined; _mutAmount?: number | null | undefined; }>) => number

Apply explore-low adjustments to a delta.

Parameters:

Returns: Adjusted delta.

applyLineagePressureAdjustment

(engine: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.adaptive.utils").NeatLikeWithAdaptive, ancestorUniq: number, thresholds: { lowThreshold: number; highThreshold: number; }) => void

Apply lineage pressure strength adjustments.

Parameters:

applyLinearSchedule

(engine: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.adaptive.utils").NeatLikeWithAdaptive, config: { enabled?: boolean | undefined; mode?: string | undefined; improvementWindow?: number | undefined; increaseFactor?: number | undefined; stagnationFactor?: number | undefined; maxNodesStart?: number | undefined; maxNodesEnd?: number | undefined; minNodes?: number | undefined; maxConnsStart?: number | undefined; maxConnsEnd?: number | undefined; horizon?: number | undefined; }) => void

Apply linear complexity budget scheduling.

Parameters:

applyMutationAmount

(genome: { [key: string]: unknown; score?: number | undefined; _mutRate?: number | null | undefined; _mutAmount?: number | null | undefined; }, settings: MutationSettings, randomSource: () => number, genomeIndex: number, topHalfSet: Set<{ [key: string]: unknown; score?: number | undefined; _mutRate?: number | null | undefined; _mutAmount?: number | null | undefined; }>, bottomHalfSet: Set<{ [key: string]: unknown; score?: number | undefined; _mutRate?: number | null | undefined; _mutAmount?: number | null | undefined; }>) => void

Apply mutation-amount adjustments to a genome.

Parameters:

applyMutationsToPopulation

(population: { [key: string]: unknown; score?: number | undefined; _mutRate?: number | null | undefined; _mutAmount?: number | null | undefined; }[], partitions: MutationPartitions, settings: MutationSettings, randomSource: () => number) => MutationOutcome

Apply mutation updates to the population.

Parameters:

Returns: Mutation outcome flags.

applyOperatorDecay

(stats: Map<string, { success: number; attempts: number; }>, entries: [string, { success: number; attempts: number; }][], decay: number) => void

Apply exponential decay to each operator statistic entry.

Parameters:

applyRejection

(engine: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.adaptive.utils").NeatLikeWithAdaptive, threshold: number) => void

Zero scores below the final threshold.

Parameters:

applyTwoTierAmountDelta

(baseDelta: number, genome: { [key: string]: unknown; score?: number | undefined; _mutRate?: number | null | undefined; _mutAmount?: number | null | undefined; }, genomeIndex: number, topHalfSet: Set<{ [key: string]: unknown; score?: number | undefined; _mutRate?: number | null | undefined; _mutAmount?: number | null | undefined; }>, bottomHalfSet: Set<{ [key: string]: unknown; score?: number | undefined; _mutRate?: number | null | undefined; _mutAmount?: number | null | undefined; }>) => number

Apply two-tier adjustments to amount delta.

Parameters:

Returns: Adjusted delta.

applyTwoTierDelta

(baseDelta: number, genome: { [key: string]: unknown; score?: number | undefined; _mutRate?: number | null | undefined; _mutAmount?: number | null | undefined; }, genomeIndex: number, topHalfSet: Set<{ [key: string]: unknown; score?: number | undefined; _mutRate?: number | null | undefined; _mutAmount?: number | null | undefined; }>, bottomHalfSet: Set<{ [key: string]: unknown; score?: number | undefined; _mutRate?: number | null | undefined; _mutAmount?: number | null | undefined; }>) => number

Apply two-tier adjustments to a delta.

Parameters:

Returns: Adjusted delta.

applyTwoTierFallback

(population: { [key: string]: unknown; score?: number | undefined; _mutRate?: number | null | undefined; _mutAmount?: number | null | undefined; }[], settings: MutationSettings) => void

Apply two-tier fallback balancing.

Parameters:

applyUniquenessAdjustment

(engine: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.adaptive.utils").NeatLikeWithAdaptive, config: { enabled?: boolean | undefined; cooldown?: number | undefined; lowThreshold?: number | undefined; highThreshold?: number | undefined; adjust?: number | undefined; mode?: string | undefined; }, ancestorUniq: number, thresholds: { lowThreshold: number; highThreshold: number; }, adjustMagnitude: number) => void

Apply an adjustment for the configured mode.

Parameters:

clampNodeBudget

(engine: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.adaptive.utils").NeatLikeWithAdaptive, config: { enabled?: boolean | undefined; mode?: string | undefined; improvementWindow?: number | undefined; increaseFactor?: number | undefined; stagnationFactor?: number | undefined; maxNodesStart?: number | undefined; maxNodesEnd?: number | undefined; minNodes?: number | undefined; maxConnsStart?: number | undefined; maxConnsEnd?: number | undefined; horizon?: number | undefined; }) => void

Clamp node budget to configured minimum.

Parameters:

clampValue

(value: number, min: number, max: number) => number

Clamp a value between min and max bounds.

Parameters:

Returns: Clamped value.

collectOperatorStatsEntries

(stats: Map<string, { success: number; attempts: number; }>) => [string, { success: number; attempts: number; }][]

Collect operator statistic entries for processing.

Parameters:

Returns: Array of operator stat entries.

collectScoredGenomes

(population: { [key: string]: unknown; score?: number | undefined; _mutRate?: number | null | undefined; _mutAmount?: number | null | undefined; }[]) => { [key: string]: unknown; score?: number | undefined; _mutRate?: number | null | undefined; _mutAmount?: number | null | undefined; }[]

Collect genomes with numeric scores.

Parameters:

Returns: Scored genomes.

collectScores

(engine: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.adaptive.utils").NeatLikeWithAdaptive) => number[]

Collect population scores into a snapshot array.

Parameters:

Returns: Array of scores (missing scores treated as 0).

computeAcceptance

(scores: number[], threshold: number) => number

Compute acceptance metrics for the current threshold.

Parameters:

Returns: Acceptance proportion.

computeAdjustmentFactors

(config: { enabled?: boolean | undefined; mode?: string | undefined; improvementWindow?: number | undefined; increaseFactor?: number | undefined; stagnationFactor?: number | undefined; maxNodesStart?: number | undefined; maxNodesEnd?: number | undefined; minNodes?: number | undefined; maxConnsStart?: number | undefined; maxConnsEnd?: number | undefined; horizon?: number | undefined; }, trends: { improvement: number; slope: number; }, history: number[]) => { increaseFactor: number; stagnationFactor: number; }

Compute adjustment factors for budget growth and decay.

Parameters:

Returns: Adjustment factors (increase and stagnation multipliers).

computeNoveltyFactor

(engine: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.adaptive.utils").NeatLikeWithAdaptive) => number

Compute novelty factor based on archive size.

Parameters:

Returns: Novelty multiplier (0.9 if archive small, 1.0 otherwise).

computeSlope

(history: number[]) => number

Compute linear regression slope using ordinary least squares.

Parameters:

Returns: OLS slope estimate.

computeTrends

(history: number[]) => { improvement: number; slope: number; }

Compute improvement and slope trends from score history.

Parameters:

Returns: Trend metrics (improvement and slope).

createRandomDelta

(sigmaBase: number, randomSource: () => number) => number

Create a signed random delta scaled by sigma.

Parameters:

Returns: Signed delta.

decayOperatorStat

(operatorStat: { success: number; attempts: number; }, decay: number) => { success: number; attempts: number; }

Apply decay to a single operator statistic record.

Parameters:

Returns: Decayed operator statistic record.

DEFAULT_ADAPT_EVERY

DEFAULT_ANCESTOR_UNIQ_ADJUST

DEFAULT_ANCESTOR_UNIQ_COOLDOWN

DEFAULT_ANCESTOR_UNIQ_HIGH_THRESHOLD

DEFAULT_ANCESTOR_UNIQ_LOW_THRESHOLD

DEFAULT_INITIAL_MUTATION_RATE

DEFAULT_LINEAGE_PRESSURE_STRENGTH

DEFAULT_MAX_MUTATION_AMOUNT

DEFAULT_MAX_MUTATION_RATE

DEFAULT_MIN_MUTATION_AMOUNT

DEFAULT_MIN_MUTATION_RATE

DEFAULT_MUTATION_AMOUNT

DEFAULT_MUTATION_AMOUNT_SIGMA

DEFAULT_MUTATION_SIGMA

ensureLineagePressureState

(engine: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.adaptive.utils").NeatLikeWithAdaptive) => { enabled?: boolean | undefined; mode?: string | undefined; strength?: number | undefined; }

Ensure lineage pressure state is available.

Parameters:

Returns: Lineage pressure configuration object.

EXPLORE_LOW_DECREASE_MULTIPLIER

EXPLORE_LOW_INCREASE_MULTIPLIER

extractAncestorUniqueness

(engine: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.adaptive.utils").NeatLikeWithAdaptive) => number | undefined

Extract the latest ancestor-uniqueness metric from telemetry.

Parameters:

Returns: Ancestor uniqueness value or undefined when missing.

HALF_INDEX_DIVISOR

initializeConnectionBudget

(engine: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.adaptive.utils").NeatLikeWithAdaptive, config: { enabled?: boolean | undefined; mode?: string | undefined; improvementWindow?: number | undefined; increaseFactor?: number | undefined; stagnationFactor?: number | undefined; maxNodesStart?: number | undefined; maxNodesEnd?: number | undefined; minNodes?: number | undefined; maxConnsStart?: number | undefined; maxConnsEnd?: number | undefined; horizon?: number | undefined; }) => void

Initialize connection budget if undefined.

Parameters:

initializeNodeBudget

(engine: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.adaptive.utils").NeatLikeWithAdaptive, config: { enabled?: boolean | undefined; mode?: string | undefined; improvementWindow?: number | undefined; increaseFactor?: number | undefined; stagnationFactor?: number | undefined; maxNodesStart?: number | undefined; maxNodesEnd?: number | undefined; minNodes?: number | undefined; maxConnsStart?: number | undefined; maxConnsEnd?: number | undefined; horizon?: number | undefined; }) => void

Initialize node budget if undefined.

Parameters:

initializePhaseState

(engine: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.adaptive.utils").NeatLikeWithAdaptive, config: { enabled?: boolean | undefined; phases?: { generation: number; maxNodes?: number | undefined; maxConns?: number | undefined; }[] | undefined; phaseLength?: number | undefined; initialPhase?: string | undefined; }) => void

Ensure phase state is initialized.

Parameters:

initializeThreshold

(engine: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.adaptive.utils").NeatLikeWithAdaptive, config: { enabled?: boolean | undefined; initialThreshold?: number | undefined; targetAcceptance?: number | undefined; adjustRate?: number | undefined; }) => void

Initialize MC threshold if missing.

Parameters:

isCooldownSatisfied

(engine: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.adaptive.utils").NeatLikeWithAdaptive, config: { enabled?: boolean | undefined; cooldown?: number | undefined; lowThreshold?: number | undefined; highThreshold?: number | undefined; adjust?: number | undefined; mode?: string | undefined; }) => boolean

Determine whether the cooldown window has elapsed.

Parameters:

Returns: True when adjustment is allowed.

LINEAGE_PRESSURE_DECREASE_MULTIPLIER

LINEAGE_PRESSURE_INCREASE_MULTIPLIER

MUTATION_SIGMA_SCALE

MUTATION_STRATEGY_ANNEAL

MUTATION_STRATEGY_EXPLORE_LOW

MUTATION_STRATEGY_TWO_TIER

NeatLikeWithAdaptive

Minimal interface for NEAT instances with adaptive features. Exported for use in tests and type-safe function calls.

normalizeSlope

(slope: number, initialScore: number) => number

Normalize slope magnitude relative to initial score.

Parameters:

Returns: Normalized slope clamped to [-2, 2].

recordAdjustment

(engine: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.adaptive.utils").NeatLikeWithAdaptive) => void

Record the generation when an adjustment is applied.

Parameters:

resolveAdjustmentMagnitude

(config: { enabled?: boolean | undefined; cooldown?: number | undefined; lowThreshold?: number | undefined; highThreshold?: number | undefined; adjust?: number | undefined; mode?: string | undefined; }) => number

Resolve adjustment magnitude for nudging controlled parameters.

Parameters:

Returns: Adjustment magnitude.

resolveAmountDelta

(settings: MutationSettings, randomSource: () => number, genome: { [key: string]: unknown; score?: number | undefined; _mutRate?: number | null | undefined; _mutAmount?: number | null | undefined; }, genomeIndex: number, topHalfSet: Set<{ [key: string]: unknown; score?: number | undefined; _mutRate?: number | null | undefined; _mutAmount?: number | null | undefined; }>, bottomHalfSet: Set<{ [key: string]: unknown; score?: number | undefined; _mutRate?: number | null | undefined; _mutAmount?: number | null | undefined; }>) => number

Resolve mutation-amount delta based on strategy.

Parameters:

Returns: Signed mutation amount delta.

resolveMutationSettings

(engine: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.adaptive.utils").NeatLikeWithAdaptive, config: { enabled?: boolean | undefined; learningRate?: number | undefined; min?: number | undefined; max?: number | undefined; adaptEvery?: number | undefined; sigma?: number | undefined; minRate?: number | undefined; maxRate?: number | undefined; strategy?: string | undefined; adaptAmount?: boolean | undefined; minAmount?: number | undefined; maxAmount?: number | undefined; initialRate?: number | undefined; amountSigma?: number | undefined; }) => MutationSettings

Resolve mutation settings derived from configuration and engine state.

Parameters:

Returns: Resolved mutation settings.

resolveNextPhase

(currentPhase: string) => string

Resolve next phase name.

Parameters:

Returns: Next phase label.

resolveOperatorDecay

(config: { enabled?: boolean | undefined; learningRate?: number | undefined; alpha?: number | undefined; decay?: number | undefined; }) => number

Resolve the decay factor for operator statistics.

Parameters:

Returns: Decay factor for exponential smoothing.

resolveRandomSource

(engine: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.adaptive.utils").NeatLikeWithAdaptive) => () => number

Resolve a random source that matches the legacy RNG usage.

Parameters:

Returns: Random number provider.

resolveRateDelta

(settings: MutationSettings, randomSource: () => number, genome: { [key: string]: unknown; score?: number | undefined; _mutRate?: number | null | undefined; _mutAmount?: number | null | undefined; }, genomeIndex: number, topHalfSet: Set<{ [key: string]: unknown; score?: number | undefined; _mutRate?: number | null | undefined; _mutAmount?: number | null | undefined; }>, bottomHalfSet: Set<{ [key: string]: unknown; score?: number | undefined; _mutRate?: number | null | undefined; _mutAmount?: number | null | undefined; }>) => number

Resolve mutation-rate delta based on strategy.

Parameters:

Returns: Signed mutation rate delta.

resolveTargetSettings

(config: { enabled?: boolean | undefined; initialThreshold?: number | undefined; targetAcceptance?: number | undefined; adjustRate?: number | undefined; }) => { targetAcceptance: number; adjustRate: number; }

Resolve target acceptance and adjust rate settings.

Parameters:

Returns: Target settings.

resolveUniquenessThresholds

(config: { enabled?: boolean | undefined; cooldown?: number | undefined; lowThreshold?: number | undefined; highThreshold?: number | undefined; adjust?: number | undefined; mode?: string | undefined; }) => { lowThreshold: number; highThreshold: number; }

Resolve thresholds for ancestor-uniqueness decisions.

Parameters:

Returns: Threshold bounds.

RNG_CENTER_OFFSET

RNG_SPREAD_MULTIPLIER

shouldAdaptThisGeneration

(generation: number, config: { enabled?: boolean | undefined; learningRate?: number | undefined; min?: number | undefined; max?: number | undefined; adaptEvery?: number | undefined; sigma?: number | undefined; minRate?: number | undefined; maxRate?: number | undefined; strategy?: string | undefined; adaptAmount?: boolean | undefined; minAmount?: number | undefined; maxAmount?: number | undefined; initialRate?: number | undefined; amountSigma?: number | undefined; }) => boolean

Check whether mutation adaptation should run this generation.

Parameters:

Returns: True if adaptation should run.

shouldApplyTwoTierFallback

(strategy: string, outcome: MutationOutcome) => boolean

Determine whether a two-tier fallback is needed.

Parameters:

Returns: True if fallback should run.

sortScoredGenomes

(scoredGenomes: { [key: string]: unknown; score?: number | undefined; _mutRate?: number | null | undefined; _mutAmount?: number | null | undefined; }[]) => { [key: string]: unknown; score?: number | undefined; _mutRate?: number | null | undefined; _mutAmount?: number | null | undefined; }[]

Sort scored genomes in ascending score order.

Parameters:

Returns: Sorted genomes.

splitScoredGenomes

(scoredGenomes: { [key: string]: unknown; score?: number | undefined; _mutRate?: number | null | undefined; _mutAmount?: number | null | undefined; }[]) => MutationPartitions

Split scored genomes into top and bottom halves.

Parameters:

Returns: Partitions used by strategy rules.

togglePhaseIfNeeded

(engine: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.adaptive.utils").NeatLikeWithAdaptive, config: { enabled?: boolean | undefined; phases?: { generation: number; maxNodes?: number | undefined; maxConns?: number | undefined; }[] | undefined; phaseLength?: number | undefined; initialPhase?: string | undefined; }) => void

Toggle phase if the current phase has exceeded its length.

Parameters:

updateScoreHistory

(engine: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.adaptive.utils").NeatLikeWithAdaptive, config: { enabled?: boolean | undefined; mode?: string | undefined; improvementWindow?: number | undefined; increaseFactor?: number | undefined; stagnationFactor?: number | undefined; maxNodesStart?: number | undefined; maxNodesEnd?: number | undefined; minNodes?: number | undefined; maxConnsStart?: number | undefined; maxConnsEnd?: number | undefined; horizon?: number | undefined; }) => number[]

Update rolling score history with current best score.

Parameters:

Returns: Rolling history array after update.

updateThreshold

(engine: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.adaptive.utils").NeatLikeWithAdaptive, acceptance: number, tuning: { targetAcceptance: number; adjustRate: number; }) => void

Update the MC threshold based on acceptance proportion.

Parameters:

neat/neat.compat.ts

_compatibilityDistance

(genomeA: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.compat.utils").GenomeLike, genomeB: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.compat.utils").GenomeLike) => number

_fallbackInnov

(connection: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.compat.utils").ConnectionLike) => number

neat/neat.compat.utils.ts

buildPairKey

(firstGenome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.compat.utils").GenomeLike, secondGenome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.compat.utils").GenomeLike) => string

Build a stable cache key for a genome pair.

Parameters:

Returns: Stable cache key in the form "minId|maxId".

compareInnovationLists

(firstList: [number, number][], secondList: [number, number][]) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.compat.utils").ComparisonMetrics

Compare two sorted innovation lists and derive comparison metrics.

Parameters:

Returns: Aggregated comparison metrics for distance computation.

ComparisonMetrics

Aggregated comparison metrics for compatibility calculations.

computeCompatibilityDistance

(neatContext: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.compat.utils").NeatLikeForCompat, metrics: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.compat.utils").ComparisonMetrics) => number

Compute the compatibility distance from comparison metrics.

Parameters:

Returns: Final compatibility distance for the genome pair.

ConnectionLike

Compatibility-distance helper utilities.

ensureGenerationCache

(neatContext: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.compat.utils").NeatLikeForCompat) => void

Ensure generation-scoped compatibility caches exist.

Parameters:

Returns: void

GenomeLike

Minimal genome shape used for compatibility distance calculations.

getDistanceCacheMap

(neatContext: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.compat.utils").NeatLikeForCompat) => Map<string, number>

Retrieve the generation-scoped cache map for pairwise distances.

Parameters:

Returns: Map storing cached distances for genome pairs this generation.

getSortedInnovationCache

(neatContext: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.compat.utils").NeatLikeForCompat, genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.compat.utils").GenomeLike) => [number, number][]

Retrieve or build a sorted innovation list for a genome.

Parameters:

Returns: Array of [innovationNumber, weight] sorted by innovationNumber.

NeatLikeForCompat

Minimal NEAT context required by compatibility helpers.

resolveMaxInnovation

(list: [number, number][]) => number

Resolve the highest innovation id from a sorted list.

Parameters:

Returns: Highest innovation id or 0 if list is empty.

neat/neat.constants.ts

EPSILON

EXTRA_CONNECTION_PROBABILITY

NORM_EPSILON

PROB_EPSILON

neat/neat.diversity.ts

computeDiversityStats

(population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.diversity.utils").GenomeWithMetrics[], compatibilityComputer: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.diversity.utils").CompatComputer) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.diversity.utils").DiversityStats | undefined

Compute diversity statistics for a NEAT population. This is a pure helper used by reporting and diagnostics. It intentionally samples pairwise computations to keep cost bounded for large populations.

Notes for documentation:

Parameters:

Returns: DiversityStats object with all computed aggregates, or undefined if input empty

DiversityStats

Diversity statistics returned by computeDiversityStats. Each field represents an aggregate metric for a NEAT population.

MAX_COMPATIBILITY_SAMPLE

MAX_LINEAGE_PAIR_SAMPLE

structuralEntropy

(graph: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default) => number

Compute the Shannon-style entropy of a network's out-degree distribution. This is a lightweight, approximate structural dispersion metric used to characterise how 'spread out' connections are across nodes.

Educational note: structural entropy here is simply H = -sum(p_i log p_i) over the normalized out-degree histogram. It does not measure information content of weights or dynamics, but provides a quick structural fingerprint.

neat/neat.diversity.utils.ts

arrayMean

(values: number[]) => number

Compute the arithmetic mean of a numeric array. Returns 0 for empty arrays.

Parameters:

Returns: Arithmetic mean of the values.

arrayVariance

(values: number[]) => number

Compute the variance (population variance) of a numeric array. Returns 0 for empty arrays. Uses arrayMean internally.

Parameters:

Returns: Population variance.

calculateDiversityStats

(population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.diversity.utils").GenomeWithMetrics[], compatibilityComputer: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.diversity.utils").CompatComputer) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.diversity.utils").DiversityStats | undefined

Compute diversity statistics for a NEAT population.

Parameters:

Returns: DiversityStats object with all computed aggregates, or undefined if input empty

calculateStructuralEntropy

(graph: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default) => number

Compute the Shannon-style entropy of a network's out-degree distribution.

Parameters:

Returns: Shannon-style entropy value.

CompatComputer

Minimal interface that provides a compatibility distance function. Implementors should expose a compatible signature with legacy NEAT code.

DiversityStats

Diversity statistics returned by computeDiversityStats. Each field represents an aggregate metric for a NEAT population.

GenomeWithMetrics

Minimal genome interface for diversity computations.

MAX_COMPATIBILITY_SAMPLE

MAX_LINEAGE_PAIR_SAMPLE

NodeWithConnections

Minimal node interface with connections.

neat/neat.evaluate.auto-distance.utils.ts

applyAutoDistanceCoefficientTuning

(controller: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").NeatControllerForEval, autoDistanceCoeffOptions: { enabled?: boolean | undefined; adjustRate?: number | undefined; minCoeff?: number | undefined; maxCoeff?: number | undefined; }, connectionVariance: number) => void

Parameters:

Returns: void.

applyDistanceCoefficientDecrease

(controller: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").NeatControllerForEval, bounds: { minCoeff: number; maxCoeff: number; }, adjustRate: number) => void

Parameters:

Returns: void.

applyDistanceCoefficientIncrease

(controller: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").NeatControllerForEval, bounds: { minCoeff: number; maxCoeff: number; }, adjustRate: number) => void

Parameters:

Returns: void.

computeMean

(values: number[]) => number

Parameters:

Returns: Mean of the values.

computeVariance

(values: number[], meanValue: number) => number

Parameters:

Returns: Variance of the values.

getDistanceCoefficientBounds

(autoDistanceCoeffOptions: { enabled?: boolean | undefined; adjustRate?: number | undefined; minCoeff?: number | undefined; maxCoeff?: number | undefined; }) => { minCoeff: number; maxCoeff: number; }

Parameters:

Returns: Bounds for coefficients.

initializeConnectionVarianceBootstrap

(controller: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").NeatControllerForEval, connectionVariance: number, bounds: { minCoeff: number; maxCoeff: number; }, adjustRate: number) => void

Parameters:

Returns: void.

runAutoDistanceCoefficientTuning

(controller: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").NeatControllerForEval, evaluationOptions: { [key: string]: unknown; fitnessPopulation?: boolean | undefined; clear?: boolean | undefined; novelty?: { enabled?: boolean | undefined; descriptor?: ((genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").GenomeForEvaluation) => number[]) | undefined; k?: number | undefined; blendFactor?: number | undefined; archiveAddThreshold?: number | undefined; } | undefined; entropySharingTuning?: { enabled?: boolean | undefined; targetEntropyVar?: number | undefined; adjustRate?: number | undefined; minSigma?: number | undefined; maxSigma?: number | undefined; } | undefined; entropyCompatTuning?: { enabled?: boolean | undefined; targetEntropy?: number | undefined; deadband?: number | undefined; adjustRate?: number | undefined; minThreshold?: number | undefined; maxThreshold?: number | undefined; } | undefined; autoDistanceCoeffTuning?: { enabled?: boolean | undefined; adjustRate?: number | undefined; minCoeff?: number | undefined; maxCoeff?: number | undefined; } | undefined; multiObjective?: { enabled?: boolean | undefined; autoEntropy?: boolean | undefined; dynamic?: { enabled?: boolean | undefined; } | undefined; } | undefined; speciation?: boolean | undefined; targetSpecies?: number | undefined; compatAdjust?: boolean | undefined; speciesAllocation?: { extendedHistory?: boolean | undefined; } | undefined; sharingSigma?: number | undefined; compatibilityThreshold?: number | undefined; excessCoeff?: number | undefined; disjointCoeff?: number | undefined; }) => void

Parameters:

Returns: void.

neat/neat.evaluate.constants.utils.ts

AUTO_COEFF_ADJUST_DEFAULT

AUTO_COEFF_MAX_DEFAULT

AUTO_COEFF_MIN_DEFAULT

COMPAT_MAX_THRESHOLD_DEFAULT

COMPAT_MIN_THRESHOLD_DEFAULT

COMPAT_THRESHOLD_DEFAULT

DISTANCE_COEFF_DEFAULT

ENTROPY_ADJUST_DEFAULT

ENTROPY_DEADBAND_DEFAULT

ENTROPY_TARGET_DEFAULT

ENTROPY_VAR_ADJUST_DEFAULT

ENTROPY_VAR_HIGH_BAND

ENTROPY_VAR_LOW_BAND

ENTROPY_VAR_MAX_SIGMA_DEFAULT

ENTROPY_VAR_MIN_SIGMA_DEFAULT

ENTROPY_VAR_TARGET_DEFAULT

NOVELTY_ARCHIVE_CAP

NOVELTY_DEFAULT_BLEND

NOVELTY_DEFAULT_NEIGHBORS

VARIANCE_DECREASE_THRESHOLD

VARIANCE_INCREASE_THRESHOLD

neat/neat.evaluate.entropy-compat.utils.ts

computeNextCompatibilityThreshold

(entropyCompatOptions: { enabled?: boolean | undefined; targetEntropy?: number | undefined; deadband?: number | undefined; adjustRate?: number | undefined; minThreshold?: number | undefined; maxThreshold?: number | undefined; }, meanEntropy: number, currentThreshold: number) => number

Parameters:

Returns: Next compatibility threshold.

runEntropyCompatibilityTuning

(controller: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").NeatControllerForEval, evaluationOptions: { [key: string]: unknown; fitnessPopulation?: boolean | undefined; clear?: boolean | undefined; novelty?: { enabled?: boolean | undefined; descriptor?: ((genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").GenomeForEvaluation) => number[]) | undefined; k?: number | undefined; blendFactor?: number | undefined; archiveAddThreshold?: number | undefined; } | undefined; entropySharingTuning?: { enabled?: boolean | undefined; targetEntropyVar?: number | undefined; adjustRate?: number | undefined; minSigma?: number | undefined; maxSigma?: number | undefined; } | undefined; entropyCompatTuning?: { enabled?: boolean | undefined; targetEntropy?: number | undefined; deadband?: number | undefined; adjustRate?: number | undefined; minThreshold?: number | undefined; maxThreshold?: number | undefined; } | undefined; autoDistanceCoeffTuning?: { enabled?: boolean | undefined; adjustRate?: number | undefined; minCoeff?: number | undefined; maxCoeff?: number | undefined; } | undefined; multiObjective?: { enabled?: boolean | undefined; autoEntropy?: boolean | undefined; dynamic?: { enabled?: boolean | undefined; } | undefined; } | undefined; speciation?: boolean | undefined; targetSpecies?: number | undefined; compatAdjust?: boolean | undefined; speciesAllocation?: { extendedHistory?: boolean | undefined; } | undefined; sharingSigma?: number | undefined; compatibilityThreshold?: number | undefined; excessCoeff?: number | undefined; disjointCoeff?: number | undefined; }) => void

Parameters:

Returns: void.

neat/neat.evaluate.entropy-sharing.utils.ts

computeNextSharingSigma

(entropySharingOptions: { enabled?: boolean | undefined; targetEntropyVar?: number | undefined; adjustRate?: number | undefined; minSigma?: number | undefined; maxSigma?: number | undefined; }, currentVarEntropy: number, currentSigma: number) => number

Parameters:

Returns: Next sigma value.

ensureDiversityStatsContainer

(controller: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").NeatControllerForEval) => void

Parameters:

Returns: void.

runEntropySharingTuning

(controller: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").NeatControllerForEval, evaluationOptions: { [key: string]: unknown; fitnessPopulation?: boolean | undefined; clear?: boolean | undefined; novelty?: { enabled?: boolean | undefined; descriptor?: ((genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").GenomeForEvaluation) => number[]) | undefined; k?: number | undefined; blendFactor?: number | undefined; archiveAddThreshold?: number | undefined; } | undefined; entropySharingTuning?: { enabled?: boolean | undefined; targetEntropyVar?: number | undefined; adjustRate?: number | undefined; minSigma?: number | undefined; maxSigma?: number | undefined; } | undefined; entropyCompatTuning?: { enabled?: boolean | undefined; targetEntropy?: number | undefined; deadband?: number | undefined; adjustRate?: number | undefined; minThreshold?: number | undefined; maxThreshold?: number | undefined; } | undefined; autoDistanceCoeffTuning?: { enabled?: boolean | undefined; adjustRate?: number | undefined; minCoeff?: number | undefined; maxCoeff?: number | undefined; } | undefined; multiObjective?: { enabled?: boolean | undefined; autoEntropy?: boolean | undefined; dynamic?: { enabled?: boolean | undefined; } | undefined; } | undefined; speciation?: boolean | undefined; targetSpecies?: number | undefined; compatAdjust?: boolean | undefined; speciesAllocation?: { extendedHistory?: boolean | undefined; } | undefined; sharingSigma?: number | undefined; compatibilityThreshold?: number | undefined; excessCoeff?: number | undefined; disjointCoeff?: number | undefined; }) => void

Parameters:

Returns: void.

neat/neat.evaluate.fitness.utils.ts

clearGenomeStateIfRequested

(controller: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").NeatControllerForEval, evaluationOptions: { [key: string]: unknown; fitnessPopulation?: boolean | undefined; clear?: boolean | undefined; novelty?: { enabled?: boolean | undefined; descriptor?: ((genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").GenomeForEvaluation) => number[]) | undefined; k?: number | undefined; blendFactor?: number | undefined; archiveAddThreshold?: number | undefined; } | undefined; entropySharingTuning?: { enabled?: boolean | undefined; targetEntropyVar?: number | undefined; adjustRate?: number | undefined; minSigma?: number | undefined; maxSigma?: number | undefined; } | undefined; entropyCompatTuning?: { enabled?: boolean | undefined; targetEntropy?: number | undefined; deadband?: number | undefined; adjustRate?: number | undefined; minThreshold?: number | undefined; maxThreshold?: number | undefined; } | undefined; autoDistanceCoeffTuning?: { enabled?: boolean | undefined; adjustRate?: number | undefined; minCoeff?: number | undefined; maxCoeff?: number | undefined; } | undefined; multiObjective?: { enabled?: boolean | undefined; autoEntropy?: boolean | undefined; dynamic?: { enabled?: boolean | undefined; } | undefined; } | undefined; speciation?: boolean | undefined; targetSpecies?: number | undefined; compatAdjust?: boolean | undefined; speciesAllocation?: { extendedHistory?: boolean | undefined; } | undefined; sharingSigma?: number | undefined; compatibilityThreshold?: number | undefined; excessCoeff?: number | undefined; disjointCoeff?: number | undefined; }, clearAction: (genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").GenomeForEvaluation) => void) => void

Parameters:

Returns: void.

runFitnessEvaluation

(controller: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").NeatControllerForEval, evaluationOptions: { [key: string]: unknown; fitnessPopulation?: boolean | undefined; clear?: boolean | undefined; novelty?: { enabled?: boolean | undefined; descriptor?: ((genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").GenomeForEvaluation) => number[]) | undefined; k?: number | undefined; blendFactor?: number | undefined; archiveAddThreshold?: number | undefined; } | undefined; entropySharingTuning?: { enabled?: boolean | undefined; targetEntropyVar?: number | undefined; adjustRate?: number | undefined; minSigma?: number | undefined; maxSigma?: number | undefined; } | undefined; entropyCompatTuning?: { enabled?: boolean | undefined; targetEntropy?: number | undefined; deadband?: number | undefined; adjustRate?: number | undefined; minThreshold?: number | undefined; maxThreshold?: number | undefined; } | undefined; autoDistanceCoeffTuning?: { enabled?: boolean | undefined; adjustRate?: number | undefined; minCoeff?: number | undefined; maxCoeff?: number | undefined; } | undefined; multiObjective?: { enabled?: boolean | undefined; autoEntropy?: boolean | undefined; dynamic?: { enabled?: boolean | undefined; } | undefined; } | undefined; speciation?: boolean | undefined; targetSpecies?: number | undefined; compatAdjust?: boolean | undefined; speciesAllocation?: { extendedHistory?: boolean | undefined; } | undefined; sharingSigma?: number | undefined; compatibilityThreshold?: number | undefined; excessCoeff?: number | undefined; disjointCoeff?: number | undefined; }) => Promise<void>

Parameters:

Returns: Promise after fitness evaluation completes.

neat/neat.evaluate.novelty.utils.ts

addGenomeToNoveltyArchive

(controller: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").NeatControllerForEval, descriptor: number[], novelty: number, noveltyOptions: { enabled?: boolean | undefined; descriptor?: ((genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").GenomeForEvaluation) => number[]) | undefined; k?: number | undefined; blendFactor?: number | undefined; archiveAddThreshold?: number | undefined; }) => void

Parameters:

Returns: void.

applyNoveltyToPopulation

(controller: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").NeatControllerForEval, descriptors: number[][], distanceMatrix: number[][], kNeighbors: number, blendFactor: number, noveltyOptions: { enabled?: boolean | undefined; descriptor?: ((genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").GenomeForEvaluation) => number[]) | undefined; k?: number | undefined; blendFactor?: number | undefined; archiveAddThreshold?: number | undefined; }) => void

Parameters:

Returns: void.

blendNoveltyIntoScore

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").GenomeForEvaluation, novelty: number, blendFactor: number) => void

Parameters:

Returns: void.

buildDistanceMatrix

(descriptors: number[][]) => number[][]

Parameters:

Returns: Distance matrix.

buildNoveltyDescriptors

(controller: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").NeatControllerForEval, noveltyOptions: { enabled?: boolean | undefined; descriptor?: ((genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").GenomeForEvaluation) => number[]) | undefined; k?: number | undefined; blendFactor?: number | undefined; archiveAddThreshold?: number | undefined; }) => number[][]

Parameters:

Returns: Descriptor vectors for each genome.

computeDescriptorDistance

(leftDescriptor: number[], rightDescriptor: number[], isSame: boolean) => number

Parameters:

Returns: Euclidean distance.

computeNoveltyScore

(distanceRow: number[], kNeighbors: number) => number

Parameters:

Returns: Novelty score.

getNoveltyBlendFactor

(noveltyOptions: { enabled?: boolean | undefined; descriptor?: ((genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").GenomeForEvaluation) => number[]) | undefined; k?: number | undefined; blendFactor?: number | undefined; archiveAddThreshold?: number | undefined; }) => number

Parameters:

Returns: Blend factor for novelty vs. fitness.

getNoveltyNeighborCount

(noveltyOptions: { enabled?: boolean | undefined; descriptor?: ((genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").GenomeForEvaluation) => number[]) | undefined; k?: number | undefined; blendFactor?: number | undefined; archiveAddThreshold?: number | undefined; }) => number

Parameters:

Returns: Number of neighbors to consider.

runNoveltyBlendAndArchive

(controller: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").NeatControllerForEval, evaluationOptions: { [key: string]: unknown; fitnessPopulation?: boolean | undefined; clear?: boolean | undefined; novelty?: { enabled?: boolean | undefined; descriptor?: ((genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").GenomeForEvaluation) => number[]) | undefined; k?: number | undefined; blendFactor?: number | undefined; archiveAddThreshold?: number | undefined; } | undefined; entropySharingTuning?: { enabled?: boolean | undefined; targetEntropyVar?: number | undefined; adjustRate?: number | undefined; minSigma?: number | undefined; maxSigma?: number | undefined; } | undefined; entropyCompatTuning?: { enabled?: boolean | undefined; targetEntropy?: number | undefined; deadband?: number | undefined; adjustRate?: number | undefined; minThreshold?: number | undefined; maxThreshold?: number | undefined; } | undefined; autoDistanceCoeffTuning?: { enabled?: boolean | undefined; adjustRate?: number | undefined; minCoeff?: number | undefined; maxCoeff?: number | undefined; } | undefined; multiObjective?: { enabled?: boolean | undefined; autoEntropy?: boolean | undefined; dynamic?: { enabled?: boolean | undefined; } | undefined; } | undefined; speciation?: boolean | undefined; targetSpecies?: number | undefined; compatAdjust?: boolean | undefined; speciesAllocation?: { extendedHistory?: boolean | undefined; } | undefined; sharingSigma?: number | undefined; compatibilityThreshold?: number | undefined; excessCoeff?: number | undefined; disjointCoeff?: number | undefined; }) => void

Parameters:

Returns: void.

neat/neat.evaluate.objectives.utils.ts

registerEntropyObjective

(controller: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").NeatControllerForEval) => void

Parameters:

Returns: void.

runAutoEntropyObjectiveInjection

(controller: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").NeatControllerForEval, evaluationOptions: { [key: string]: unknown; fitnessPopulation?: boolean | undefined; clear?: boolean | undefined; novelty?: { enabled?: boolean | undefined; descriptor?: ((genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").GenomeForEvaluation) => number[]) | undefined; k?: number | undefined; blendFactor?: number | undefined; archiveAddThreshold?: number | undefined; } | undefined; entropySharingTuning?: { enabled?: boolean | undefined; targetEntropyVar?: number | undefined; adjustRate?: number | undefined; minSigma?: number | undefined; maxSigma?: number | undefined; } | undefined; entropyCompatTuning?: { enabled?: boolean | undefined; targetEntropy?: number | undefined; deadband?: number | undefined; adjustRate?: number | undefined; minThreshold?: number | undefined; maxThreshold?: number | undefined; } | undefined; autoDistanceCoeffTuning?: { enabled?: boolean | undefined; adjustRate?: number | undefined; minCoeff?: number | undefined; maxCoeff?: number | undefined; } | undefined; multiObjective?: { enabled?: boolean | undefined; autoEntropy?: boolean | undefined; dynamic?: { enabled?: boolean | undefined; } | undefined; } | undefined; speciation?: boolean | undefined; targetSpecies?: number | undefined; compatAdjust?: boolean | undefined; speciesAllocation?: { extendedHistory?: boolean | undefined; } | undefined; sharingSigma?: number | undefined; compatibilityThreshold?: number | undefined; excessCoeff?: number | undefined; disjointCoeff?: number | undefined; }) => void

Parameters:

Returns: void.

shouldAutoInjectEntropy

(evaluationOptions: { [key: string]: unknown; fitnessPopulation?: boolean | undefined; clear?: boolean | undefined; novelty?: { enabled?: boolean | undefined; descriptor?: ((genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").GenomeForEvaluation) => number[]) | undefined; k?: number | undefined; blendFactor?: number | undefined; archiveAddThreshold?: number | undefined; } | undefined; entropySharingTuning?: { enabled?: boolean | undefined; targetEntropyVar?: number | undefined; adjustRate?: number | undefined; minSigma?: number | undefined; maxSigma?: number | undefined; } | undefined; entropyCompatTuning?: { enabled?: boolean | undefined; targetEntropy?: number | undefined; deadband?: number | undefined; adjustRate?: number | undefined; minThreshold?: number | undefined; maxThreshold?: number | undefined; } | undefined; autoDistanceCoeffTuning?: { enabled?: boolean | undefined; adjustRate?: number | undefined; minCoeff?: number | undefined; maxCoeff?: number | undefined; } | undefined; multiObjective?: { enabled?: boolean | undefined; autoEntropy?: boolean | undefined; dynamic?: { enabled?: boolean | undefined; } | undefined; } | undefined; speciation?: boolean | undefined; targetSpecies?: number | undefined; compatAdjust?: boolean | undefined; speciesAllocation?: { extendedHistory?: boolean | undefined; } | undefined; sharingSigma?: number | undefined; compatibilityThreshold?: number | undefined; excessCoeff?: number | undefined; disjointCoeff?: number | undefined; }) => boolean

Parameters:

Returns: Whether entropy objective should be injected.

neat/neat.evaluate.speciation.utils.ts

runLightweightSpeciation

(controller: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").NeatControllerForEval, evaluationOptions: { [key: string]: unknown; fitnessPopulation?: boolean | undefined; clear?: boolean | undefined; novelty?: { enabled?: boolean | undefined; descriptor?: ((genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").GenomeForEvaluation) => number[]) | undefined; k?: number | undefined; blendFactor?: number | undefined; archiveAddThreshold?: number | undefined; } | undefined; entropySharingTuning?: { enabled?: boolean | undefined; targetEntropyVar?: number | undefined; adjustRate?: number | undefined; minSigma?: number | undefined; maxSigma?: number | undefined; } | undefined; entropyCompatTuning?: { enabled?: boolean | undefined; targetEntropy?: number | undefined; deadband?: number | undefined; adjustRate?: number | undefined; minThreshold?: number | undefined; maxThreshold?: number | undefined; } | undefined; autoDistanceCoeffTuning?: { enabled?: boolean | undefined; adjustRate?: number | undefined; minCoeff?: number | undefined; maxCoeff?: number | undefined; } | undefined; multiObjective?: { enabled?: boolean | undefined; autoEntropy?: boolean | undefined; dynamic?: { enabled?: boolean | undefined; } | undefined; } | undefined; speciation?: boolean | undefined; targetSpecies?: number | undefined; compatAdjust?: boolean | undefined; speciesAllocation?: { extendedHistory?: boolean | undefined; } | undefined; sharingSigma?: number | undefined; compatibilityThreshold?: number | undefined; excessCoeff?: number | undefined; disjointCoeff?: number | undefined; }) => void

Parameters:

Returns: void.

shouldRunSpeciation

(evaluationOptions: { [key: string]: unknown; fitnessPopulation?: boolean | undefined; clear?: boolean | undefined; novelty?: { enabled?: boolean | undefined; descriptor?: ((genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").GenomeForEvaluation) => number[]) | undefined; k?: number | undefined; blendFactor?: number | undefined; archiveAddThreshold?: number | undefined; } | undefined; entropySharingTuning?: { enabled?: boolean | undefined; targetEntropyVar?: number | undefined; adjustRate?: number | undefined; minSigma?: number | undefined; maxSigma?: number | undefined; } | undefined; entropyCompatTuning?: { enabled?: boolean | undefined; targetEntropy?: number | undefined; deadband?: number | undefined; adjustRate?: number | undefined; minThreshold?: number | undefined; maxThreshold?: number | undefined; } | undefined; autoDistanceCoeffTuning?: { enabled?: boolean | undefined; adjustRate?: number | undefined; minCoeff?: number | undefined; maxCoeff?: number | undefined; } | undefined; multiObjective?: { enabled?: boolean | undefined; autoEntropy?: boolean | undefined; dynamic?: { enabled?: boolean | undefined; } | undefined; } | undefined; speciation?: boolean | undefined; targetSpecies?: number | undefined; compatAdjust?: boolean | undefined; speciesAllocation?: { extendedHistory?: boolean | undefined; } | undefined; sharingSigma?: number | undefined; compatibilityThreshold?: number | undefined; excessCoeff?: number | undefined; disjointCoeff?: number | undefined; }) => boolean

Parameters:

Returns: Whether speciation should be run.

neat/neat.evaluate.ts

AUTO_COEFF_ADJUST_DEFAULT

AUTO_COEFF_MAX_DEFAULT

AUTO_COEFF_MIN_DEFAULT

COMPAT_MAX_THRESHOLD_DEFAULT

COMPAT_MIN_THRESHOLD_DEFAULT

COMPAT_THRESHOLD_DEFAULT

DISTANCE_COEFF_DEFAULT

ENTROPY_ADJUST_DEFAULT

ENTROPY_DEADBAND_DEFAULT

ENTROPY_TARGET_DEFAULT

ENTROPY_VAR_ADJUST_DEFAULT

ENTROPY_VAR_HIGH_BAND

ENTROPY_VAR_LOW_BAND

ENTROPY_VAR_MAX_SIGMA_DEFAULT

ENTROPY_VAR_MIN_SIGMA_DEFAULT

ENTROPY_VAR_TARGET_DEFAULT

evaluate

() => Promise<void>

Evaluate the population or population-wide fitness delegate.

This function mirrors the legacy evaluate behaviour used by NeatapticTS but adds documentation and clearer local variable names for readability.

Top-level responsibilities (method steps descriptions):

  1. Run fitness either on each genome or once for the population depending on options.fitnessPopulation.
  2. Optionally clear genome internal state before evaluation when options.clear is set.
  3. After scoring, apply optional novelty blending using a user-supplied descriptor function. Novelty is blended into scores using a blend factor and may be archived.
  4. Apply several adaptive tuning behaviors (entropy-sharing, compatibility threshold tuning, auto-distance coefficient tuning) guarded by options.
  5. Trigger light-weight speciation when speciation-related controller options are enabled so tests that only call evaluate still exercise threshold tuning.

Example usage: // await evaluate.call(controller); // where controller has population, fitness etc.

Returns: Promise resolves after evaluation and adaptive updates complete.

NOVELTY_ARCHIVE_CAP

NOVELTY_DEFAULT_BLEND

NOVELTY_DEFAULT_NEIGHBORS

VARIANCE_DECREASE_THRESHOLD

VARIANCE_INCREASE_THRESHOLD

neat/neat.evaluate.types.utils.ts

DiversityStats

Diversity statistics tracked during evaluation.

The values are optional because different evaluations may only compute a subset of metrics.

GenomeForEvaluation

Genome with score, novelty, and clearing capabilities.

This interface describes the minimal genome shape required by evaluation helpers. It intentionally stays permissive for compatibility with legacy genome variants while documenting the expected properties.

NeatControllerForEval

NEAT controller interface for evaluation.

This interface models the subset of a NEAT controller used by the evaluation helpers. It includes options, population data, and optional adaptive tuning hooks.

NoveltyArchiveEntry

Novelty archive entry with descriptor and novelty score.

Entries store a descriptor vector alongside the computed novelty so the archive can seed future novelty calculations.

ObjectiveDef

Objective definition for multi-objective optimization.

Objectives are registered dynamically to guide evaluation and selection.

neat/neat.evaluate.utils.ts

AUTO_COEFF_ADJUST_DEFAULT

AUTO_COEFF_MAX_DEFAULT

AUTO_COEFF_MIN_DEFAULT

COMPAT_MAX_THRESHOLD_DEFAULT

COMPAT_MIN_THRESHOLD_DEFAULT

COMPAT_THRESHOLD_DEFAULT

DISTANCE_COEFF_DEFAULT

DiversityStats

Diversity statistics tracked during evaluation.

The values are optional because different evaluations may only compute a subset of metrics.

ensureDiversityStatsContainer

(controller: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").NeatControllerForEval) => void

Parameters:

Returns: void.

ENTROPY_ADJUST_DEFAULT

ENTROPY_DEADBAND_DEFAULT

ENTROPY_TARGET_DEFAULT

ENTROPY_VAR_ADJUST_DEFAULT

ENTROPY_VAR_HIGH_BAND

ENTROPY_VAR_LOW_BAND

ENTROPY_VAR_MAX_SIGMA_DEFAULT

ENTROPY_VAR_MIN_SIGMA_DEFAULT

ENTROPY_VAR_TARGET_DEFAULT

GenomeForEvaluation

Genome with score, novelty, and clearing capabilities.

This interface describes the minimal genome shape required by evaluation helpers. It intentionally stays permissive for compatibility with legacy genome variants while documenting the expected properties.

NeatControllerForEval

NEAT controller interface for evaluation.

This interface models the subset of a NEAT controller used by the evaluation helpers. It includes options, population data, and optional adaptive tuning hooks.

NOVELTY_ARCHIVE_CAP

NOVELTY_DEFAULT_BLEND

NOVELTY_DEFAULT_NEIGHBORS

NoveltyArchiveEntry

Novelty archive entry with descriptor and novelty score.

Entries store a descriptor vector alongside the computed novelty so the archive can seed future novelty calculations.

ObjectiveDef

Objective definition for multi-objective optimization.

Objectives are registered dynamically to guide evaluation and selection.

runAutoDistanceCoefficientTuning

(controller: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").NeatControllerForEval, evaluationOptions: { [key: string]: unknown; fitnessPopulation?: boolean | undefined; clear?: boolean | undefined; novelty?: { enabled?: boolean | undefined; descriptor?: ((genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").GenomeForEvaluation) => number[]) | undefined; k?: number | undefined; blendFactor?: number | undefined; archiveAddThreshold?: number | undefined; } | undefined; entropySharingTuning?: { enabled?: boolean | undefined; targetEntropyVar?: number | undefined; adjustRate?: number | undefined; minSigma?: number | undefined; maxSigma?: number | undefined; } | undefined; entropyCompatTuning?: { enabled?: boolean | undefined; targetEntropy?: number | undefined; deadband?: number | undefined; adjustRate?: number | undefined; minThreshold?: number | undefined; maxThreshold?: number | undefined; } | undefined; autoDistanceCoeffTuning?: { enabled?: boolean | undefined; adjustRate?: number | undefined; minCoeff?: number | undefined; maxCoeff?: number | undefined; } | undefined; multiObjective?: { enabled?: boolean | undefined; autoEntropy?: boolean | undefined; dynamic?: { enabled?: boolean | undefined; } | undefined; } | undefined; speciation?: boolean | undefined; targetSpecies?: number | undefined; compatAdjust?: boolean | undefined; speciesAllocation?: { extendedHistory?: boolean | undefined; } | undefined; sharingSigma?: number | undefined; compatibilityThreshold?: number | undefined; excessCoeff?: number | undefined; disjointCoeff?: number | undefined; }) => void

Parameters:

Returns: void.

runAutoEntropyObjectiveInjection

(controller: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").NeatControllerForEval, evaluationOptions: { [key: string]: unknown; fitnessPopulation?: boolean | undefined; clear?: boolean | undefined; novelty?: { enabled?: boolean | undefined; descriptor?: ((genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").GenomeForEvaluation) => number[]) | undefined; k?: number | undefined; blendFactor?: number | undefined; archiveAddThreshold?: number | undefined; } | undefined; entropySharingTuning?: { enabled?: boolean | undefined; targetEntropyVar?: number | undefined; adjustRate?: number | undefined; minSigma?: number | undefined; maxSigma?: number | undefined; } | undefined; entropyCompatTuning?: { enabled?: boolean | undefined; targetEntropy?: number | undefined; deadband?: number | undefined; adjustRate?: number | undefined; minThreshold?: number | undefined; maxThreshold?: number | undefined; } | undefined; autoDistanceCoeffTuning?: { enabled?: boolean | undefined; adjustRate?: number | undefined; minCoeff?: number | undefined; maxCoeff?: number | undefined; } | undefined; multiObjective?: { enabled?: boolean | undefined; autoEntropy?: boolean | undefined; dynamic?: { enabled?: boolean | undefined; } | undefined; } | undefined; speciation?: boolean | undefined; targetSpecies?: number | undefined; compatAdjust?: boolean | undefined; speciesAllocation?: { extendedHistory?: boolean | undefined; } | undefined; sharingSigma?: number | undefined; compatibilityThreshold?: number | undefined; excessCoeff?: number | undefined; disjointCoeff?: number | undefined; }) => void

Parameters:

Returns: void.

runEntropyCompatibilityTuning

(controller: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").NeatControllerForEval, evaluationOptions: { [key: string]: unknown; fitnessPopulation?: boolean | undefined; clear?: boolean | undefined; novelty?: { enabled?: boolean | undefined; descriptor?: ((genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").GenomeForEvaluation) => number[]) | undefined; k?: number | undefined; blendFactor?: number | undefined; archiveAddThreshold?: number | undefined; } | undefined; entropySharingTuning?: { enabled?: boolean | undefined; targetEntropyVar?: number | undefined; adjustRate?: number | undefined; minSigma?: number | undefined; maxSigma?: number | undefined; } | undefined; entropyCompatTuning?: { enabled?: boolean | undefined; targetEntropy?: number | undefined; deadband?: number | undefined; adjustRate?: number | undefined; minThreshold?: number | undefined; maxThreshold?: number | undefined; } | undefined; autoDistanceCoeffTuning?: { enabled?: boolean | undefined; adjustRate?: number | undefined; minCoeff?: number | undefined; maxCoeff?: number | undefined; } | undefined; multiObjective?: { enabled?: boolean | undefined; autoEntropy?: boolean | undefined; dynamic?: { enabled?: boolean | undefined; } | undefined; } | undefined; speciation?: boolean | undefined; targetSpecies?: number | undefined; compatAdjust?: boolean | undefined; speciesAllocation?: { extendedHistory?: boolean | undefined; } | undefined; sharingSigma?: number | undefined; compatibilityThreshold?: number | undefined; excessCoeff?: number | undefined; disjointCoeff?: number | undefined; }) => void

Parameters:

Returns: void.

runEntropySharingTuning

(controller: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").NeatControllerForEval, evaluationOptions: { [key: string]: unknown; fitnessPopulation?: boolean | undefined; clear?: boolean | undefined; novelty?: { enabled?: boolean | undefined; descriptor?: ((genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").GenomeForEvaluation) => number[]) | undefined; k?: number | undefined; blendFactor?: number | undefined; archiveAddThreshold?: number | undefined; } | undefined; entropySharingTuning?: { enabled?: boolean | undefined; targetEntropyVar?: number | undefined; adjustRate?: number | undefined; minSigma?: number | undefined; maxSigma?: number | undefined; } | undefined; entropyCompatTuning?: { enabled?: boolean | undefined; targetEntropy?: number | undefined; deadband?: number | undefined; adjustRate?: number | undefined; minThreshold?: number | undefined; maxThreshold?: number | undefined; } | undefined; autoDistanceCoeffTuning?: { enabled?: boolean | undefined; adjustRate?: number | undefined; minCoeff?: number | undefined; maxCoeff?: number | undefined; } | undefined; multiObjective?: { enabled?: boolean | undefined; autoEntropy?: boolean | undefined; dynamic?: { enabled?: boolean | undefined; } | undefined; } | undefined; speciation?: boolean | undefined; targetSpecies?: number | undefined; compatAdjust?: boolean | undefined; speciesAllocation?: { extendedHistory?: boolean | undefined; } | undefined; sharingSigma?: number | undefined; compatibilityThreshold?: number | undefined; excessCoeff?: number | undefined; disjointCoeff?: number | undefined; }) => void

Parameters:

Returns: void.

runFitnessEvaluation

(controller: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").NeatControllerForEval, evaluationOptions: { [key: string]: unknown; fitnessPopulation?: boolean | undefined; clear?: boolean | undefined; novelty?: { enabled?: boolean | undefined; descriptor?: ((genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").GenomeForEvaluation) => number[]) | undefined; k?: number | undefined; blendFactor?: number | undefined; archiveAddThreshold?: number | undefined; } | undefined; entropySharingTuning?: { enabled?: boolean | undefined; targetEntropyVar?: number | undefined; adjustRate?: number | undefined; minSigma?: number | undefined; maxSigma?: number | undefined; } | undefined; entropyCompatTuning?: { enabled?: boolean | undefined; targetEntropy?: number | undefined; deadband?: number | undefined; adjustRate?: number | undefined; minThreshold?: number | undefined; maxThreshold?: number | undefined; } | undefined; autoDistanceCoeffTuning?: { enabled?: boolean | undefined; adjustRate?: number | undefined; minCoeff?: number | undefined; maxCoeff?: number | undefined; } | undefined; multiObjective?: { enabled?: boolean | undefined; autoEntropy?: boolean | undefined; dynamic?: { enabled?: boolean | undefined; } | undefined; } | undefined; speciation?: boolean | undefined; targetSpecies?: number | undefined; compatAdjust?: boolean | undefined; speciesAllocation?: { extendedHistory?: boolean | undefined; } | undefined; sharingSigma?: number | undefined; compatibilityThreshold?: number | undefined; excessCoeff?: number | undefined; disjointCoeff?: number | undefined; }) => Promise<void>

Parameters:

Returns: Promise after fitness evaluation completes.

runLightweightSpeciation

(controller: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").NeatControllerForEval, evaluationOptions: { [key: string]: unknown; fitnessPopulation?: boolean | undefined; clear?: boolean | undefined; novelty?: { enabled?: boolean | undefined; descriptor?: ((genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").GenomeForEvaluation) => number[]) | undefined; k?: number | undefined; blendFactor?: number | undefined; archiveAddThreshold?: number | undefined; } | undefined; entropySharingTuning?: { enabled?: boolean | undefined; targetEntropyVar?: number | undefined; adjustRate?: number | undefined; minSigma?: number | undefined; maxSigma?: number | undefined; } | undefined; entropyCompatTuning?: { enabled?: boolean | undefined; targetEntropy?: number | undefined; deadband?: number | undefined; adjustRate?: number | undefined; minThreshold?: number | undefined; maxThreshold?: number | undefined; } | undefined; autoDistanceCoeffTuning?: { enabled?: boolean | undefined; adjustRate?: number | undefined; minCoeff?: number | undefined; maxCoeff?: number | undefined; } | undefined; multiObjective?: { enabled?: boolean | undefined; autoEntropy?: boolean | undefined; dynamic?: { enabled?: boolean | undefined; } | undefined; } | undefined; speciation?: boolean | undefined; targetSpecies?: number | undefined; compatAdjust?: boolean | undefined; speciesAllocation?: { extendedHistory?: boolean | undefined; } | undefined; sharingSigma?: number | undefined; compatibilityThreshold?: number | undefined; excessCoeff?: number | undefined; disjointCoeff?: number | undefined; }) => void

Parameters:

Returns: void.

runNoveltyBlendAndArchive

(controller: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").NeatControllerForEval, evaluationOptions: { [key: string]: unknown; fitnessPopulation?: boolean | undefined; clear?: boolean | undefined; novelty?: { enabled?: boolean | undefined; descriptor?: ((genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evaluate.types.utils").GenomeForEvaluation) => number[]) | undefined; k?: number | undefined; blendFactor?: number | undefined; archiveAddThreshold?: number | undefined; } | undefined; entropySharingTuning?: { enabled?: boolean | undefined; targetEntropyVar?: number | undefined; adjustRate?: number | undefined; minSigma?: number | undefined; maxSigma?: number | undefined; } | undefined; entropyCompatTuning?: { enabled?: boolean | undefined; targetEntropy?: number | undefined; deadband?: number | undefined; adjustRate?: number | undefined; minThreshold?: number | undefined; maxThreshold?: number | undefined; } | undefined; autoDistanceCoeffTuning?: { enabled?: boolean | undefined; adjustRate?: number | undefined; minCoeff?: number | undefined; maxCoeff?: number | undefined; } | undefined; multiObjective?: { enabled?: boolean | undefined; autoEntropy?: boolean | undefined; dynamic?: { enabled?: boolean | undefined; } | undefined; } | undefined; speciation?: boolean | undefined; targetSpecies?: number | undefined; compatAdjust?: boolean | undefined; speciesAllocation?: { extendedHistory?: boolean | undefined; } | undefined; sharingSigma?: number | undefined; compatibilityThreshold?: number | undefined; excessCoeff?: number | undefined; disjointCoeff?: number | undefined; }) => void

Parameters:

Returns: void.

VARIANCE_DECREASE_THRESHOLD

VARIANCE_INCREASE_THRESHOLD

neat/neat.evolve.adaptive.utils.ts

adaptReenableProbability

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, config: { minSamples: number; target: number; min: number; max: number; deltaScale: number; }) => void

Adapt the re-enable probability based on recent success ratios.

Parameters:

Returns: void.

applyAdaptiveComplexityControllers

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => Promise<void>

Apply adaptive complexity controllers if available.

Parameters:

Returns: void.

applyAncestorUniqAdaptiveSafe

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => Promise<void>

Apply ancestor uniqueness adaptation if available.

Parameters:

Returns: void.

applyAutoCompatibilityTuning

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, config: { targetMin: number; adjustRate: number; minCoeff: number; maxCoeff: number; randomScale: number; }) => void

Apply auto-compatibility tuning if enabled.

Parameters:

Returns: void.

applyMinimalCriterionAdaptiveSafe

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => Promise<void>

Apply minimal criterion adaptive controller if available.

Parameters:

Returns: void.

applyOperatorAdaptationSafe

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => Promise<void>

Apply operator adaptation if available.

Parameters:

Returns: void.

applyPruningAndMutation

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => Promise<void>

Apply pruning and mutation phases.

Parameters:

Returns: void.

invalidateCompatibilityCaches

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => void

Invalidate compatibility caches after mutations.

Parameters:

Returns: void.

neat/neat.evolve.objectives.utils.ts

applyDynamicObjectiveSchedule

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, currentObjectiveKeys: string[], config: { autoEntropyAddAt: number; }) => void

Apply dynamic objective scheduling and entropy rules.

Parameters:

Returns: void.

applyFitnessSuppressionForTests

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => void

Suppress fitness objective for specific test scenarios.

Parameters:

Returns: void.

captureObjectiveImportanceSnapshot

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => void

Capture objective importance stats for telemetry.

Parameters:

Returns: void.

handleEntropyDropAndReadd

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, currentObjectiveKeys: string[], dynamicConfig: { enabled?: boolean | undefined; addComplexityAt?: number | undefined; addEntropyAt?: number | undefined; dropEntropyOnStagnation?: number | undefined; readdEntropyAfter?: number | undefined; } | undefined) => void

Handle entropy removal and re-addition rules.

Parameters:

Returns: void.

resetObjectivesCache

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => void

Clear cached objectives so dynamic schedules can rebuild them.

Parameters:

Returns: void.

updateObjectiveScheduleAndAges

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, helpers: { applyDynamicObjectiveSchedule: (currentObjectiveKeys: string[]) => void; }) => Promise<void>

Update objective schedule, pending adds/removes, and objective ages.

Parameters:

Returns: void.

neat/neat.evolve.population.utils.ts

addOffspring

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, nextPopulation: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[], helpers: { addSpeciatedOffspring: (nextPopulation: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[], remainingSlots: number) => Promise<void>; addUnspeciatedOffspring: (nextPopulation: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[], remainingSlots: number) => Promise<void>; }) => Promise<void>

Add offspring to fill remaining population slots.

Parameters:

Returns: void.

addSpeciatedOffspring

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, nextPopulation: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[], remainingSlots: number, config: { minOffspringDefault: number; survivalThresholdDefault: number; youngThresholdDefault: number; youngMultiplierDefault: number; oldThresholdDefault: number; oldMultiplierDefault: number; crossSpeciesGuardLimit: number; }) => Promise<void>

Add offspring when speciation is enabled.

Parameters:

Returns: void.

addUnspeciatedOffspring

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, nextPopulation: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[], remainingSlots: number) => Promise<void>

Add offspring when speciation is disabled.

Parameters:

Returns: void.

applyElitism

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, nextPopulation: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[]) => void

Apply elitism for the next generation.

Parameters:

Returns: void.

applyProvenance

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, nextPopulation: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[]) => void

Add provenance genomes into the next population.

Parameters:

Returns: void.

buildNextPopulation

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, helpers: { applyElitism: (nextPopulation: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[]) => void; applyProvenance: (nextPopulation: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[]) => void; addOffspring: (nextPopulation: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[]) => Promise<void>; }) => Promise<import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[]>

Build the next population (elitism, provenance, offspring).

Parameters:

Returns: next population array.

buildSpeciesOffspring

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, survivors: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").GenomeWithMetadata[], speciesIndex: number, crossSpeciesProbability: number, crossSpeciesGuardLimit: number, survivalThresholdDefault: number) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").GenomeWithMetadata

Build a single offspring within a species.

Parameters:

Returns: offspring genome.

computeOffspringAllocation

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, remainingSlots: number, config: { minOffspringDefault: number; youngThresholdDefault: number; youngMultiplierDefault: number; oldThresholdDefault: number; oldMultiplierDefault: number; }) => number[]

Compute offspring allocation per species.

Parameters:

Returns: allocation per species index.

distributeRemainingSlots

(allocation: number[], rawShares: number[], remainingSlots: number) => void

Distribute leftover slots by fractional remainders.

Parameters:

Returns: void.

enforceMinimumOffspring

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, allocation: number[], remainingSlots: number, minOffspringDefault: number) => void

Enforce minimum offspring per species when possible.

Parameters:

Returns: void.

enforcePopulationConstraints

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, nextPopulation: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[]) => Promise<void>

Ensure new population meets structural constraints.

Parameters:

Returns: void.

selectSecondParent

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, survivors: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").GenomeWithMetadata[], speciesIndex: number, crossSpeciesProbability: number, crossSpeciesGuardLimit: number, survivalThresholdDefault: number) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").GenomeWithMetadata

Select a second parent, optionally from another species.

Parameters:

Returns: chosen parent genome.

trimOversubscription

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, allocation: number[], remainingSlots: number, minOffspringDefault: number) => void

Trim allocations when oversubscribed.

Parameters:

Returns: void.

neat/neat.evolve.runtime.utils.ts

buildFittestSnapshot

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default

Build a cloned Network from the current best genome.

Parameters:

Returns: best network snapshot.

clearPopulationScores

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => void

Clear genome scores to force re-evaluation.

Parameters:

Returns: void.

computeElapsedTime

(startTimestamp: number) => number

Compute elapsed time since the start of evolve().

Parameters:

Returns: elapsed time.

ensurePopulationEvaluated

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => Promise<void>

Ensure the population is evaluated before evolution operations.

Parameters:

Returns: void.

resolveStartTime

() => number

Resolve the start time for an evolution step.

Returns: timestamp in milliseconds or high-resolution units.

trackGlobalImprovement

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, snapshot: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default) => void

Track global best improvement for stagnation logic.

Parameters:

Returns: void.

updateGlobalBestTracking

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => void

Update generation-level best score tracking.

Parameters:

Returns: void.

neat/neat.evolve.speciation.utils.ts

applyGlobalStagnationInjectionIfNeeded

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, helpers: { buildFreshGenomeForStagnation: () => Promise<import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").GenomeWithMetadata>; replaceFraction: number; }) => Promise<void>

Apply global stagnation injection if configured.

Parameters:

Returns: void.

applySpeciationAndSharingIfEnabled

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, helpers: { applyAutoCompatibilityTuning: () => void; recordSpeciesHistorySnapshot: () => void; }) => Promise<void>

Apply speciation, fitness sharing, and related side effects.

Parameters:

Returns: void.

buildFreshGenomeForStagnation

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => Promise<import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").GenomeWithMetadata>

Build a fresh genome for stagnation injection.

Parameters:

Returns: new genome with minimum constraints.

ensureHiddenNodeVariance

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").GenomeWithMetadata) => Promise<void>

Ensure a minimal hidden-node variance in injected genomes.

Parameters:

Returns: void.

ensureSpeciesHistorySnapshot

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, maxHistory: number) => void

Ensure a minimal species history snapshot exists for exports.

Parameters:

Returns: void.

recordSpeciesHistorySnapshot

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, maxHistory: number) => void

Record a species history snapshot when needed.

Parameters:

Returns: void.

updateSpeciesStagnationIfEnabled

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => void

Update species stagnation status when speciation enabled.

Parameters:

Returns: void.

neat/neat.evolve.telemetry.utils.ts

computeDiversityStatsSafely

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => void

Compute diversity stats safely if the hook exists.

Parameters:

Returns: void.

recordTelemetryIfEnabled

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, snapshot: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default) => Promise<void>

Record telemetry if enabled.

Parameters:

Returns: void.

neat/neat.evolve.ts

evolve

() => Promise<import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default>

Run a single evolution step for this NEAT population.

This method performs a full generation update: evaluation (if needed), adaptive hooks, speciation and fitness sharing, multi-objective processing, elitism/provenance, offspring allocation (within or without species), mutation, pruning, and telemetry recording. It mutates the controller state (this.population, this.generation, and telemetry caches) and returns a copy of the best discovered Network for the generation.

Important side-effects:

Example: // assuming neat is an instance with configured population/options await neat.evolve(); console.log('generation:', neat.generation);

Returns: a deep-cloned Network representing the best genome in the previous generation (useful for evaluation)

EVOLVE_AUTO_COMPAT_ADJUST_RATE

EVOLVE_AUTO_COMPAT_MAX_COEFF

EVOLVE_AUTO_COMPAT_MIN_COEFF

EVOLVE_AUTO_COMPAT_RANDOM_SCALE

EVOLVE_AUTO_COMPAT_TARGET_MIN

EVOLVE_AUTO_ENTROPY_ADD_AT

EVOLVE_CROSS_SPECIES_GUARD_LIMIT

EVOLVE_DEFAULT_EPSILON_ADJUST

EVOLVE_DEFAULT_EPSILON_COOLDOWN

EVOLVE_DEFAULT_EPSILON_MAX

EVOLVE_DEFAULT_EPSILON_MIN

EVOLVE_GLOBAL_STAGNATION_REPLACE_FRACTION

EVOLVE_MIN_OFFSPRING_DEFAULT

EVOLVE_OLD_MULTIPLIER_DEFAULT

EVOLVE_OLD_THRESHOLD_DEFAULT

EVOLVE_PARETO_ARCHIVE_MAX

EVOLVE_PRUNE_RANGE_EPS_DEFAULT

EVOLVE_PRUNE_WINDOW_DEFAULT

EVOLVE_REENABLE_DELTA_SCALE

EVOLVE_REENABLE_MAX

EVOLVE_REENABLE_MIN

EVOLVE_REENABLE_MIN_SAMPLES

EVOLVE_REENABLE_TARGET

EVOLVE_SPECIES_HISTORY_MAX

EVOLVE_SURVIVAL_THRESHOLD_DEFAULT

EVOLVE_TARGET_FRONT_LOWER_RATIO

EVOLVE_TARGET_FRONT_MIN

EVOLVE_TARGET_FRONT_UPPER_RATIO

EVOLVE_YOUNG_MULTIPLIER_DEFAULT

EVOLVE_YOUNG_THRESHOLD_DEFAULT

neat/neat.evolve.types.ts

GenomeWithMetadata

Runtime interface for a genome carrying evolution metadata.

This mirrors the dynamic properties attached at runtime during evolution, without pulling in the full Genome class to avoid circular dependencies.

MultiObjectiveOptions

Multi-objective configuration block.

MutationMethod

Mutation method descriptor used by runtime mutation hooks.

NeatControllerForEvolution

NEAT controller subset used by evolve orchestrations.

ObjectiveDescriptor

Objective descriptor for multi-objective evaluation.

SpeciesHistoryRecord

Species history snapshot record used for telemetry/exports.

SpeciesWithMetadata

Runtime interface for species metadata used in allocation and stats.

neat/neat.evolve.utils.ts

adaptReenableProbability

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, config: { minSamples: number; target: number; min: number; max: number; deltaScale: number; }) => void

Adapt the re-enable probability based on recent success ratios.

Parameters:

Returns: void.

addOffspring

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, nextPopulation: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[], helpers: { addSpeciatedOffspring: (nextPopulation: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[], remainingSlots: number) => Promise<void>; addUnspeciatedOffspring: (nextPopulation: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[], remainingSlots: number) => Promise<void>; }) => Promise<void>

Add offspring to fill remaining population slots.

Parameters:

Returns: void.

addSpeciatedOffspring

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, nextPopulation: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[], remainingSlots: number, config: { minOffspringDefault: number; survivalThresholdDefault: number; youngThresholdDefault: number; youngMultiplierDefault: number; oldThresholdDefault: number; oldMultiplierDefault: number; crossSpeciesGuardLimit: number; }) => Promise<void>

Add offspring when speciation is enabled.

Parameters:

Returns: void.

addUnspeciatedOffspring

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, nextPopulation: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[], remainingSlots: number) => Promise<void>

Add offspring when speciation is disabled.

Parameters:

Returns: void.

applyAdaptiveComplexityControllers

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => Promise<void>

Apply adaptive complexity controllers if available.

Parameters:

Returns: void.

applyAncestorUniqAdaptiveSafe

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => Promise<void>

Apply ancestor uniqueness adaptation if available.

Parameters:

Returns: void.

applyAutoCompatibilityTuning

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, config: { targetMin: number; adjustRate: number; minCoeff: number; maxCoeff: number; randomScale: number; }) => void

Apply auto-compatibility tuning if enabled.

Parameters:

Returns: void.

applyDynamicObjectiveSchedule

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, currentObjectiveKeys: string[], config: { autoEntropyAddAt: number; }) => void

Apply dynamic objective scheduling and entropy rules.

Parameters:

Returns: void.

applyElitism

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, nextPopulation: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[]) => void

Apply elitism for the next generation.

Parameters:

Returns: void.

applyFitnessSuppressionForTests

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => void

Suppress fitness objective for specific test scenarios.

Parameters:

Returns: void.

applyGlobalStagnationInjectionIfNeeded

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, helpers: { buildFreshGenomeForStagnation: () => Promise<import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").GenomeWithMetadata>; replaceFraction: number; }) => Promise<void>

Apply global stagnation injection if configured.

Parameters:

Returns: void.

applyMinimalCriterionAdaptiveSafe

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => Promise<void>

Apply minimal criterion adaptive controller if available.

Parameters:

Returns: void.

applyOperatorAdaptationSafe

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => Promise<void>

Apply operator adaptation if available.

Parameters:

Returns: void.

applyProvenance

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, nextPopulation: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[]) => void

Add provenance genomes into the next population.

Parameters:

Returns: void.

applyPruningAndMutation

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => Promise<void>

Apply pruning and mutation phases.

Parameters:

Returns: void.

applySpeciationAndSharingIfEnabled

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, helpers: { applyAutoCompatibilityTuning: () => void; recordSpeciesHistorySnapshot: () => void; }) => Promise<void>

Apply speciation, fitness sharing, and related side effects.

Parameters:

Returns: void.

buildFittestSnapshot

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default

Build a cloned Network from the current best genome.

Parameters:

Returns: best network snapshot.

buildFreshGenomeForStagnation

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => Promise<import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").GenomeWithMetadata>

Build a fresh genome for stagnation injection.

Parameters:

Returns: new genome with minimum constraints.

buildNextPopulation

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, helpers: { applyElitism: (nextPopulation: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[]) => void; applyProvenance: (nextPopulation: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[]) => void; addOffspring: (nextPopulation: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[]) => Promise<void>; }) => Promise<import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[]>

Build the next population (elitism, provenance, offspring).

Parameters:

Returns: next population array.

captureObjectiveImportanceSnapshot

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => void

Capture objective importance stats for telemetry.

Parameters:

Returns: void.

clearPopulationScores

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => void

Clear genome scores to force re-evaluation.

Parameters:

Returns: void.

computeDiversityStatsSafely

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => void

Compute diversity stats safely if the hook exists.

Parameters:

Returns: void.

computeElapsedTime

(startTimestamp: number) => number

Compute elapsed time since the start of evolve().

Parameters:

Returns: elapsed time.

enforcePopulationConstraints

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, nextPopulation: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[]) => Promise<void>

Ensure new population meets structural constraints.

Parameters:

Returns: void.

ensurePopulationEvaluated

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => Promise<void>

Ensure the population is evaluated before evolution operations.

Parameters:

Returns: void.

ensureSpeciesHistorySnapshot

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, maxHistory: number) => void

Ensure a minimal species history snapshot exists for exports.

Parameters:

Returns: void.

invalidateCompatibilityCaches

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => void

Invalidate compatibility caches after mutations.

Parameters:

Returns: void.

processMultiObjective

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, config: { paretoArchiveMax: number; targetFrontMin: number; targetFrontUpperRatio: number; targetFrontLowerRatio: number; defaultEpsilonAdjust: number; defaultEpsilonMin: number; defaultEpsilonMax: number; defaultEpsilonCooldown: number; pruneWindowDefault: number; pruneRangeEpsDefault: number; }) => void

Run multi-objective ranking, crowding distance, and archives.

Parameters:

Returns: void.

recordSpeciesHistorySnapshot

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, maxHistory: number) => void

Record a species history snapshot when needed.

Parameters:

Returns: void.

recordTelemetryIfEnabled

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, snapshot: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default) => Promise<void>

Record telemetry if enabled.

Parameters:

Returns: void.

resetObjectivesCache

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => void

Clear cached objectives so dynamic schedules can rebuild them.

Parameters:

Returns: void.

resolveStartTime

() => number

Resolve the start time for an evolution step.

Returns: timestamp in milliseconds or high-resolution units.

trackGlobalImprovement

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, snapshot: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default) => void

Track global best improvement for stagnation logic.

Parameters:

Returns: void.

updateGlobalBestTracking

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => void

Update generation-level best score tracking.

Parameters:

Returns: void.

updateObjectiveScheduleAndAges

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, helpers: { applyDynamicObjectiveSchedule: (currentObjectiveKeys: string[]) => void; }) => Promise<void>

Update objective schedule, pending adds/removes, and objective ages.

Parameters:

Returns: void.

updateSpeciesStagnationIfEnabled

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution) => void

Update species stagnation status when speciation enabled.

Parameters:

Returns: void.

neat/neat.export.ts

exportPopulation

() => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.export").GenomeJSON[]

Export the current population (array of genomes) into plain JSON objects. Each genome is converted via its toJSON() method. You can persist this result (e.g. to disk, a database, or localStorage) and later rehydrate it with {@link importPopulation}.

Why export population only? Sometimes you want to snapshot just the set of candidate solutions (e.g. for ensemble evaluation) without freezing the innovation counters or hyper‑parameters.

Example:

// Assuming `neat` is an instance exposing this helper
const popSnapshot = neat.exportPopulation();
fs.writeFileSync('population.json', JSON.stringify(popSnapshot, null, 2));

Returns: Array of genome JSON objects.

exportState

() => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.export").NeatStateJSON

Convenience helper that returns a full evolutionary snapshot: both NEAT meta information and the serialized population array. Use this when you want a truly pause‑and‑resume capability including innovation bookkeeping.

Example:

const state = neat.exportState();
fs.writeFileSync('state.json', JSON.stringify(state));
// ...later / elsewhere...
const raw = JSON.parse(fs.readFileSync('state.json','utf8')) as NeatStateJSON;
const neat2 = Neat.importState(raw, fitnessFn); // identical evolutionary context

fromJSONImpl

(neatJSON: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.export").NeatMetaJSON, fitnessFunction: (network: GenomeWithSerialization) => number | Promise<number>) => NeatControllerForExport

Static-style implementation that rehydrates a NEAT instance from previously exported meta JSON produced by {@link toJSONImpl}. This does not restore a population; callers typically follow up with importPopulation or use {@link importStateImpl} for a complete restore.

Example:

const meta: NeatMetaJSON = JSON.parse(fs.readFileSync('neat-meta.json','utf8'));
const neat = Neat.fromJSONImpl(meta, fitnessFn); // empty population, same innovations
neat.importPopulation(popSnapshot); // optional

Parameters:

Returns: Fresh NEAT instance with restored innovation history.

GenomeJSON

JSON representation of an individual genome (network). The concrete shape is produced by Network#toJSON() and re‑hydrated via Network.fromJSON(). We use an open record signature here because the network architecture may evolve with plugins / future features (e.g. CPPNs, substrate metadata, ONNX export tags).

GenomeWithSerialization

Genome with toJSON serialization method.

importPopulation

(populationJSON: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.export").GenomeJSON[]) => Promise<void>

Import (replace) the current population from an array of serialized genomes. This does not touch NEAT meta state (generation, innovations, etc.)—only the population array and implied popsize are updated.

Example:

const populationData: GenomeJSON[] = JSON.parse(fs.readFileSync('population.json','utf8'));
neat.importPopulation(populationData); // population replaced
neat.evolve(); // continue evolving with new starting genomes

Edge cases handled:

Parameters:

importStateImpl

(stateBundle: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.export").NeatStateJSON, fitnessFunction: (network: GenomeWithSerialization) => number | Promise<number>) => Promise<NeatControllerForExport>

Static-style helper that rehydrates a full evolutionary state previously produced by {@link exportState}. Invoke this with the NEAT class (not an instance) bound as this, e.g. Neat.importStateImpl(bundle, fitnessFn). It constructs a new NEAT instance using the meta data, then imports the population (if present).

Safety & validation:

Example:

const bundle: NeatStateJSON = JSON.parse(fs.readFileSync('state.json','utf8'));
const neat = Neat.importStateImpl(bundle, fitnessFn);
neat.evolve();

Parameters:

Returns: Rehydrated NEAT instance ready to continue evolving.

InnovationMapEntry

Connection innovation map entry.

NeatConstructor

NEAT class constructor interface.

NeatControllerForExport

NEAT controller interface for export operations.

NeatMetaJSON

Serialized meta information describing a NEAT run, excluding the concrete population genomes. This allows you to persist & resume experiment context (innovation history, current generation, IO sizes, hyper‑parameters) without committing to a particular population snapshot.

NeatStateJSON

Top‑level bundle containing both NEAT meta information and the full array of serialized genomes (population). This is what you get from exportState() and feed into importStateImpl() to resume exactly where you left off.

NetworkClass

Network class with static fromJSON method.

toJSONImpl

() => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.export").NeatMetaJSON

Serialize NEAT meta (excluding the mutable population) for persistence of innovation history and experiment configuration. This is sufficient to recreate a blank NEAT run at the same evolutionary generation with the same innovation counters, enabling deterministic continuation when combined later with a saved population.

Example:

const meta = neat.toJSONImpl();
fs.writeFileSync('neat-meta.json', JSON.stringify(meta));
// ... later ...
const metaLoaded = JSON.parse(fs.readFileSync('neat-meta.json','utf8')) as NeatMetaJSON;
const neat2 = Neat.fromJSONImpl(metaLoaded, fitnessFn); // empty population

neat/neat.harness.types.ts

LineageTrackedNetwork

Network subtype that surfaces lineage metadata fields for assertions.

NeatLineageHarness

Narrow Neat surface exposing lineage helper methods used in tests.

PhasedComplexityHarness

Minimal surface exposing phased complexity internals for testing.

neat/neat.helpers.ts

addGenome

(genome: GenomeWithMetadata, parents: number[] | undefined) => void

Register an externally constructed genome (e.g., deserialized, custom‑built, or imported from another run) into the active population. Ensures lineage metadata and structural invariants are consistent with internally spawned genomes.

Defensive design: If invariant enforcement fails, the genome is still added (best effort) so experiments remain reproducible and do not abort mid‑run. Caller can optionally inspect or prune later during evaluation.

Parameters:

createPool

(seedNetwork: GenomeWithMetadata | null) => void

Create (or reset) the initial population pool for a NEAT run.

If a seedNetwork is supplied, every genome is a structural + weight clone of that seed. This is useful for transfer learning or continuing evolution from a known good architecture. When omitted, brand‑new minimal networks are synthesized using the configured input/output sizes (and optional minimum hidden layer size).

Design notes:

Parameters:

GenomeWithMetadata

Genome with NEAT-specific metadata and methods.

MutationMethod

Mutation method with optional name.

NeatControllerForHelpers

NEAT controller interface for helper functions.

spawnFromParent

(parentGenome: GenomeWithMetadata, mutateCount: number) => Promise<GenomeWithMetadata>

Helper utilities that augment the core NEAT (NeuroEvolution of Augmenting Topologies) implementation. These functions are kept separate from the main class so they can be tree‑shaken when unused and independently documented for educational purposes.

The helpers focus on three core lifecycle operations:

  1. Spawning children from an existing parent genome with mutation ("sexual" reproduction not handled here).
  2. Registering externally created genomes so lineage & invariants remain consistent.
  3. Creating the initial population pool (bootstrapping evolution) either from a seed network or by synthesizing fresh minimal networks.

All helpers expect to be invoked with a this context that matches NeatLike. They intentionally use defensive try/catch blocks to avoid aborting broader evolutionary runs when an individual genome operation fails; this mirrors the tolerant/robust nature of many historical NEAT library implementations.

neat/neat.lineage.ts

buildAnc

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.lineage.utils").GenomeLike) => Set<number>

Build the (shallow) ancestor ID set for a single genome using breadth‑first traversal.

Traversal Strategy:

  1. Seed queue with the genome's parent IDs (depth = 1).
  2. Repeatedly dequeue, record its ID, and enqueue its parents with incremented depth.
  3. Stop exploring a branch once the configured depth window is exceeded.

This bounded BFS gives a quick, memory‑friendly approximation of a genome's lineage neighborhood that works well for diversity/uniqueness metrics without the expense of full historical graphs.

Edge Cases:

Complexity (worst case): O(B^D) where B is average branching factor of parent links (usually <= 2) and D = ANCESTOR_DEPTH_WINDOW (default 4) – so effectively constant for typical NEAT usage.

Parameters:

Returns: A Set of numeric ancestor IDs (deduplicated).

computeAncestorUniqueness

() => number

Compute an "ancestor uniqueness" diversity metric for the current population.

The metric = mean Jaccard distance between shallow ancestor sets of randomly sampled genome pairs. A higher value indicates that individuals trace back to more distinct recent lineages (i.e. less overlap in their ancestor windows), while a lower value indicates convergence toward similar ancestry.

Why Jaccard Distance? It is scale‑independent: adding unrelated ancestors to both sets simultaneously does not change the proportion of shared ancestry, and distance stays within [0,1].

Sampling Strategy:

Edge Cases:

Performance: O(S * W) where S is sampled pair count (≤ 30) and W is bounded ancestor set size (kept small by the depth window). This is intentionally lightweight for per‑generation telemetry.

Parameters:

Returns: Mean Jaccard distance in [0,1]. Higher ⇒ more lineage uniqueness / diversity.

GenomeLike

Lineage / ancestry helper utilities for NEAT populations.

This module centralizes helper logic used by the public lineage APIs to keep the main entry file small and orchestration-focused.

NeatLineageContext

Expected this context for lineage helpers (a subset of the NEAT instance).

neat/neat.lineage.utils.ts

AncestorQueueEntry

Queue entry for ancestor traversal.

calculateMaxSamplePairs

(size: number) => number

Parameters:

Returns: Upper bound on the number of sampled pairs.

collectAncestorIds

(queueEntries: AncestorQueueEntry[], population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.lineage.utils").GenomeLike[]) => Set<number>

Parameters:

Returns: Unique ancestor IDs encountered within the window.

computeAverageDistance

(distances: number[]) => number

Parameters:

Returns: Mean distance rounded to the configured decimal places.

computeJaccardDistance

(ancestorSetA: Set<number>, ancestorSetB: Set<number>) => number

Parameters:

Returns: Jaccard distance for the two sets.

computePairDistance

(pair: GenomeIndexPair, population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.lineage.utils").GenomeLike[], buildAncestorSet: (genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.lineage.utils").GenomeLike) => Set<number>) => number | undefined

Parameters:

Returns: Jaccard distance or undefined when skipped.

computePairDistances

(pairs: GenomeIndexPair[], population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.lineage.utils").GenomeLike[], buildAncestorSet: (genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.lineage.utils").GenomeLike) => Set<number>) => number[]

Parameters:

Returns: Jaccard distances for valid pairs.

countIntersection

(ancestorSetA: Set<number>, ancestorSetB: Set<number>) => number

Parameters:

Returns: Size of intersection between the sets.

createInitialQueue

(parentIds: number[], population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.lineage.utils").GenomeLike[]) => AncestorQueueEntry[]

Parameters:

Returns: Queue entries at depth 1.

enqueueParentEntries

(queueEntries: AncestorQueueEntry[], currentEntry: AncestorQueueEntry, population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.lineage.utils").GenomeLike[]) => void

Parameters:

findGenomeById

(population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.lineage.utils").GenomeLike[], genomeId: number) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.lineage.utils").GenomeLike | undefined

Parameters:

Returns: Genome reference if found.

GenomeIndexPair

Index pair representing a sampled genome pair.

GenomeLike

Lineage / ancestry helper utilities for NEAT populations.

This module centralizes helper logic used by the public lineage APIs to keep the main entry file small and orchestration-focused.

hasMinimumPopulation

(size: number) => boolean

Parameters:

Returns: True when at least two genomes exist.

isEmptyAncestorPair

(ancestorSetA: Set<number>, ancestorSetB: Set<number>) => boolean

Parameters:

Returns: True when both sets are empty.

isWithinDepthWindow

(depth: number) => boolean

Parameters:

Returns: True when within the configured depth window.

NeatLineageContext

Expected this context for lineage helpers (a subset of the NEAT instance).

normalizeParentIds

(value: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.lineage.utils").GenomeLike) => number[]

Parameters:

Returns: Parent ID list (empty when absent).

pickDistinctIndex

(randomNumber: () => number, size: number, firstIndex: number) => number

Parameters:

Returns: Random index not equal to the first index.

pickRandomIndex

(randomNumber: () => number, size: number) => number

Parameters:

Returns: Random index within bounds.

resolveParentIds

(value: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.lineage.utils").GenomeLike | undefined) => number[]

Parameters:

Returns: Parent IDs when available.

sampleGenomePairs

(sampleCount: number, size: number, rngFactory: () => () => number) => GenomeIndexPair[]

Parameters:

Returns: Array of sampled index pairs.

neat/neat.multiobjective.archive.utils.ts

archiveParetoFrontsIfEnabled

(neatInstance: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.types.utils").NeatLikeWithMultiObjective, fronts: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[][]) => void

Archives a compact snapshot of the current Pareto fronts when multi-objective mode is enabled.

This is intended for visualization/debugging:

Behavior note:

Parameters:

MAX_PARETO_ARCHIVE_FRONTS

MAX_PARETO_ARCHIVE_LENGTH

neat/neat.multiobjective.category.utils.ts

adaptDominanceEpsilon

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, paretoFronts: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").GenomeWithMetadata[][], config: { targetFrontMin: number; targetFrontUpperRatio: number; targetFrontLowerRatio: number; defaultEpsilonAdjust: number; defaultEpsilonMin: number; defaultEpsilonMax: number; defaultEpsilonCooldown: number; }) => void

Adapt dominance epsilon based on Pareto front size.

Parameters:

Returns: void.

computeCrowdingDistances

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, populationSnapshot: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").GenomeWithMetadata[], paretoFronts: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").GenomeWithMetadata[][], objectives: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").ObjectiveDescriptor[]) => number[]

Compute crowding distances for multi-objective fronts.

Parameters:

Returns: crowding distances aligned with population order.

processMultiObjective

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, config: { paretoArchiveMax: number; targetFrontMin: number; targetFrontUpperRatio: number; targetFrontLowerRatio: number; defaultEpsilonAdjust: number; defaultEpsilonMin: number; defaultEpsilonMax: number; defaultEpsilonCooldown: number; pruneWindowDefault: number; pruneRangeEpsDefault: number; }) => void

Run multi-objective ranking, crowding distance, and archives.

Parameters:

Returns: void.

pruneInactiveObjectives

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, config: { pruneWindowDefault: number; pruneRangeEpsDefault: number; }) => void

Prune objectives that have collapsed ranges over a window.

Parameters:

Returns: void.

recordParetoArchives

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, paretoFronts: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").GenomeWithMetadata[][], objectives: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").ObjectiveDescriptor[], archiveMax: number) => void

Record Pareto front archives for telemetry.

Parameters:

Returns: void.

sortPopulationByPareto

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").NeatControllerForEvolution, populationSnapshot: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.evolve.types").GenomeWithMetadata[], crowdingDistances: number[]) => void

Sort population by Pareto rank and crowding distance.

Parameters:

Returns: void.

neat/neat.multiobjective.crowding.utils.ts

accumulateCrowdingForObjective

(sortedFront: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[], valuesMatrixInput: number[][], genomeIndexByReference: Map<import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default, number>, objectiveIndex: number) => void

Accumulates crowding distance contributions for a single objective.

Pre-conditions / expectations:

Edge cases:

Parameters:

accumulateInteriorCrowding

(sortedFront: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[], valuesMatrixInput: number[][], genomeIndexByReference: Map<import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default, number>, objectiveIndex: number, valueRange: number) => void

Accumulates crowding deltas for the interior genomes of a sorted front.

Interior genomes receive a normalized spacing delta: delta = (nextValue - previousValue) / valueRange.

Parameters:

applyCrowdingDelta

(currentGenome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.types.utils").NetworkWithMOAnnotations, previousValue: number, nextValue: number, valueRange: number) => void

Applies a normalized crowding-distance delta to a genome.

If the genome’s crowding distance is Infinity, it will remain Infinity. This helper only updates when _moCrowd is initialized.

Parameters:

applyCrowdingForObjective

(front: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[], valuesMatrixInput: number[][], genomeIndexByReference: Map<import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default, number>, objectiveIndex: number) => void

Applies crowding-distance accumulation for a single objective within a single front.

Parameters:

assignCrowdingDistances

(fronts: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[][], valuesMatrixInput: number[][], descriptors: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.types.utils").ObjectiveDescriptor[], population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[]) => void

Assigns crowding-distance annotations for each Pareto front.

This implements the crowding distance component of NSGA-II selection. Each genome in each front receives a _moCrowd value representing how isolated it is in objective space within its front.

Notes:

Side effects:

Parameters:

assignCrowdingForFront

(front: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[], valuesMatrixInput: number[][], genomeIndexByReference: Map<import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default, number>, objectiveIndices: number[]) => void

Assigns crowding distances for a single front across all objectives.

Parameters:

buildGenomeIndexByReference

(population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[]) => Map<import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default, number>

Builds a stable mapping from genome object references to their population index.

This relies on object identity (reference equality), not structural equality. It is used to resolve objective values from a values matrix when working with reordered views (e.g., sorted fronts).

Parameters:

Returns: Map from genome references to their index.

buildInteriorIndexRange

(frontLength: number) => number[]

Builds the index range for interior genomes of a front.

Boundary genomes are excluded because their crowding distance is treated as infinite.

Parameters:

Returns: Interior indices excluding boundary genomes.

buildObjectiveIndexRange

(objectiveCount: number) => number[]

Builds a stable objective index range.

Parameters:

Returns: Objective indices 0..objectiveCount-1.

buildSortedFrontByObjective

(front: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[], valuesMatrixInput: number[][], genomeIndexByReference: Map<import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default, number>, objectiveIndex: number) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[]

Builds a copy of the front sorted by the specified objective.

Sorting is ascending by the raw objective value. This ordering is used for computing neighbor spacing in objective space.

Parameters:

Returns: Front sorted by objective value.

compareObjectiveValuesForCrowding

(valuesMatrixInput: number[][], genomeIndexByReference: Map<import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default, number>, objectiveIndex: number, leftGenome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default, rightGenome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default) => number

Comparator used to sort genomes by a specific objective value.

Parameters:

Returns: Numeric sort comparison value (ascending).

initializeCrowding

(front: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[]) => void

Initializes crowding-distance annotations for a front.

This sets each genome’s _moCrowd to 0. Later steps accumulate per- objective spacing deltas.

Parameters:

markBoundaryCrowding

(sortedFront: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[]) => void

Marks the boundary genomes of a sorted front as infinitely crowded.

In NSGA-II style crowding distance, boundary solutions (extremes for the objective) are assigned an infinite crowding distance to ensure they are always preferred when ranks tie.

Parameters:

resolveBoundaryGenomes

(sortedFront: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[]) => { firstGenome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default; lastGenome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default; } | null

Resolves the boundary (first/last) genomes for a sorted front.

Parameters:

Returns: Boundary genomes, or null if the front is empty.

resolveGenomeIndex

(genomeIndexByReference: Map<import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default, number>, genomeItem: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default) => number

Resolves a genome’s index using a reference-based map.

Parameters:

Returns: The population index of the genome.

resolveNeighborPair

(sortedFront: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[], sortedIndex: number) => { previousGenome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default; nextGenome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default; }

Resolves the neighbor genomes for an interior element of a sorted front.

Parameters:

Returns: Previous and next neighbor genomes.

resolveObjectiveRange

(minValue: number, maxValue: number) => number

Resolves a non-zero objective range used to normalize crowding deltas.

If all genomes have the same objective value, the raw range is 0. This returns 1 in that case to avoid division by zero while still producing a well-defined crowding delta of 0.

Parameters:

Returns: Normalized range with a non-zero floor.

resolveObjectiveRangeFromBoundaries

(valuesMatrixInput: number[][], genomeIndexByReference: Map<import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default, number>, boundaryGenomes: { firstGenome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default; lastGenome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default; }, objectiveIndex: number) => number

Resolves the normalized objective range for a front from its boundary genomes.

Because sortedFront is sorted by objective, the first and last genomes are the extrema used for range normalization.

Parameters:

Returns: Normalized value range for the objective.

resolveObjectiveValue

(valuesMatrixInput: number[][], genomeIndexByReference: Map<import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default, number>, genomeItem: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default, objectiveIndex: number) => number

Resolves an objective value for a genome from a values matrix.

This is a convenience helper for working with sorted/reordered views of the population while keeping objective values in a dense matrix.

Parameters:

Returns: The objective value for the genome.

shouldSkipCrowdingFront

(front: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[]) => boolean

Determines whether crowding-distance processing should be skipped for a front.

Parameters:

Returns: true if the front should be skipped.

neat/neat.multiobjective.dominance.utils.ts

applyPairwiseDominance

(dominanceState: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.dominance.utils").DominanceState, valuesMatrixInput: number[][], descriptors: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.types.utils").ObjectiveDescriptor[], candidateIndex: number, opponentIndex: number) => void

Applies a single pairwise dominance update between candidate and opponent.

If the candidate dominates the opponent, the opponent index is appended to dominatedIndicesByIndex[candidateIndex]. If the candidate is dominated by the opponent, dominationCounts[candidateIndex] is incremented.

Parameters:

buildDominanceState

(valuesMatrixInput: number[][], descriptors: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.types.utils").ObjectiveDescriptor[]) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.dominance.utils").DominanceState

Builds dominance bookkeeping structures used by fast non-dominated sorting.

This computes (pairwise):

Complexity:

Assumptions:

Parameters:

Returns: Dominance bookkeeping structures for ranking.

buildIndexRange

(populationSize: number) => number[]

Builds a stable index range for iterating the population.

Parameters:

Returns: Array of indices 0..populationSize-1.

compareObjectiveValues

(direction: "max" | "min", candidateValue: number, opponentValue: number) => { isDominated: boolean; isStrictlyBetter: boolean; }

Compares a candidate and opponent value for a single objective.

This does not compute full Pareto dominance; it returns per-objective flags used by the vector-level dominance check.

Parameters:

Returns: Comparison flags for this objective.

createEmptyDominanceState

(populationSize: number) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.dominance.utils").DominanceState

Creates an empty dominance state container sized to the population.

Parameters:

Returns: An initialized dominance state with zeroed counts.

DominanceState

Dominance bookkeeping structures for fast non-dominated sorting.

These structures are typically produced once per generation (from the values matrix) and then consumed to build Pareto fronts.

isCandidateDominatedByObjective

(direction: "max" | "min", candidateValue: number, opponentValue: number) => boolean

Checks if the candidate is worse than the opponent for a single objective.

For dominance, being worse on any objective makes the candidate unable to dominate the opponent.

Parameters:

Returns: true if the candidate is dominated for this objective.

isCandidateStrictlyBetterForObjective

(direction: "max" | "min", candidateValue: number, opponentValue: number) => boolean

Checks if the candidate is strictly better than the opponent for a single objective.

Strict improvement in at least one objective is required for Pareto dominance when the candidate is not worse in any objective.

Parameters:

Returns: true if the candidate is strictly better for this objective.

isNonDominatedCandidate

(dominanceState: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.dominance.utils").DominanceState, candidateIndex: number) => boolean

Determines whether a candidate has zero domination count.

Parameters:

Returns: true if the candidate is currently non-dominated.

resolveDominanceOutcome

(candidateVector: number[], opponentVector: number[], descriptors: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.types.utils").ObjectiveDescriptor[]) => "dominates" | "dominated" | "indifferent"

Resolves dominance outcome between two objective vectors.

Outcome meanings:

Parameters:

Returns: Dominance outcome between candidate and opponent.

resolveObjectiveDirection

(descriptors: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.types.utils").ObjectiveDescriptor[], objectiveIndex: number) => "max" | "min"

Resolves the objective direction for a given objective index.

If a descriptor omits direction, it is treated as maximization.

Parameters:

Returns: Normalized objective direction.

shouldSkipSelfComparison

(candidateIndex: number, opponentIndex: number) => boolean

Determines whether a pairwise comparison should be skipped.

Currently this skips only self-comparisons.

Parameters:

Returns: true if the pair should be skipped.

updateDominanceForCandidate

(dominanceState: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.dominance.utils").DominanceState, valuesMatrixInput: number[][], descriptors: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.types.utils").ObjectiveDescriptor[], candidateIndex: number, candidateIndices: number[]) => void

Updates dominance bookkeeping for a candidate against all opponents.

This iterates every opponent index and applies a pairwise dominance update. Self-comparisons are ignored.

Parameters:

updateStrictImprovement

(hasStrictImprovement: boolean, isStrictlyBetter: boolean) => boolean

Accumulates whether the candidate has any strict improvement across objectives.

Parameters:

Returns: Updated strict-improvement flag.

vectorDominates

(valuesA: number[], valuesB: number[], descriptors: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.types.utils").ObjectiveDescriptor[]) => boolean

Determines whether vector A Pareto-dominates vector B.

A dominates B iff:

Assumptions:

Parameters:

Returns: true if A dominates B; otherwise false.

neat/neat.multiobjective.fronts.utils.ts

annotateGenomeRank

(population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[], genomeIndex: number, frontRank: number) => void

Annotates a genome with its Pareto front rank.

Parameters:

appendFront

(paretoFronts: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[][], population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[], currentFrontIndices: number[]) => void

Appends the current front (index list) as genome references to the paretoFronts accumulator.

Parameters:

buildNextFrontIndices

(population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[], dominanceState: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.dominance.utils").DominanceState, currentFrontIndices: number[], currentFrontRank: number) => number[]

Builds the next front by applying rank annotations and dominance updates.

Parameters:

Returns: Indices for the next front.

buildParetoFronts

(population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[], dominanceState: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.dominance.utils").DominanceState, maxFrontRankGuard: number) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[][]

Builds Pareto fronts from a precomputed dominance state.

This performs the “peeling” phase of fast non-dominated sorting:

Side effects:

Guard:

Parameters:

Returns: Ordered Pareto fronts (rank order).

collectNextFrontIndices

(dominanceState: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.dominance.utils").DominanceState, genomeIndex: number, nextFrontIndices: number[]) => void

Collects indices that become non-dominated after removing the current genome’s dominance influence.

Parameters:

incrementFrontRank

(currentFrontRank: number) => number

Increments the front rank counter.

Parameters:

Returns: Incremented front rank.

MAX_PARETO_FRONT_RANK_GUARD

shouldStopFrontRanking

(currentFrontRank: number, maxFrontRankGuard: number) => boolean

Determines whether ranking should stop due to a safety guard.

Parameters:

Returns: true if ranking should stop.

neat/neat.multiobjective.objectives.utils.ts

buildGenomeValues

(genomeItem: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default, descriptors: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.types.utils").ObjectiveDescriptor[]) => number[]

Builds an objective vector for a single genome.

The resulting array order matches the descriptors order exactly. Each component is read via {@link readObjectiveValue} so individual objective accessors are fault-tolerant.

Parameters:

Returns: Objective value vector (length equals descriptors.length).

buildValuesMatrix

(population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[], descriptors: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.types.utils").ObjectiveDescriptor[]) => number[][]

Builds a population-wide objective value matrix.

The resulting matrix is indexed as [genomeIndex][objectiveIndex] where genomeIndex matches the input population order.

Parameters:

Returns: Objective values matrix.

readObjectiveValue

(genomeItem: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default, descriptor: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.types.utils").ObjectiveDescriptor) => number

Safely reads a single objective value for a given genome.

This wraps the descriptor accessor in a try/catch so that a buggy objective function cannot crash multi-objective ranking.

Notes:

Parameters:

Returns: Numeric objective value; 0 if the accessor throws.

neat/neat.multiobjective.ts

fastNonDominated

(pop: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[]) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[][]

Perform fast non-dominated sorting and compute crowding distances for a population of networks (genomes). This implements a standard NSGA-II style non-dominated sorting followed by crowding distance assignment.

The function annotates genomes with two fields used elsewhere in the codebase:

Example

// inside a Neat class that exposes `_getObjectives()` and `options`
const fronts = fastNonDominated.call(neatInstance, population);
// fronts[0] is the Pareto-optimal set

Notes for documentation generation:

Parameters:

Returns: Array of Pareto fronts; each front is an array of Network genomes.

neat/neat.multiobjective.types.utils.ts

NeatLikeWithMultiObjective

Minimal Neat-like interface required by the multi-objective helpers.

This intentionally models only the fields used for archiving Pareto fronts and retrieving objective descriptors. It allows these helpers to be used without depending on the full Neat class type.

NetworkWithMOAnnotations

Extends a genome/network with multi-objective annotations.

These properties are used as transient metadata during selection.

ObjectiveDescriptor

Describes how to evaluate a single objective for a genome.

The order of objective descriptors defines the order of each genome’s objective vector and therefore the columns of the values matrix.

Notes:

neat/neat.multiobjective.utils.ts

accumulateCrowdingForObjective

(sortedFront: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[], valuesMatrixInput: number[][], genomeIndexByReference: Map<import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default, number>, objectiveIndex: number) => void

Accumulates crowding distance contributions for a single objective.

Pre-conditions / expectations:

Edge cases:

Parameters:

archiveParetoFrontsIfEnabled

(neatInstance: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.types.utils").NeatLikeWithMultiObjective, fronts: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[][]) => void

Archives a compact snapshot of the current Pareto fronts when multi-objective mode is enabled.

This is intended for visualization/debugging:

Behavior note:

Parameters:

assignCrowdingDistances

(fronts: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[][], valuesMatrixInput: number[][], descriptors: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.types.utils").ObjectiveDescriptor[], population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[]) => void

Assigns crowding-distance annotations for each Pareto front.

This implements the crowding distance component of NSGA-II selection. Each genome in each front receives a _moCrowd value representing how isolated it is in objective space within its front.

Notes:

Side effects:

Parameters:

buildDominanceState

(valuesMatrixInput: number[][], descriptors: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.types.utils").ObjectiveDescriptor[]) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.dominance.utils").DominanceState

Builds dominance bookkeeping structures used by fast non-dominated sorting.

This computes (pairwise):

Complexity:

Assumptions:

Parameters:

Returns: Dominance bookkeeping structures for ranking.

buildGenomeIndexByReference

(population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[]) => Map<import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default, number>

Builds a stable mapping from genome object references to their population index.

This relies on object identity (reference equality), not structural equality. It is used to resolve objective values from a values matrix when working with reordered views (e.g., sorted fronts).

Parameters:

Returns: Map from genome references to their index.

buildGenomeValues

(genomeItem: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default, descriptors: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.types.utils").ObjectiveDescriptor[]) => number[]

Builds an objective vector for a single genome.

The resulting array order matches the descriptors order exactly. Each component is read via {@link readObjectiveValue} so individual objective accessors are fault-tolerant.

Parameters:

Returns: Objective value vector (length equals descriptors.length).

buildParetoFronts

(population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[], dominanceState: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.dominance.utils").DominanceState, maxFrontRankGuard: number) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[][]

Builds Pareto fronts from a precomputed dominance state.

This performs the “peeling” phase of fast non-dominated sorting:

Side effects:

Guard:

Parameters:

Returns: Ordered Pareto fronts (rank order).

buildValuesMatrix

(population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[], descriptors: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.types.utils").ObjectiveDescriptor[]) => number[][]

Builds a population-wide objective value matrix.

The resulting matrix is indexed as [genomeIndex][objectiveIndex] where genomeIndex matches the input population order.

Parameters:

Returns: Objective values matrix.

DominanceState

Dominance bookkeeping structures for fast non-dominated sorting.

These structures are typically produced once per generation (from the values matrix) and then consumed to build Pareto fronts.

initializeCrowding

(front: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[]) => void

Initializes crowding-distance annotations for a front.

This sets each genome’s _moCrowd to 0. Later steps accumulate per- objective spacing deltas.

Parameters:

markBoundaryCrowding

(sortedFront: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default[]) => void

Marks the boundary genomes of a sorted front as infinitely crowded.

In NSGA-II style crowding distance, boundary solutions (extremes for the objective) are assigned an infinite crowding distance to ensure they are always preferred when ranks tie.

Parameters:

MAX_PARETO_ARCHIVE_FRONTS

MAX_PARETO_ARCHIVE_LENGTH

MAX_PARETO_FRONT_RANK_GUARD

NeatLikeWithMultiObjective

Minimal Neat-like interface required by the multi-objective helpers.

This intentionally models only the fields used for archiving Pareto fronts and retrieving objective descriptors. It allows these helpers to be used without depending on the full Neat class type.

NetworkWithMOAnnotations

Extends a genome/network with multi-objective annotations.

These properties are used as transient metadata during selection.

ObjectiveDescriptor

Describes how to evaluate a single objective for a genome.

The order of objective descriptors defines the order of each genome’s objective vector and therefore the columns of the values matrix.

Notes:

readObjectiveValue

(genomeItem: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default, descriptor: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.types.utils").ObjectiveDescriptor) => number

Safely reads a single objective value for a given genome.

This wraps the descriptor accessor in a try/catch so that a buggy objective function cannot crash multi-objective ranking.

Notes:

Parameters:

Returns: Numeric objective value; 0 if the accessor throws.

resolveGenomeIndex

(genomeIndexByReference: Map<import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default, number>, genomeItem: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default) => number

Resolves a genome’s index using a reference-based map.

Parameters:

Returns: The population index of the genome.

resolveObjectiveRange

(minValue: number, maxValue: number) => number

Resolves a non-zero objective range used to normalize crowding deltas.

If all genomes have the same objective value, the raw range is 0. This returns 1 in that case to avoid division by zero while still producing a well-defined crowding delta of 0.

Parameters:

Returns: Normalized range with a non-zero floor.

resolveObjectiveValue

(valuesMatrixInput: number[][], genomeIndexByReference: Map<import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default, number>, genomeItem: import("/home/runner/work/NeatapticTS/NeatapticTS/src/architecture/network").default, objectiveIndex: number) => number

Resolves an objective value for a genome from a values matrix.

This is a convenience helper for working with sorted/reordered views of the population while keeping objective values in a dense matrix.

Parameters:

Returns: The objective value for the genome.

vectorDominates

(valuesA: number[], valuesB: number[], descriptors: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.multiobjective.types.utils").ObjectiveDescriptor[]) => boolean

Determines whether vector A Pareto-dominates vector B.

A dominates B iff:

Assumptions:

Parameters:

Returns: true if A dominates B; otherwise false.

neat/neat.mutation.add-conn.utils.ts

assignInnovationForConnection

(connection: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").ConnectionWithMetadata, pairNodes: { symmetricKey: string; legacyForwardKey: string; legacyReverseKey: string; }, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => void

Assign an innovation id for a new connection, reusing when possible.

Parameters:

Returns: void

buildLegacyKeyForConn

(sourceNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, targetNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata) => string

Build a legacy directional innovation key.

Parameters:

Returns: directional innovation key

buildSymmetricKeyForConn

(sourceNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, targetNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata) => string

Build a symmetric innovation key for an unordered node pair.

Parameters:

Returns: symmetric innovation key

choosePairForConn

(pairs: [import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata][], internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => [import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata] | null

Choose a pair deterministically when only one candidate exists.

Parameters:

Returns: chosen pair or null

collectCandidatePairsForConn

(genomeToInspect: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata) => [import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata][]

Collect legal (from,to) node pairs not already connected.

Parameters:

Returns: candidate node pairs

connectChosenPair

(genomeToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, pairNodes: { sourceNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata; targetNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata; }) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").ConnectionWithMetadata | undefined

Create the connection for the chosen pair.

Parameters:

Returns: created connection or undefined

createsCycle

(sourceNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, targetNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata) => boolean

Detect whether adding a connection would create a cycle.

Parameters:

Returns: true when a cycle is detected

filterPairsWithInnovations

(pairs: [import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata][], internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => [import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata][]

Filter candidate pairs that already have innovation reuse keys.

Parameters:

Returns: reuse candidates

resolvePairNodes

(chosenPair: [import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata]) => { sourceNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata; targetNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata; symmetricKey: string; legacyForwardKey: string; legacyReverseKey: string; }

Resolve nodes and innovation key details for a chosen pair.

Parameters:

Returns: resolved pair metadata

selectPairPool

(allPairs: [import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata][], reusePairs: [import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata][]) => [import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata][]

Build the final selection pool based on reuse and hidden-node preference.

Parameters:

Returns: selection pool

shouldAbortForCycle

(genomeToInspect: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, pairNodes: { sourceNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata; targetNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata; }) => boolean

Determine whether adding the connection would create a cycle.

Parameters:

Returns: true if the connection should be aborted

neat/neat.mutation.add-node.utils.ts

applySplitWithExistingRecord

(genomeToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, connectionToSplit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").ConnectionWithMetadata, splitDescriptor: { splitKey: string; originalWeight: number; }, splitRecord: { newNodeGeneId: number; inInnov: number; outInnov: number; }, NodeClass: new (type: "input" | "output" | "hidden") => unknown) => void

Apply a split using an existing innovation record.

Parameters:

Returns: void

applySplitWithNewRecord

(genomeToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, connectionToSplit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").ConnectionWithMetadata, splitDescriptor: { splitKey: string; originalWeight: number; }, NodeClass: new (type: "input" | "output" | "hidden") => unknown, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => void

Apply a split and create a new innovation record.

Parameters:

Returns: void

assignInnovationsForNewSplit

(newNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, splitConnections: { incomingConnection?: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").ConnectionWithMetadata | undefined; outgoingConnection?: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").ConnectionWithMetadata | undefined; }, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => { newNodeGeneId: number; inInnov: number; outInnov: number; }

Assign new innovations for a split and build the innovation record.

Parameters:

Returns: innovation record for the split

buildSplitDescriptor

(connectionToSplit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").ConnectionWithMetadata) => { splitKey: string; originalWeight: number; }

Build the split descriptor used for innovation lookup and connection creation.

Parameters:

Returns: split descriptor

chooseConnectionForSplit

(enabledConnectionsList: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").ConnectionWithMetadata[], internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").ConnectionWithMetadata | null

Choose a random enabled connection to split.

Parameters:

Returns: selected connection or null

collectEnabledConnections

(genomeToInspect: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").ConnectionWithMetadata[]

Collect all enabled connections from a genome.

Parameters:

Returns: enabled connections list

connectSplitEdges

(genomeToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, connectionToSplit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").ConnectionWithMetadata, newNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, originalWeight: number) => { incomingConnection?: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").ConnectionWithMetadata | undefined; outgoingConnection?: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").ConnectionWithMetadata | undefined; }

Create the incoming and outgoing split connections.

Parameters:

Returns: incoming/outgoing connection handles

disconnectOriginalConnection

(genomeToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, connectionToRemove: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").ConnectionWithMetadata) => void

Disconnect the original connection before inserting the split node.

Parameters:

Returns: void

ensureBootstrapConnection

(genomeToSeed: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => void

Ensure the genome has at least one connection by linking input to output.

Parameters:

Returns: void

findFirstNodeByType

(genomeToSearch: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, nodeType: "input" | "output" | "hidden") => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata | undefined

Find the first node of a given type.

Parameters:

Returns: the first matching node or undefined

resolveInsertIndex

(genomeToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, targetNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata) => number

Resolve the insertion index for a new node, keeping outputs at the end.

Parameters:

Returns: insertion index

neat/neat.mutation.dead-ends.utils.ts

chooseRandomNodeForDeadEnds

(candidates: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[], internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata | null

Choose a random node from candidates for dead-end repair.

Parameters:

Returns: selected node or null

collectNodeGroupsForDeadEnds

(networkToInspect: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata) => { inputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; outputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; hiddenNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; }

Collect categorized node arrays for dead-end repair.

Parameters:

Returns: grouped node arrays

connectIfCandidatesExistForDeadEnds

(networkToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, anchorNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, candidates: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[], reverse: boolean, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => void

Connect a node to a random candidate if candidates exist.

Parameters:

Returns: void

ensureHiddenConnectivityForDeadEnds

(networkToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, nodeGroupsToUse: { inputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; outputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; hiddenNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; }, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => void

Ensure hidden nodes have both incoming and outgoing connections.

Parameters:

Returns: void

ensureInputConnectivityForDeadEnds

(networkToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, nodeGroupsToUse: { inputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; outputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; hiddenNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; }, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => void

Ensure all input nodes have at least one outgoing connection.

Parameters:

Returns: void

ensureOutputConnectivityForDeadEnds

(networkToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, nodeGroupsToUse: { inputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; outputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; hiddenNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; }, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => void

Ensure all output nodes have at least one incoming connection.

Parameters:

Returns: void

hasIncomingForDeadEnds

(node: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata) => boolean

Check whether a node has any incoming connections.

Parameters:

Returns: true when incoming connections exist

hasOutgoingForDeadEnds

(node: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata) => boolean

Check whether a node has any outgoing connections.

Parameters:

Returns: true when outgoing connections exist

neat/neat.mutation.flow.utils.ts

applyAddConnMutation

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation, methods: { mutation: unknown; }) => void

Apply an ADD_CONN mutation with reuse and weight nudging.

Parameters:

Returns: void

applyAddNodeMutation

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation, methods: { mutation: unknown; }) => void

Apply an ADD_NODE mutation with reuse and weight nudging.

Parameters:

Returns: void

applyMutationOperator

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, mutationMethod: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation, methods: { mutation: unknown; }) => void

Apply a mutation operator to a genome and invalidate caches as needed.

Parameters:

Returns: void

captureStructuralSizes

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata) => { beforeNodes: number; beforeConns: number; }

Capture structural sizes used to evaluate operator success.

Parameters:

Returns: structural size snapshot

initializeAdaptiveMutation

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => void

Initialize per-genome adaptive mutation parameters if configured.

Parameters:

Returns: void

maybeAddExtraConnection

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => void

Optionally add an extra connection to increase exploration.

Parameters:

Returns: void

mutateGenome

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation, methods: { mutation: unknown; }) => Promise<void>

Mutate a single genome based on configured mutation policies.

Parameters:

Returns: Promise resolving after mutation attempts complete

resolveEffectiveAmount

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => number

Resolve the effective mutation amount for a genome.

Parameters:

Returns: effective mutation amount

resolveEffectiveRate

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => number

Resolve the effective mutation rate for a genome.

Parameters:

Returns: effective mutation rate

selectConcreteMutationMethod

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => Promise<import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod | null>

Select a concrete mutation method, resolving any legacy arrays.

Parameters:

Returns: resolved mutation method or null

shouldInvalidateCaches

(mutationMethod: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod, methods: { mutation: unknown; }) => boolean

Determine whether a mutation method invalidates cached structures.

Parameters:

Returns: true when caches should be invalidated

shouldMutateGenome

(effectiveRate: number, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => boolean

Decide whether a genome should be mutated based on probability.

Parameters:

Returns: true when the genome should be mutated

updateOperatorStatsIfNeeded

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, mutationMethod: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod, beforeSizes: { beforeNodes: number; beforeConns: number; }, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => void

Update operator statistics when adaptation is enabled.

Parameters:

Returns: void

neat/neat.mutation.min-hidden.utils.ts

chooseRandomNodeForMinHidden

(candidates: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[], internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata | null

Choose a random node from a candidate list.

Parameters:

Returns: selected node or null

collectNodeGroupsForMinHidden

(networkToInspect: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata) => { inputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; outputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; hiddenNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; }

Collect categorized node arrays for the network.

Parameters:

Returns: grouped node arrays

ensureHiddenConnectivityForMinHidden

(networkToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, nodeGroupsToUse: { inputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; outputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; hiddenNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; }, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => void

Ensure hidden nodes have both incoming and outgoing connections.

Parameters:

Returns: void

ensureHiddenNodeCountForMinHidden

(networkToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, nodeGroupsToEdit: { hiddenNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; }, minimumHidden: number, maxNodesLimit: number) => Promise<void>

Ensure the network has at least the minimum number of hidden nodes.

Parameters:

Returns: Promise resolving when nodes are created

ensureIncomingConnectionForMinHidden

(networkToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, nodeGroupsToUse: { inputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; hiddenNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; }, hiddenNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => void

Ensure a hidden node has at least one incoming connection.

Parameters:

Returns: void

ensureOutgoingConnectionForMinHidden

(networkToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, nodeGroupsToUse: { outputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; hiddenNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; }, hiddenNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => void

Ensure a hidden node has at least one outgoing connection.

Parameters:

Returns: void

hasRequiredEndpointsForMinHidden

(nodeGroupsToCheck: { inputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; outputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; }) => boolean

Check whether the network has at least one input and output node.

Parameters:

Returns: true when inputs and outputs are present

rebuildNetworkConnectionsForMinHidden

(networkToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata) => Promise<void>

Rebuild connection caches after structural edits.

Parameters:

Returns: Promise resolving after rebuild completes

resolveMaxNodesForMinHidden

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => number

Resolve the maximum node limit for the network.

Parameters:

Returns: maximum node limit

resolveMinHiddenForMinHidden

(networkToInspect: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, maxNodesLimit: number, multiplier: number | undefined, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => number

Resolve the minimum hidden node requirement for the network.

Parameters:

Returns: minimum hidden node count

warnMissingEndpointsForMinHidden

() => void

Emit a warning when the network lacks input or output nodes.

Returns: void

neat/neat.mutation.select.utils.ts

applyOperatorAdaptationForSelect

(pool: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod[], internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod[]

Apply operator adaptation weighting to the pool when enabled.

Parameters:

Returns: augmented pool

applyOperatorBanditForSelect

(pool: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod[], fallbackMethod: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod

Apply operator bandit selection if enabled.

Parameters:

Returns: selected method

applyPhasedComplexityForSelect

(pool: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod[], internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod[]

Apply phased complexity adjustments to the pool when enabled.

Parameters:

Returns: pool with phased complexity adjustments

isBlockedByRecurrentPolicyForSelect

(mutationMethod: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation, methods: { mutation: unknown; }) => boolean

Check whether a mutation is blocked by recurrent connection policy.

Parameters:

Returns: true when the mutation should be blocked

isBlockedByStructuralLimitsForSelect

(mutationMethod: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod, genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation, methods: { mutation: unknown; }) => boolean

Check whether a mutation is blocked by structural limits.

Parameters:

Returns: true when the mutation should be blocked

isLegacyFFWPoolForSelect

(configuredPool: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod[], methods: { mutation: unknown; }) => boolean

Check whether a pool matches the legacy FFW operator ordering.

Parameters:

Returns: true when the pool matches FFW

isOperatorNamePrefixedForSelect

(method: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod, prefix: string) => boolean

Check whether an operator name uses a specific prefix.

Parameters:

Returns: true when the operator name matches the prefix

normalizeMutationPoolForSelect

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation, methods: { mutation: unknown; }, rawReturnForTest: boolean) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod[]

Normalize the configured mutation pool to a flat operator list.

Parameters:

Returns: normalized mutation pool

resolveFFWPolicyForSelect

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation, methods: { mutation: unknown; }, rawReturnForTest: boolean) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod | import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod[] | null

Resolve legacy FFW policy behavior, including test-specific returns.

Parameters:

Returns: mutation method or null when not handled

sampleFromPoolForSelect

(pool: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod[], internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod | null

Sample a random method from the pool.

Parameters:

Returns: sampled method or null

neat/neat.mutation.ts

DEFAULT_CONNECTION_WEIGHT

DEFAULT_GENE_ID

DEFAULT_INNOVATION_ID

ensureMinHiddenNodes

(network: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, multiplierOverride: number | undefined) => Promise<void>

Ensure the network has a minimum number of hidden nodes and connectivity.

ensureNoDeadEnds

(network: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata) => void

Ensure there are no dead-end nodes (input/output isolation) in the network.

mutate

() => Promise<void>

Mutate every genome in the population according to configured policies.

This is the high-level mutation driver used by NeatapticTS. It iterates the current population and, depending on the configured mutation rate and (optional) adaptive mutation controller, applies one or more mutation operators to each genome.

Educational notes:

Example:

// called on a Neat instance after a generation completes
neat.mutate();

mutateAddConnReuse

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata) => void

Add a connection between two previously unconnected nodes, reusing a stable innovation id per unordered node pair when possible.

Notes on behavior:

Steps:

Parameters:

mutateAddNodeReuse

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata) => Promise<void>

Split a randomly chosen enabled connection and insert a hidden node.

This routine attempts to reuse a historical "node split" innovation record so that identical splits across different genomes share the same innovation ids. This preservation of innovation information is important for NEAT-style speciation and genome alignment.

Method steps (high-level):

Example:

neat._mutateAddNodeReuse(genome);

Parameters:

selectMutationMethod

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, rawReturnForTest: boolean) => Promise<import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod | import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod[] | null>

Select a mutation method respecting structural constraints and adaptive controllers. Mirrors legacy implementation from neat.ts to preserve test expectations. rawReturnForTest retains historical behavior where the full FFW array is returned for identity checks in tests.

neat/neat.mutation.types.ts

ConnectionWithMetadata

Runtime interface for a connection within a genome.

GenomeWithMetadata

Type definitions for NEAT mutation operations. Extracted to avoid circular dependencies.

MutationMethod

Runtime interface for a mutation method descriptor.

NeatControllerForMutation

Runtime interface for the NEAT controller used in mutation operations. Avoids circular dependencies by defining only properties accessed in mutation modules.

NodeSplitRecord

Runtime interface for node-split innovation records.

NodeWithMetadata

Runtime interface for a node within a genome.

OperatorStats

Runtime interface for operator statistics tracking.

neat/neat.mutation.utils.ts

applyAddConnMutation

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation, methods: { mutation: unknown; }) => void

Apply an ADD_CONN mutation with reuse and weight nudging.

Parameters:

Returns: void

applyAddNodeMutation

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation, methods: { mutation: unknown; }) => void

Apply an ADD_NODE mutation with reuse and weight nudging.

Parameters:

Returns: void

applyMutationOperator

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, mutationMethod: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation, methods: { mutation: unknown; }) => void

Apply a mutation operator to a genome and invalidate caches as needed.

Parameters:

Returns: void

applyOperatorAdaptationForSelect

(pool: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod[], internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod[]

Apply operator adaptation weighting to the pool when enabled.

Parameters:

Returns: augmented pool

applyOperatorBanditForSelect

(pool: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod[], fallbackMethod: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod

Apply operator bandit selection if enabled.

Parameters:

Returns: selected method

applyPhasedComplexityForSelect

(pool: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod[], internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod[]

Apply phased complexity adjustments to the pool when enabled.

Parameters:

Returns: pool with phased complexity adjustments

applySplitWithExistingRecord

(genomeToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, connectionToSplit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").ConnectionWithMetadata, splitDescriptor: { splitKey: string; originalWeight: number; }, splitRecord: { newNodeGeneId: number; inInnov: number; outInnov: number; }, NodeClass: new (type: "input" | "output" | "hidden") => unknown) => void

Apply a split using an existing innovation record.

Parameters:

Returns: void

applySplitWithNewRecord

(genomeToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, connectionToSplit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").ConnectionWithMetadata, splitDescriptor: { splitKey: string; originalWeight: number; }, NodeClass: new (type: "input" | "output" | "hidden") => unknown, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => void

Apply a split and create a new innovation record.

Parameters:

Returns: void

assignInnovationForConnection

(connection: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").ConnectionWithMetadata, pairNodes: { symmetricKey: string; legacyForwardKey: string; legacyReverseKey: string; }, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => void

Assign an innovation id for a new connection, reusing when possible.

Parameters:

Returns: void

assignInnovationsForNewSplit

(newNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, splitConnections: { incomingConnection?: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").ConnectionWithMetadata | undefined; outgoingConnection?: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").ConnectionWithMetadata | undefined; }, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => { newNodeGeneId: number; inInnov: number; outInnov: number; }

Assign new innovations for a split and build the innovation record.

Parameters:

Returns: innovation record for the split

buildLegacyKeyForConn

(sourceNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, targetNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata) => string

Build a legacy directional innovation key.

Parameters:

Returns: directional innovation key

buildSplitDescriptor

(connectionToSplit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").ConnectionWithMetadata) => { splitKey: string; originalWeight: number; }

Build the split descriptor used for innovation lookup and connection creation.

Parameters:

Returns: split descriptor

buildSymmetricKeyForConn

(sourceNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, targetNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata) => string

Build a symmetric innovation key for an unordered node pair.

Parameters:

Returns: symmetric innovation key

captureStructuralSizes

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata) => { beforeNodes: number; beforeConns: number; }

Capture structural sizes used to evaluate operator success.

Parameters:

Returns: structural size snapshot

chooseConnectionForSplit

(enabledConnectionsList: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").ConnectionWithMetadata[], internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").ConnectionWithMetadata | null

Choose a random enabled connection to split.

Parameters:

Returns: selected connection or null

choosePairForConn

(pairs: [import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata][], internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => [import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata] | null

Choose a pair deterministically when only one candidate exists.

Parameters:

Returns: chosen pair or null

chooseRandomNodeForDeadEnds

(candidates: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[], internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata | null

Choose a random node from candidates for dead-end repair.

Parameters:

Returns: selected node or null

chooseRandomNodeForMinHidden

(candidates: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[], internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata | null

Choose a random node from a candidate list.

Parameters:

Returns: selected node or null

collectCandidatePairsForConn

(genomeToInspect: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata) => [import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata][]

Collect legal (from,to) node pairs not already connected.

Parameters:

Returns: candidate node pairs

collectEnabledConnections

(genomeToInspect: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").ConnectionWithMetadata[]

Collect all enabled connections from a genome.

Parameters:

Returns: enabled connections list

collectNodeGroupsForDeadEnds

(networkToInspect: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata) => { inputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; outputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; hiddenNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; }

Collect categorized node arrays for dead-end repair.

Parameters:

Returns: grouped node arrays

collectNodeGroupsForMinHidden

(networkToInspect: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata) => { inputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; outputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; hiddenNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; }

Collect categorized node arrays for the network.

Parameters:

Returns: grouped node arrays

connectChosenPair

(genomeToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, pairNodes: { sourceNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata; targetNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata; }) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").ConnectionWithMetadata | undefined

Create the connection for the chosen pair.

Parameters:

Returns: created connection or undefined

connectIfCandidatesExistForDeadEnds

(networkToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, anchorNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, candidates: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[], reverse: boolean, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => void

Connect a node to a random candidate if candidates exist.

Parameters:

Returns: void

connectSplitEdges

(genomeToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, connectionToSplit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").ConnectionWithMetadata, newNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, originalWeight: number) => { incomingConnection?: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").ConnectionWithMetadata | undefined; outgoingConnection?: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").ConnectionWithMetadata | undefined; }

Create the incoming and outgoing split connections.

Parameters:

Returns: incoming/outgoing connection handles

createsCycle

(sourceNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, targetNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata) => boolean

Detect whether adding a connection would create a cycle.

Parameters:

Returns: true when a cycle is detected

disconnectOriginalConnection

(genomeToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, connectionToRemove: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").ConnectionWithMetadata) => void

Disconnect the original connection before inserting the split node.

Parameters:

Returns: void

ensureBootstrapConnection

(genomeToSeed: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => void

Ensure the genome has at least one connection by linking input to output.

Parameters:

Returns: void

ensureHiddenConnectivityForDeadEnds

(networkToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, nodeGroupsToUse: { inputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; outputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; hiddenNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; }, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => void

Ensure hidden nodes have both incoming and outgoing connections.

Parameters:

Returns: void

ensureHiddenConnectivityForMinHidden

(networkToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, nodeGroupsToUse: { inputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; outputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; hiddenNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; }, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => void

Ensure hidden nodes have both incoming and outgoing connections.

Parameters:

Returns: void

ensureHiddenNodeCountForMinHidden

(networkToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, nodeGroupsToEdit: { hiddenNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; }, minimumHidden: number, maxNodesLimit: number) => Promise<void>

Ensure the network has at least the minimum number of hidden nodes.

Parameters:

Returns: Promise resolving when nodes are created

ensureIncomingConnectionForMinHidden

(networkToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, nodeGroupsToUse: { inputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; hiddenNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; }, hiddenNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => void

Ensure a hidden node has at least one incoming connection.

Parameters:

Returns: void

ensureInputConnectivityForDeadEnds

(networkToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, nodeGroupsToUse: { inputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; outputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; hiddenNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; }, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => void

Ensure all input nodes have at least one outgoing connection.

Parameters:

Returns: void

ensureOutgoingConnectionForMinHidden

(networkToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, nodeGroupsToUse: { outputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; hiddenNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; }, hiddenNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => void

Ensure a hidden node has at least one outgoing connection.

Parameters:

Returns: void

ensureOutputConnectivityForDeadEnds

(networkToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, nodeGroupsToUse: { inputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; outputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; hiddenNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; }, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => void

Ensure all output nodes have at least one incoming connection.

Parameters:

Returns: void

filterPairsWithInnovations

(pairs: [import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata][], internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => [import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata][]

Filter candidate pairs that already have innovation reuse keys.

Parameters:

Returns: reuse candidates

findFirstNodeByType

(genomeToSearch: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, nodeType: "input" | "output" | "hidden") => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata | undefined

Find the first node of a given type.

Parameters:

Returns: the first matching node or undefined

hasIncomingForDeadEnds

(node: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata) => boolean

Check whether a node has any incoming connections.

Parameters:

Returns: true when incoming connections exist

hasOutgoingForDeadEnds

(node: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata) => boolean

Check whether a node has any outgoing connections.

Parameters:

Returns: true when outgoing connections exist

hasRequiredEndpointsForMinHidden

(nodeGroupsToCheck: { inputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; outputNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata[]; }) => boolean

Check whether the network has at least one input and output node.

Parameters:

Returns: true when inputs and outputs are present

initializeAdaptiveMutation

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => void

Initialize per-genome adaptive mutation parameters if configured.

Parameters:

Returns: void

isBlockedByRecurrentPolicyForSelect

(mutationMethod: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation, methods: { mutation: unknown; }) => boolean

Check whether a mutation is blocked by recurrent connection policy.

Parameters:

Returns: true when the mutation should be blocked

isBlockedByStructuralLimitsForSelect

(mutationMethod: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod, genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation, methods: { mutation: unknown; }) => boolean

Check whether a mutation is blocked by structural limits.

Parameters:

Returns: true when the mutation should be blocked

isLegacyFFWPoolForSelect

(configuredPool: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod[], methods: { mutation: unknown; }) => boolean

Check whether a pool matches the legacy FFW operator ordering.

Parameters:

Returns: true when the pool matches FFW

isOperatorNamePrefixedForSelect

(method: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod, prefix: string) => boolean

Check whether an operator name uses a specific prefix.

Parameters:

Returns: true when the operator name matches the prefix

maybeAddExtraConnection

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => void

Optionally add an extra connection to increase exploration.

Parameters:

Returns: void

mutateGenome

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation, methods: { mutation: unknown; }) => Promise<void>

Mutate a single genome based on configured mutation policies.

Parameters:

Returns: Promise resolving after mutation attempts complete

normalizeMutationPoolForSelect

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation, methods: { mutation: unknown; }, rawReturnForTest: boolean) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod[]

Normalize the configured mutation pool to a flat operator list.

Parameters:

Returns: normalized mutation pool

rebuildNetworkConnectionsForMinHidden

(networkToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata) => Promise<void>

Rebuild connection caches after structural edits.

Parameters:

Returns: Promise resolving after rebuild completes

resolveEffectiveAmount

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => number

Resolve the effective mutation amount for a genome.

Parameters:

Returns: effective mutation amount

resolveEffectiveRate

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => number

Resolve the effective mutation rate for a genome.

Parameters:

Returns: effective mutation rate

resolveFFWPolicyForSelect

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation, methods: { mutation: unknown; }, rawReturnForTest: boolean) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod | import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod[] | null

Resolve legacy FFW policy behavior, including test-specific returns.

Parameters:

Returns: mutation method or null when not handled

resolveInsertIndex

(genomeToEdit: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, targetNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata) => number

Resolve the insertion index for a new node, keeping outputs at the end.

Parameters:

Returns: insertion index

resolveMaxNodesForMinHidden

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => number

Resolve the maximum node limit for the network.

Parameters:

Returns: maximum node limit

resolveMinHiddenForMinHidden

(networkToInspect: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, maxNodesLimit: number, multiplier: number | undefined, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => number

Resolve the minimum hidden node requirement for the network.

Parameters:

Returns: minimum hidden node count

resolvePairNodes

(chosenPair: [import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata]) => { sourceNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata; targetNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata; symmetricKey: string; legacyForwardKey: string; legacyReverseKey: string; }

Resolve nodes and innovation key details for a chosen pair.

Parameters:

Returns: resolved pair metadata

sampleFromPoolForSelect

(pool: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod[], internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod | null

Sample a random method from the pool.

Parameters:

Returns: sampled method or null

selectConcreteMutationMethod

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => Promise<import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod | null>

Select a concrete mutation method, resolving any legacy arrays.

Parameters:

Returns: resolved mutation method or null

selectPairPool

(allPairs: [import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata][], reusePairs: [import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata][]) => [import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata, import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata][]

Build the final selection pool based on reuse and hidden-node preference.

Parameters:

Returns: selection pool

shouldAbortForCycle

(genomeToInspect: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, pairNodes: { sourceNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata; targetNode: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NodeWithMetadata; }) => boolean

Determine whether adding the connection would create a cycle.

Parameters:

Returns: true if the connection should be aborted

shouldInvalidateCaches

(mutationMethod: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod, methods: { mutation: unknown; }) => boolean

Determine whether a mutation method invalidates cached structures.

Parameters:

Returns: true when caches should be invalidated

shouldMutateGenome

(effectiveRate: number, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => boolean

Decide whether a genome should be mutated based on probability.

Parameters:

Returns: true when the genome should be mutated

updateOperatorStatsIfNeeded

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").GenomeWithMetadata, mutationMethod: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").MutationMethod, beforeSizes: { beforeNodes: number; beforeConns: number; }, internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.mutation.types").NeatControllerForMutation) => void

Update operator statistics when adaptation is enabled.

Parameters:

Returns: void

warnMissingEndpointsForMinHidden

() => void

Emit a warning when the network lacks input or output nodes.

Returns: void

neat/neat.objectives.ts

_getObjectives

() => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").ObjectiveDescriptor[]

Build and return the list of registered objectives for this NEAT instance.

This function lazily builds this._objectivesList from the built-in fitness objective (unless suppressed) and any user-registered multi- objective descriptors found on this.options.multiObjective.objectives.

Typical use: the evolution loop calls this to know which objectives to evaluate and whether each objective should be maximized or minimized.

Example:

const objectives = neatInstance._getObjectives();
// objectives: Array<ObjectiveDescriptor>

Returns: Array of objective descriptors in the order they should be applied. If multi-objective support is disabled or no objectives are registered, this will contain only the built-in fitness objective (unless suppressed).

clearObjectives

() => void

Clear all registered multi-objectives.

This resets this.options.multiObjective.objectives to an empty array and clears the cached objectives list so that subsequent calls will reflect the cleared state.

Example:

neat.clearObjectives();
// now only the default fitness objective (unless suppressed) will remain

registerObjective

(key: string, direction: "max" | "min", accessor: (genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeLike) => number) => void

Register a new objective descriptor.

This adds or replaces an objective with the given key. The objective is a lightweight descriptor with a key, direction ('min' | 'max'), and an accessor function that maps a genome to a numeric objective value.

Example:

// register an objective that measures model sparsity (lower is better)
neat.registerObjective('sparsity', 'min', genome => computeSparsity(genome));

Notes:

Parameters:

neat/neat.objectives.utils.ts

buildDefaultFitnessObjective

() => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").ObjectiveDescriptor

Returns: Default fitness objective descriptor.

collectDefaultObjectives

(neatInstance: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.objectives.utils").NeatLikeWithObjectives) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").ObjectiveDescriptor[]

Parameters:

Returns: Default objectives when fitness is not suppressed.

collectUserObjectives

(neatInstance: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.objectives.utils").NeatLikeWithObjectives) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").ObjectiveDescriptor[]

Parameters:

Returns: Valid user-registered objectives when multi-objective is enabled.

ensureMultiObjectiveOptions

(neatInstance: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.objectives.utils").NeatLikeWithObjectives) => { enabled?: boolean | undefined; objectives?: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").ObjectiveDescriptor[] | undefined; }

Parameters:

Returns: Initialized multi-objective options.

ensureObjectivesList

(multiObjectiveOptions: { enabled?: boolean | undefined; objectives?: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").ObjectiveDescriptor[] | undefined; }) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").ObjectiveDescriptor[]

Parameters:

Returns: Objectives list for mutation-free operations.

getObjectiveCandidates

(neatInstance: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.objectives.utils").NeatLikeWithObjectives) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").ObjectiveDescriptor[]

Parameters:

Returns: Candidate objectives from configuration.

isMultiObjectiveEnabled

(neatInstance: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.objectives.utils").NeatLikeWithObjectives) => boolean

Parameters:

Returns: Whether multi-objective mode is enabled with a candidate list.

isValidObjective

(candidateObjective: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").ObjectiveDescriptor | undefined) => boolean

Parameters:

Returns: True when the descriptor has the required shape.

NeatLikeWithObjectives

Minimal interface for NEAT instances using objective management.

This shape is intentionally small and only includes the pieces needed by _getObjectives, registerObjective, and clearObjectives.

replaceObjectiveByKey

(objectivesList: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").ObjectiveDescriptor[], objectiveKey: string, objectiveDirection: "max" | "min", objectiveAccessor: (genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeLike) => number) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").ObjectiveDescriptor[]

Parameters:

Returns: Updated objectives list with the new descriptor appended.

neat/neat.pruning.ts

applyAdaptivePruning

() => void

Adaptive pruning controller.

This function monitors a population-level metric (average nodes or average connections) and adjusts a global pruning level so the population converges to a target sparsity automatically.

It updates this._adaptivePruneLevel on the Neat instance and calls each genome's pruneToSparsity with the new level when adjustment is required.

Example:

// options.adaptivePruning = { enabled: true, metric: 'connections', targetSparsity: 0.6 }
neat.applyAdaptivePruning();

applyEvolutionPruning

() => void

Apply evolution-time pruning to the current population.

This method is intended to be called from the evolve loop. It reads pruning parameters from this.options.evolutionPruning and, when appropriate for the current generation, instructs each genome to prune its connections/nodes to reach a target sparsity.

The pruning target can be ramped in over a number of generations so sparsification happens gradually instead of abruptly.

Example (in a Neat instance):

// options.evolutionPruning = { startGeneration: 10, targetSparsity: 0.5 }
neat.applyEvolutionPruning();

Notes for docs:

neat/neat.pruning.utils.ts

AdaptivePruningOptions

Adaptive pruning options extracted from the Neat instance.

applyAdaptivePruneLevelToPopulation

(host: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.pruning.utils").NeatLikeForPruning, pruneLevel: number) => void

Parameters:

applyPruningToPopulation

(host: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.pruning.utils").NeatLikeForPruning, options: { startGeneration?: number | undefined; interval?: number | undefined; rampGenerations?: number | undefined; targetSparsity?: number | undefined; method?: string | undefined; }, targetSparsity: number) => void

Parameters:

computeMeanConnectionCount

(host: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.pruning.utils").NeatLikeForPruning) => number

Parameters:

Returns: Average number of connections per genome.

computeMeanNodeCount

(host: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.pruning.utils").NeatLikeForPruning) => number

Parameters:

Returns: Average number of nodes per genome.

computeNextAdaptivePruneLevel

(options: { enabled?: boolean | undefined; metric?: string | undefined; targetSparsity?: number | undefined; learningRate?: number | undefined; tolerance?: number | undefined; adjustRate?: number | undefined; }, currentPruneLevel: number, currentMetricValue: number, targetRemainingMetric: number) => number

Parameters:

Returns: Updated prune level.

computePopulationMetrics

(host: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.pruning.utils").NeatLikeForPruning) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.pruning.utils").PopulationMetrics

Parameters:

Returns: Population metric summary.

computeRampFraction

(host: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.pruning.utils").NeatLikeForPruning, options: { startGeneration?: number | undefined; interval?: number | undefined; rampGenerations?: number | undefined; targetSparsity?: number | undefined; method?: string | undefined; }) => number

Parameters:

Returns: Fraction in [0,1] indicating ramp completion.

computeTargetRemainingMetric

(options: { enabled?: boolean | undefined; metric?: string | undefined; targetSparsity?: number | undefined; learningRate?: number | undefined; tolerance?: number | undefined; adjustRate?: number | undefined; }, adaptivePruneBaseline: number) => number

Parameters:

Returns: Target remaining metric value.

computeTargetSparsityNow

(host: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.pruning.utils").NeatLikeForPruning, options: { startGeneration?: number | undefined; interval?: number | undefined; rampGenerations?: number | undefined; targetSparsity?: number | undefined; method?: string | undefined; }) => number

Parameters:

Returns: Target sparsity to apply for this generation.

EvolutionPruningOptions

Evolution pruning options extracted from the Neat instance.

initializeAdaptivePruningState

(host: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.pruning.utils").NeatLikeForPruning) => void

Parameters:

NeatLikeForPruning

Minimal Neat instance contract required by pruning helpers.

PopulationMetrics

Summary of population metrics used by adaptive pruning.

resolveActiveAdaptivePruningOptions

(host: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.pruning.utils").NeatLikeForPruning) => { enabled?: boolean | undefined; metric?: string | undefined; targetSparsity?: number | undefined; learningRate?: number | undefined; tolerance?: number | undefined; adjustRate?: number | undefined; } | null

Parameters:

Returns: Adaptive pruning options when enabled, otherwise null.

resolveActiveEvolutionPruningOptions

(host: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.pruning.utils").NeatLikeForPruning) => { startGeneration?: number | undefined; interval?: number | undefined; rampGenerations?: number | undefined; targetSparsity?: number | undefined; method?: string | undefined; } | null

Parameters:

Returns: Evolution pruning options when active, otherwise null.

resolveAdaptivePruneBaseline

(host: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.pruning.utils").NeatLikeForPruning, currentMetricValue: number) => number

Parameters:

Returns: Baseline metric value used for adaptation.

resolveObservedMetricValue

(options: { enabled?: boolean | undefined; metric?: string | undefined; targetSparsity?: number | undefined; learningRate?: number | undefined; tolerance?: number | undefined; adjustRate?: number | undefined; }, metrics: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.pruning.utils").PopulationMetrics) => number

Parameters:

Returns: Current observed metric value used for adaptation.

shouldAdjustAdaptivePruning

(options: { enabled?: boolean | undefined; metric?: string | undefined; targetSparsity?: number | undefined; learningRate?: number | undefined; tolerance?: number | undefined; adjustRate?: number | undefined; }, currentMetricValue: number, targetRemainingMetric: number, adaptivePruneBaseline: number) => boolean

Parameters:

Returns: True when pruning should be adjusted.

neat/neat.selection.ts

DEFAULT_POWER

DEFAULT_SCORE

DEFAULT_TOURNAMENT_PROBABILITY

DEFAULT_TOURNAMENT_SIZE

FIRST_INDEX

getAverage

() => number

Compute the average (mean) fitness across the population.

If genomes have not been evaluated yet this will call evaluate() so that scores exist. Missing scores are treated as 0.

Example: const avg = neat.getAverage(); console.log(Average fitness: ${avg});

Returns: The mean fitness as a number.

getFittest

() => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.selection.utils").GenomeWithScore

Return the fittest genome in the population.

This will trigger an evaluate() if genomes have not been scored yet, and will ensure the population is sorted so index 0 contains the fittest.

Example: const best = neat.getFittest(); console.log(best.score);

Returns: The genome object judged to be the fittest (highest score).

getParent

() => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.selection.utils").GenomeWithScore

Select a parent genome according to the configured selection strategy.

Supported strategies (via options.selection.name):

This function intentionally makes no changes to the population except in the POWER path where a quick sort may be triggered to ensure descending order.

Examples: // POWER selection (higher power => more exploitation) neat.options.selection = { name: 'POWER', power: 2 }; const parent = neat.getParent();

// Tournament selection (size 3, 75% probability to take top of tournament) neat.options.selection = { name: 'TOURNAMENT', size: 3, probability: 0.75 }; const parent2 = neat.getParent();

Returns: A genome object chosen as the parent according to the selection strategy

INITIAL_CUMULATIVE_FITNESS

INITIAL_MOST_NEGATIVE_SCORE

INITIAL_TOTAL_FITNESS

LAST_ELEMENT_INDEX

LAST_INDEX_OFFSET

LOOP_INDEX_INCREMENT

SECOND_INDEX

sort

() => void

Sorts the internal population in place by descending fitness.

This method mutates the population array on the Neat instance so that the genome with the highest score appears at index 0. It treats missing scores as 0.

Example: const neat = new Neat(...); neat.sort(); console.log(neat.population[0].score); // highest score

Notes for documentation generators: this is a small utility used by many selection and evaluation routines; it intentionally sorts in-place for performance and to preserve references to genome objects.

neat/neat.selection.utils.ts

calculateFitnessTotals

(population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.selection.utils").GenomeWithScore[]) => { totalFitness: number; minFitnessShift: number; }

Compute the total fitness and minimal score shift for roulette selection.

Parameters:

Returns: Aggregated fitness totals.

calculateTotalScore

(population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.selection.utils").GenomeWithScore[]) => number

Calculate the total fitness across the population.

Parameters:

Returns: The sum of all scores.

DEFAULT_POWER

DEFAULT_SCORE

DEFAULT_TOURNAMENT_PROBABILITY

DEFAULT_TOURNAMENT_SIZE

ensurePopulationEvaluated

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.selection.utils").NeatLikeWithSelection) => void

Ensure population scores exist by running evaluation if needed.

Parameters:

Returns: void

ensurePopulationSortedDescending

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.selection.utils").NeatLikeWithSelection) => void

Ensure the population is sorted descending by score when out of order.

Parameters:

Returns: void

ensurePopulationSortedDescendingForPower

(selectionContext: SelectionContext) => void

Ensure the population is sorted descending by score if the first two entries are out of order.

Parameters:

Returns: void

FIRST_INDEX

GenomeWithScore

Genome with a fitness score and arbitrary additional metadata.

getRandomPopulationMember

(selectionContext: SelectionContext) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.selection.utils").GenomeWithScore

Select a random population member using the configured RNG.

Parameters:

Returns: A randomly chosen genome.

INITIAL_CUMULATIVE_FITNESS

INITIAL_MOST_NEGATIVE_SCORE

INITIAL_TOTAL_FITNESS

LAST_ELEMENT_INDEX

LAST_INDEX_OFFSET

LOOP_INDEX_INCREMENT

NeatLikeWithSelection

NEAT-like instance extended with selection-specific state and helpers.

pickByShiftedThreshold

(population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.selection.utils").GenomeWithScore[], selectionThreshold: number, minFitnessShift: number) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.selection.utils").GenomeWithScore | undefined

Pick the first genome whose shifted cumulative fitness exceeds the threshold.

Parameters:

Returns: The chosen genome if one crosses the threshold.

pickTournamentWinner

(selectionContext: SelectionContext, sortedParticipants: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.selection.utils").GenomeWithScore[]) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.selection.utils").GenomeWithScore

Select a winner from sorted tournament participants.

Parameters:

Returns: The chosen tournament winner.

resolveTournamentOverflow

(selectionContext: SelectionContext) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.selection.utils").GenomeWithScore

Resolve what happens when the tournament size exceeds population size.

Parameters:

Returns: A fallback parent genome.

sampleTournamentParticipants

(selectionContext: SelectionContext, tournamentSize: number) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.selection.utils").GenomeWithScore[]

Sample a list of tournament participants (with possible repeats).

Parameters:

Returns: Sampled participants.

SECOND_INDEX

selectParentByFitnessProportionate

(selectionContext: SelectionContext) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.selection.utils").GenomeWithScore

Select a parent using roulette-wheel fitness proportionate selection.

Parameters:

Returns: The chosen parent genome.

selectParentByPower

(selectionContext: SelectionContext) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.selection.utils").GenomeWithScore

Select a parent by power-law distribution on the sorted population.

Parameters:

Returns: The chosen parent genome.

selectParentByStrategy

(internal: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.selection.utils").NeatLikeWithSelection) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.selection.utils").GenomeWithScore

Select a parent genome according to configured selection strategy.

Parameters:

Returns: A genome object chosen as the parent.

selectParentByTournament

(selectionContext: SelectionContext) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.selection.utils").GenomeWithScore

Select a parent by tournament selection.

Parameters:

Returns: The chosen parent genome.

neat/neat.speciation.ts

_applyFitnessSharing

() => void

Apply fitness sharing to penalize similarity within species.

Parameters:

_sortSpeciesMembers

(species: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciesLike) => void

Sort species members by descending score.

Parameters:

_speciate

() => void

Assign genomes into species based on compatibility distance.

Parameters:

Returns: Nothing.

_updateSpeciesStagnation

() => void

Update stagnation counters for all species.

Parameters:

neat/neat.speciation.utils.ts

adjustCompatibilityThreshold

(speciationContext: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciationHarnessContext<TOptions>, options: TOptions, compatAdjust: { smoothingWindow?: number | undefined; decay?: number | undefined; kp?: number | undefined; ki?: number | undefined; minThreshold?: number | undefined; maxThreshold?: number | undefined; }, minCompatibilityThreshold: number, maxCompatibilityThreshold: number) => void

Update the adaptive compatibility threshold and clamp to bounds.

Parameters:

Returns: Nothing.

applyAgeProtection

(speciationContext: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciationHarnessContext<TOptions>, options: TOptions) => void

Apply age protection penalties to old species.

Parameters:

Returns: Nothing.

applyFitnessSharing

(speciationContext: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.speciation.utils").FitnessSharingContext, sharingSigma: number) => void

Apply fitness sharing to penalize similarity within species.

Parameters:

Returns: Nothing.

assignPopulationToSpecies

(speciationContext: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciationHarnessContext<TOptions>, options: TOptions) => void

Assign each genome in the population to a compatible species.

Parameters:

Returns: Nothing.

averageNumbers

(values: number[]) => number

Average a list of numbers, returning zero when empty.

Parameters:

Returns: Mean of the values or zero.

buildExtendedHistoryStats

(speciationContext: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciationHarnessContext<TOptions>, species: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciesLike) => Record<string, unknown>

Build extended history stats for a species.

Parameters:

Returns: Extended history entry.

clampCompatibilityThreshold

(options: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciationOptions, minCompatibilityThreshold: number, maxCompatibilityThreshold: number) => void

Clamp the compatibility threshold to configured bounds.

Parameters:

Returns: Nothing.

CompatAdjust

Resolved compatibility-threshold adjustment settings.

This is the non-nullable form of {@link SpeciationOptions.compatAdjust} used by the speciation PID controller.

computePidThreshold

(speciationContext: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciationHarnessContext<TOptions>, options: TOptions, compatAdjust: { smoothingWindow?: number | undefined; decay?: number | undefined; kp?: number | undefined; ki?: number | undefined; minThreshold?: number | undefined; maxThreshold?: number | undefined; }, currentThreshold: number, minCompatibilityThreshold: number, maxCompatibilityThreshold: number) => number

Compute a PID-based threshold update and clamp when needed.

Parameters:

Returns: Updated threshold.

createSpeciesForGenome

(speciationContext: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciationHarnessContext<TOptions>, genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed) => void

Create a new species for the provided genome.

Parameters:

Returns: Nothing.

DEFAULT_COMPAT_INTEGRAL

DEFAULT_COMPATIBILITY_INTEGRAL_GAIN

DEFAULT_COMPATIBILITY_PROPORTIONAL_GAIN

DEFAULT_COMPATIBILITY_THRESHOLD

DEFAULT_LAST_IMPROVED_GENERATION

DEFAULT_MAX_COMPATIBILITY_THRESHOLD

DEFAULT_MEMBER_COUNT_FALLBACK

DEFAULT_MIN_COMPATIBILITY_THRESHOLD

DEFAULT_SCORE_FALLBACK

DEFAULT_SHARING_SIGMA

DEFAULT_SPECIES_AGE_GRACE

DEFAULT_SPECIES_OLD_PENALTY

DEFAULT_STAGNATION_WINDOW

DEFAULT_TARGET_SPECIES

findCompatibleSpecies

(speciationContext: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciationHarnessContext<TOptions>, options: TOptions, genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciesLike | undefined

Find a compatible species representative for the given genome.

Parameters:

Returns: Matching species or undefined.

FitnessSharingContext

Minimal context required to apply fitness sharing.

Fitness sharing normalizes per-genome fitness within each species to reduce selection pressure toward dense clusters of very similar genomes.

HISTORY_BUFFER_MAX_ENTRIES

InnovationAccumulator

Accumulator for innovation-id statistics across a set of connections.

Used for extended history telemetry (mean innovation, innovation range, and enabled/disabled ratios).

NEGATIVE_INFINITY

PENALTY_NO_EFFECT_THRESHOLD

recordHistory

(speciationContext: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciationHarnessContext<TOptions>, options: TOptions) => void

Record the current species history snapshot.

Parameters:

Returns: Nothing.

refreshSpeciesRepresentatives

(speciationContext: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciationHarnessContext<TOptions>) => void

Refresh representatives and remove empty species.

Parameters:

Returns: Nothing.

resetSpeciesMembers

(speciationContext: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciationHarnessContext<TOptions>) => void

Clear member lists for all species.

Parameters:

Returns: Nothing.

SHARING_MAX_CONTRIBUTION

SHARING_SELF_DISTANCE

SHARING_SUM_FLOOR

snapshotPreviousMembers

(speciationContext: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciationHarnessContext<TOptions>) => void

Snapshot current species memberships for telemetry.

Parameters:

Returns: Nothing.

SPECIES_AGE_GRACE_MULTIPLIER

StagnationContext

Minimal context required to update species stagnation.

Stagnation pruning removes species that have not improved their best score within a configured number of generations.

summarizeInnovations

(speciationContext: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciationHarnessContext<TOptions>, members: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed[]) => { meanInnovation: number; innovationRange: number; enabledRatio: number; }

Summarize innovation statistics for a set of members.

Parameters:

Returns: Innovation summary statistics.

trimHistory

(speciationContext: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciationHarnessContext<TOptions>) => void

Trim species history to the maximum buffer size.

Parameters:

Returns: Nothing.

updateSpeciesStagnation

(speciationContext: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.speciation.utils").StagnationContext, stagnationWindow: number, sortSpeciesMembers: (species: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciesLike) => void) => void

Update stagnation counters and prune stagnant species.

Parameters:

Returns: Nothing.

neat/neat.species.ts

getSpeciesHistory

() => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciesHistoryEntry[]

Retrieve the recorded species history across generations.

Each entry in the returned array corresponds to a recorded generation and contains a snapshot of statistics for every species at that generation. This is useful for plotting species sizes over time, tracking innovation spread, or implementing population-level diagnostics.

The shape of each entry is defined by SpeciesHistoryEntry in the public types. When options.speciesAllocation.extendedHistory is enabled the library attempts to include additional metrics such as innovationRange and enabledRatio. When those extended metrics are missing they are computed lazily from a representative genome to ensure historical data is still useful for analysis.

Example:

const history = neat.getSpeciesHistory();
// history => [{ generation: 0, stats: [{ id:1, size:10, innovationRange:5, enabledRatio:0.9 }, ...] }, ...]

Notes for documentation:

Returns: Array of generation-stamped species statistic snapshots.

getSpeciesStats

() => { id: number; size: number; bestScore: number; lastImproved: number; }[]

Get lightweight per-species statistics for the current population.

This method intentionally returns a small, immutable-friendly summary per species rather than exposing internal member lists. This avoids accidental mutation of the library's internal state while still providing useful telemetry for UIs, dashboards, or logging.

Example:

const stats = neat.getSpeciesStats();
// stats => [{ id: 1, size: 12, bestScore: 0.85, lastImproved: 42 }, ...]

Success criteria:

Returns: Array of per-species summaries suitable for reporting.

neat/neat.species.utils.ts

backfillExtendedHistory

(history: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciesHistoryEntry[], context: { _species?: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciesLike[] | undefined; _fallbackInnov?: ((c: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").ConnectionLike) => number) | undefined; }) => void

Parameters:

shouldAugmentExtendedHistory

(options: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").NeatOptions | undefined) => boolean

Parameters:

Returns: True when extended history is enabled.

SPECIES_HISTORY_DEFAULT_ENABLED_RATIO

SPECIES_HISTORY_DEFAULT_INNOVATION_ID

SPECIES_HISTORY_DEFAULT_INNOVATION_RANGE

SPECIES_HISTORY_INITIAL_MAX_INNOVATION

SPECIES_HISTORY_INITIAL_MIN_INNOVATION

SPECIES_HISTORY_ZERO

neat/neat.telemetry.buffer.utils.ts

ensureTelemetryBuffer

(telemetryContext: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryBufferContext) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").TelemetryEntry[]

Ensure the telemetry buffer is initialized.

Parameters:

Returns: A mutable telemetry buffer.

safelyStreamTelemetryEntry

(telemetryContext: { options?: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryStreamOptions | undefined; }, telemetryEntry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").TelemetryEntry) => void

Stream telemetry entry when a stream callback is configured.

Parameters:

trimTelemetryBuffer

(telemetryBufferRef: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").TelemetryEntry[], maxEntries: number) => void

Trim the telemetry buffer to a maximum size.

Parameters:

neat/neat.telemetry.complexity.utils.ts

applyComplexityStatsMonoObjective

(telemetryContext: { _lastMeanNodes?: number | undefined; _lastMeanConns?: number | undefined; }, telemetryOptions: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").NeatOptions & import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryDiversityOptions, populationSnapshot: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed[], entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryEntryRecord) => void

Attach complexity stats for mono-objective mode.

Parameters:

applyComplexityStatsMultiObjective

(telemetryContext: { _lastMeanNodes?: number | undefined; _lastMeanConns?: number | undefined; }, telemetryOptions: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").NeatOptions & import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryDiversityOptions, population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed[], entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryEntryRecord) => void

Attach complexity stats for multi-objective mode.

Parameters:

buildComplexityEntry

(telemetryOptions: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").NeatOptions & import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryDiversityOptions, meanCounts: { meanNodes: number; meanConns: number; }, maxCounts: { maxNodes: number; maxConns: number; }, meanEnabledRatio: number, growthValues: { growthNodes: number; growthConns: number; }) => { meanNodes: number; meanConns: number; maxNodes: number; maxConns: number; meanEnabledRatio: number; growthNodes: number; growthConns: number; budgetMaxNodes: number; budgetMaxConns: number; }

Build the complexity entry payload for multi-objective mode.

Parameters:

Returns: Complexity entry payload.

collectPopulationCounts

(populationSnapshot: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed[]) => { nodeCounts: number[]; connectionCounts: number[]; }

Collect node and connection counts for the population.

Parameters:

Returns: Node and connection counts arrays.

computeAndStoreGrowthValues

(context: { _lastMeanNodes?: number | undefined; _lastMeanConns?: number | undefined; }, meanCounts: { meanNodes: number; meanConns: number; }) => { growthNodes: number; growthConns: number; }

Compute growth values and store the latest means on the context.

Parameters:

Returns: Growth values for nodes and connections.

computeEnabledRatios

(populationSnapshot: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed[]) => number[]

Compute enabled ratios per genome.

Parameters:

Returns: Array of enabled ratios.

computeMaxCounts

(counts: { nodeCounts: number[]; connectionCounts: number[]; }) => { maxNodes: number; maxConns: number; }

Compute max node and connection counts.

Parameters:

Returns: Max node and connection counts.

computeMeanCounts

(counts: { nodeCounts: number[]; connectionCounts: number[]; }) => { meanNodes: number; meanConns: number; }

Compute mean node and connection counts.

Parameters:

Returns: Mean node and connection counts.

computeMeanEnabledRatio

(enabledRatios: number[]) => number

Compute mean of enabled ratios.

Parameters:

Returns: Mean enabled ratio.

neat/neat.telemetry.diversity.utils.ts

applyFastModeDefaults

(telemetryContext: { _fastModeTuned?: boolean | undefined; }, telemetryOptions: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").NeatOptions & import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryDiversityOptions) => void

Apply fast-mode tuning to diversity sampling and novelty defaults.

Parameters:

computeCompatibilityStats

(genomes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryGenome[], size: number, pairSampleCount: number, rngFactoryFn: () => () => number, compatibilityDistance: ((a: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryGenome, b: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryGenome) => number) | undefined) => { meanCompat: number; varCompat: number; }

Compute pairwise compatibility statistics via sampling.

Parameters:

Returns: Mean and variance of sampled compatibilities.

computeEntropyStats

(genomes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryGenome[], structuralEntropyFn: (genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryGenome) => number) => { meanEntropy: number; varEntropy: number; }

Compute structural entropy mean and variance across the population.

Parameters:

Returns: Mean and variance of entropy values.

computeGraphletEntropy

(genomes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryGenome[], size: number, graphletSampleCount: number, rngFactoryFn: () => () => number) => number

Sample graphlet motifs and compute entropy over their edge counts.

Parameters:

Returns: Graphlet entropy value.

countEnabledEdges

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryGenome, selectedNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").NodeLike[]) => number

Count enabled edges between the selected nodes in a genome.

Parameters:

Returns: Edge count capped at 3.

pickDistinctIndices

(upperBound: number, count: number, rng: () => number) => number[]

Pick a fixed number of distinct random indices.

Parameters:

Returns: Array of distinct indices.

neat/neat.telemetry.entropy.utils.ts

buildDegreeHistogram

(counts: Record<number, number>) => Record<number, number>

Build a histogram of degree frequencies from a degree-count table.

Parameters:

Returns: Map degree -> number of nodes with that degree.

computeDegreeCounts

(entropyGraph: { nodes: { geneId: number; }[]; connections: { from: { geneId: number; }; to: { geneId: number; }; enabled: boolean; }[]; }) => Record<number, number>

Compute per-node degree counts for enabled connections.

Parameters:

Returns: Map geneId -> degree count.

computeEntropyFromHistogram

(histogram: Record<number, number>, totalNodes: number) => number

Compute entropy from a degree-frequency histogram.

Parameters:

Returns: Entropy value (non-negative).

getCachedEntropy

(generation: number | undefined, entropyGraph: Record<string, unknown>) => number | undefined

Read a cached entropy value if it exists and belongs to the current generation.

Parameters:

Returns: Cached entropy number, or undefined when not available.

setCachedEntropy

(generation: number | undefined, entropyGraph: Record<string, unknown>, entropyValue: number) => void

Cache an entropy value for the current generation on the graph object.

Parameters:

neat/neat.telemetry.exports.ts

buildSpeciesHistoryCsv

(recentHistory: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciesHistoryEntry[], headers: string[]) => string

Build the full CSV string for species history given ordered headers and a slice of history entries.

Implementation notes:

buildTelemetryHeaders

(info: TelemetryHeaderInfo) => string[]

Build the ordered list of CSV headers from collected metadata. Flattened nested metrics are emitted using group prefixes (group.key).

collectTelemetryHeaderInfo

(entries: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").TelemetryEntry[]) => TelemetryHeaderInfo

Collect header metadata from the raw telemetry entries.

DEFAULT_SPECIES_BEST_SCORE

DEFAULT_SPECIES_HISTORY_GENERATION

DEFAULT_SPECIES_HISTORY_MAX_ENTRIES

DEFAULT_SPECIES_ID

DEFAULT_SPECIES_LAST_IMPROVED

DEFAULT_SPECIES_SIZE

exportSpeciesHistoryCSV

(maxEntries: number) => string

Export species history snapshots to CSV.

Each row represents a single species at a specific generation; the generation value is repeated per species. Dynamically discovers species stat keys so custom metadata added at runtime is preserved.

Behavior:

Parameters:

Returns: CSV string (headers + rows) describing species evolution timeline.

exportTelemetryCSV

(maxEntries: number) => string

Export recent telemetry entries to a CSV string.

Responsibilities:

Flattening Rules:

Parameters:

Returns: CSV string (headers + rows) or empty string when no telemetry.

exportTelemetryJSONL

() => string

Telemetry export helpers extracted from neat.ts.

This module exposes small helpers intended to serialize the internal telemetry gathered by the NeatapticTS Neat runtime into common data-export formats (JSONL and CSV). The functions intentionally operate against this so they can be attached to instances.

serializeTelemetryEntry

(entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").TelemetryEntry, headers: string[]) => string

Serialize one telemetry entry into a CSV row using previously computed headers. Uses a switch(true) pattern instead of a long if/else chain to reduce cognitive complexity while preserving readability of each scenario.

TelemetryHeaderInfo

Shape describing collected telemetry header discovery info.

neat/neat.telemetry.exports.utils.ts

buildSpeciesHistoryStats

(speciesList: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciesHistoryStat[], defaultSpeciesId: number, defaultSpeciesSize: number, defaultBestScore: number, defaultLastImproved: number) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciesHistoryStat[]

Normalize raw species records into exportable history stats.

Parameters:

Returns: Normalized stats for CSV export.

collectBaseKeys

(entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").TelemetryEntry, state: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.exports.utils").TelemetryHeaderCollectionState, frontsHeader: string) => void

Collect base (top-level) telemetry keys for a single entry.

Parameters:

Returns: void. Mutates state.baseKeys.

collectDiversityLineageMetrics

(entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").TelemetryEntry, state: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.exports.utils").TelemetryHeaderCollectionState) => void

Collect curated diversity lineage metrics for stable CSV exports.

Parameters:

Returns: void. Mutates diversity lineage key set.

collectGroupedMetricKeys

(entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").TelemetryEntry, state: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.exports.utils").TelemetryHeaderCollectionState) => void

Collect nested metric keys for grouped telemetry fields.

Parameters:

Returns: void. Mutates complexity/perf/lineage key sets.

collectOptionalColumnPresence

(entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").TelemetryEntry, state: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.exports.utils").TelemetryHeaderCollectionState) => void

Collect presence flags for optional telemetry columns.

Parameters:

Returns: void. Mutates optional-column flags.

collectSpeciesHistoryHeaders

(history: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciesHistoryEntry[], generationHeader: string) => string[]

Collect ordered header keys for species history CSV export.

Parameters:

Returns: Ordered header list for CSV output.

ensureMinimalSpeciesSnapshot

(neatInstance: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").NeatLike & { _speciesHistory?: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciesHistoryEntry[] | undefined; _species?: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciesHistoryStat[] | undefined; generation?: number | undefined; }, history: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciesHistoryEntry[], fallbackGeneration: number, defaultSpeciesId: number, defaultSpeciesSize: number, defaultBestScore: number, defaultLastImproved: number) => void

Ensure a minimal species snapshot exists for deterministic CSV headers.

Parameters:

Returns: void. Mutates history when a minimal snapshot is needed.

ensureSpeciesHistoryArray

(neatInstance: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").NeatLike & { _speciesHistory?: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciesHistoryEntry[] | undefined; }) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciesHistoryEntry[]

Ensure the species history array exists on the Neat instance.

Parameters:

Returns: Species history backing array (ensured on instance).

resolveSpeciesHistoryCellValue

(historyEntry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciesHistoryEntry, speciesStat: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciesHistoryStat, headerName: string, generationHeader: string) => string

Resolve a single species history cell value for the provided header.

Parameters:

Returns: Serialized cell (JSON) or empty string for missing values.

safeStringifyCell

(value: unknown) => string

Serialize a CSV cell with JSON.stringify safeguards.

Parameters:

Returns: JSON string or empty string when JSON.stringify returns undefined.

serializeSpeciesHistoryRow

(historyEntry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciesHistoryEntry, speciesStat: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciesHistoryStat, orderedHeaders: string[], generationHeader: string) => string

Serialize one species history row using the provided headers.

Parameters:

Returns: CSV row string matching the provided header order.

TelemetryHeaderCollectionState

Mutable state container used while collecting telemetry header metadata.

neat/neat.telemetry.lineage.utils.ts

applyLineageStatsMonoObjective

(telemetryContext: { _lineageEnabled?: boolean | undefined; _getRNG?: (() => () => number) | undefined; _lastMeanDepth?: number | undefined; _prevInbreedingCount?: number | undefined; }, populationSnapshot: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed[], entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryEntryRecord) => void

Apply lineage stats for mono-objective mode using sampled ancestors.

Parameters:

applyLineageStatsMultiObjective

(telemetryContext: { _lineageEnabled?: boolean | undefined; _getRNG?: (() => () => number) | undefined; _lastMeanDepth?: number | undefined; _prevInbreedingCount?: number | undefined; }, population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed[], entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryEntryRecord) => void

Apply lineage stats for multi-objective mode using ancestor uniqueness.

Parameters:

buildLineageContext

(context: { _getRNG?: (() => () => number) | undefined; }, populationSnapshot: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed[]) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.lineage.utils").NeatLineageContext

Build a lineage helper context for ancestor operations.

Parameters:

Returns: Lineage helper context.

buildLineageEntry

(context: { _prevInbreedingCount?: number | undefined; }, bestGenomeSnapshot: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed, meanDepthValue: number, ancestorUniquenessScore: number) => { parents: number[]; depthBest: number; meanDepth: number; inbreeding: number; ancestorUniq: number; }

Build the lineage entry payload.

Parameters:

Returns: Lineage entry payload.

collectDepths

(populationSnapshot: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed[]) => number[]

Collect depth values for the current population.

Parameters:

Returns: Array of depth values (defaults to 0).

computeAncestorUniquenessSampled

(context: { _getRNG?: (() => () => number) | undefined; }, populationSnapshot: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed[]) => number

Compute ancestor uniqueness using sampled Jaccard distance.

Parameters:

Returns: Rounded ancestor uniqueness score.

computeLineageStats

(lineageEnabled: boolean, genomes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryGenome[], size: number, pairSampleCount: number, rngFactoryFn: () => () => number) => { lineageMeanDepth: number; lineageMeanPairDist: number; }

Compute lineage depth and pairwise depth-distance statistics.

Parameters:

Returns: Lineage mean depth and pairwise distance.

computeMeanDepth

(depthValues: number[]) => number

Compute the mean depth from a depth list.

Parameters:

Returns: Mean depth value.

computePairJaccardDistance

(context: { _getRNG?: (() => () => number) | undefined; }, populationSnapshot: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed[], firstIndex: number, secondIndex: number) => number | undefined

Compute Jaccard distance between ancestor sets for a pair.

Parameters:

Returns: Jaccard distance or undefined when both sets are empty.

countAncestorIntersection

(ancestorsA: Set<number>, ancestorsB: Set<number>) => number

Count the size of an ancestor intersection.

Parameters:

Returns: Intersection count.

isLineageEligible

(context: { _lineageEnabled?: boolean | undefined; }, populationSnapshot: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed[]) => boolean

Check whether lineage metrics should be computed.

Parameters:

Returns: True when lineage stats should be computed.

pickDistinctPairIndices

(context: { _getRNG?: (() => () => number) | undefined; }, populationSize: number) => { firstIndex: number; secondIndex: number; }

Pick two distinct indices using the context RNG.

Parameters:

Returns: Pair of distinct indices.

neat/neat.telemetry.objectives.utils.ts

applyHypervolumeTelemetry

(telemetryOptions: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").NeatOptions & import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryDiversityOptions, hyperVolumeProxy: number, entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryEntryRecord) => void

Attach hypervolume scalar when requested.

Parameters:

applyObjectiveAges

(telemetryContext: { _objectiveAges?: Map<string, number> | undefined; }, entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryEntryRecord) => void

Apply objective age snapshots to the entry.

Parameters:

applyObjectiveEvents

(telemetryContext: { _pendingObjectiveAdds?: string[] | undefined; _pendingObjectiveRemoves?: string[] | undefined; _objectiveEvents?: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").ObjectiveEvent[] | undefined; }, entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryEntryRecord, generation: number) => void

Apply and flush objective lifecycle events.

Parameters:

applyObjectiveImportance

(telemetryContext: { _lastObjImportance?: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").ObjImportance | undefined; }, entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryEntryRecord) => void

Apply the most recent objective importance snapshot.

Parameters:

applyObjectivesSnapshot

(telemetryContext: { _getObjectives?: (() => { key: string; }[]) | undefined; }, entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryEntryRecord) => void

Apply objectives list snapshot (keys only).

Parameters:

applySpeciesAllocation

(telemetryContext: { _lastOffspringAlloc?: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciesAlloc[] | undefined; }, entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryEntryRecord) => void

Apply per-species offspring allocation snapshot.

Parameters:

computeHyperVolumeProxy

(telemetryOptions: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").NeatOptions & import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryDiversityOptions, population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed[]) => number

Compute a hypervolume-like proxy for the Pareto front.

Parameters:

Returns: Hypervolume proxy value.

computeParetoFrontSizes

(population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed[]) => number[]

Compute sizes of early Pareto fronts.

Parameters:

Returns: Array of front sizes (rank 0..4).

neat/neat.telemetry.operator.utils.ts

computeOperatorStatsSnapshot

(operatorStats: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").OperatorStatsMap | undefined) => { op: string; succ: number; att: number; }[]

Snapshot operator statistics into a telemetry-friendly array.

Parameters:

Returns: Operator stats snapshot array.

neat/neat.telemetry.performance.utils.ts

applyPerformanceStats

(telemetryContext: { _lastEvalDuration?: number | undefined; _lastEvolveDuration?: number | undefined; }, telemetryOptions: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").NeatOptions & import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryDiversityOptions, entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryEntryRecord) => void

Attach performance stats when configured.

Parameters:

neat/neat.telemetry.rng.utils.ts

applyRngState

(telemetryContext: { _rngState?: unknown; }, telemetryOptions: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").NeatOptions & import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryDiversityOptions, entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryEntryRecord) => void

Attach RNG state when configured.

Parameters:

neat/neat.telemetry.selection.utils.ts

getTelemetryCoreSnapshot

(sourceEntry: Record<string, unknown>, fields: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryCoreFields) => Partial<Record<string, unknown>>

Build a snapshot of the core telemetry fields present on the entry; does not mutate the source entry.

Parameters:

Returns: Shallow snapshot of core fields that exist on the entry.

mergeTelemetryCoreFields

(sourceEntry: Record<string, unknown>, coreSnapshot: Partial<Record<string, unknown>>) => Record<string, unknown>

Re-attach core fields to the filtered entry. Mutates the entry so the caller keeps the original reference.

Parameters:

Returns: The same entry reference with core fields restored.

safelyApplyTelemetrySelect

(telemetryContext: TContext, telemetryEntry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").TelemetryEntry, applyTelemetrySelectFn: (this: TContext, entry: Record<string, unknown>) => Record<string, unknown>) => void

Apply telemetry selection while swallowing any selection errors.

Parameters:

stripUnselectedTelemetryKeys

(sourceEntry: Record<string, unknown>, selection: Set<string>, fields: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryCoreFields) => Record<string, unknown>

Remove non-core keys that are not whitelisted by the selection set. Mutates the provided entry in-place for efficiency.

Parameters:

Returns: The same entry reference after filtering.

neat/neat.telemetry.ts

applyTelemetrySelect

(entry: Record<string, unknown>) => Record<string, unknown>

Apply a telemetry selection whitelist to a telemetry entry.

This helper inspects a per-instance Set of telemetry keys stored at this._telemetrySelect. If present, only keys included in the set are retained on the produced entry. Core fields (generation, best score and species count) are always preserved.

Example:

Parameters:

Returns: The filtered telemetry object (same reference as input).

buildTelemetryEntry

(fittest: Record<string, unknown>) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").TelemetryEntry

Build a comprehensive telemetry entry for the current generation.

The returned object contains a snapshot of population statistics, multi- objective front sizes, operator statistics, lineage summaries and optional complexity/performance metrics depending on configured telemetry options.

This function intentionally mirrors the legacy in-loop telemetry construction to preserve behavior relied upon by tests and consumers.

Example:

Parameters:

Returns: A TelemetryEntry object suitable for recording/streaming.

computeDiversityStats

() => void

Compute several diversity statistics used by telemetry reporting.

This helper is intentionally conservative in runtime: when fastMode is enabled it will automatically tune a few sampling defaults to keep the computation cheap. The computed statistics are written to this._diversityStats as an object with keys like meanCompat and graphletEntropy.

createTelemetryEntryBase

(generationIndex: number, bestScore: number, speciesCount: number) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").TelemetryEntry

Create a strict baseline telemetry entry with required fields populated.

This helper centralizes defaults so downstream telemetry producers can extend the entry while keeping the strict TelemetryEntry contract.

Parameters:

Returns: A strict telemetry entry with required fields populated.

recordTelemetryEntry

(entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").TelemetryEntry) => void

Record a telemetry entry into the instance buffer and optionally stream it.

Steps: This method performs the following steps to persist and optionally stream telemetry:

  1. Apply applyTelemetrySelect to filter fields according to user selection.
  2. Ensure this._telemetry buffer exists and push the entry.
  3. If a telemetry stream callback is configured, call it.
  4. Trim the buffer to a conservative max size (500 entries).

Example:

Parameters:

structuralEntropy

(graph: { [key: string]: unknown; nodes: { geneId: number; }[]; connections: { from: { geneId: number; }; to: { geneId: number; }; enabled: boolean; }[]; }) => number

Lightweight proxy for structural entropy based on degree-distribution.

This function computes an approximate entropy of a graph topology by counting node degrees and computing the entropy of the degree histogram. The result is cached on the graph object for the current generation in _entropyVal to avoid repeated expensive recomputation.

Example:

Parameters:

Returns: A non-negative number approximating structural entropy.

TelemetryContext

Context view used within telemetry helpers to access optional internal fields with descriptive names rather than repeated inline casts.

neat/neat.telemetry.types.ts

OperatorStatsMap

Operator stats map shape for telemetry extraction.

TelemetryBufferContext

Minimal telemetry buffer context shape.

TelemetryCoreFields

Core telemetry field keys used by selection helpers.

TelemetryDiversityOptions

Diversity telemetry options for sampling and novelty defaults.

TelemetryEntryRecord

Telemetry entry shape used for constructing snapshots.

TelemetryGenome

Minimal genome shape used by telemetry helpers.

TelemetrySelectContext

Minimal telemetry selection context shape.

TelemetryStreamOptions

Minimal telemetry stream options for streaming helpers.

neat/neat.telemetry.utils.ts

applyComplexityStatsMonoObjective

(telemetryContext: { _lastMeanNodes?: number | undefined; _lastMeanConns?: number | undefined; }, telemetryOptions: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").NeatOptions & import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryDiversityOptions, populationSnapshot: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed[], entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryEntryRecord) => void

Attach complexity stats for mono-objective mode.

Parameters:

applyComplexityStatsMultiObjective

(telemetryContext: { _lastMeanNodes?: number | undefined; _lastMeanConns?: number | undefined; }, telemetryOptions: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").NeatOptions & import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryDiversityOptions, population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed[], entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryEntryRecord) => void

Attach complexity stats for multi-objective mode.

Parameters:

applyFastModeDefaults

(telemetryContext: { _fastModeTuned?: boolean | undefined; }, telemetryOptions: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").NeatOptions & import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryDiversityOptions) => void

Apply fast-mode tuning to diversity sampling and novelty defaults.

Parameters:

applyHypervolumeTelemetry

(telemetryOptions: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").NeatOptions & import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryDiversityOptions, hyperVolumeProxy: number, entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryEntryRecord) => void

Attach hypervolume scalar when requested.

Parameters:

applyLineageStatsMonoObjective

(telemetryContext: { _lineageEnabled?: boolean | undefined; _getRNG?: (() => () => number) | undefined; _lastMeanDepth?: number | undefined; _prevInbreedingCount?: number | undefined; }, populationSnapshot: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed[], entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryEntryRecord) => void

Apply lineage stats for mono-objective mode using sampled ancestors.

Parameters:

applyLineageStatsMultiObjective

(telemetryContext: { _lineageEnabled?: boolean | undefined; _getRNG?: (() => () => number) | undefined; _lastMeanDepth?: number | undefined; _prevInbreedingCount?: number | undefined; }, population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed[], entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryEntryRecord) => void

Apply lineage stats for multi-objective mode using ancestor uniqueness.

Parameters:

applyObjectiveAges

(telemetryContext: { _objectiveAges?: Map<string, number> | undefined; }, entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryEntryRecord) => void

Apply objective age snapshots to the entry.

Parameters:

applyObjectiveEvents

(telemetryContext: { _pendingObjectiveAdds?: string[] | undefined; _pendingObjectiveRemoves?: string[] | undefined; _objectiveEvents?: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").ObjectiveEvent[] | undefined; }, entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryEntryRecord, generation: number) => void

Apply and flush objective lifecycle events.

Parameters:

applyObjectiveImportance

(telemetryContext: { _lastObjImportance?: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").ObjImportance | undefined; }, entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryEntryRecord) => void

Apply the most recent objective importance snapshot.

Parameters:

applyObjectivesSnapshot

(telemetryContext: { _getObjectives?: (() => { key: string; }[]) | undefined; }, entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryEntryRecord) => void

Apply objectives list snapshot (keys only).

Parameters:

applyPerformanceStats

(telemetryContext: { _lastEvalDuration?: number | undefined; _lastEvolveDuration?: number | undefined; }, telemetryOptions: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").NeatOptions & import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryDiversityOptions, entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryEntryRecord) => void

Attach performance stats when configured.

Parameters:

applyRngState

(telemetryContext: { _rngState?: unknown; }, telemetryOptions: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").NeatOptions & import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryDiversityOptions, entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryEntryRecord) => void

Attach RNG state when configured.

Parameters:

applySpeciesAllocation

(telemetryContext: { _lastOffspringAlloc?: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").SpeciesAlloc[] | undefined; }, entry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryEntryRecord) => void

Apply per-species offspring allocation snapshot.

Parameters:

buildComplexityEntry

(telemetryOptions: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").NeatOptions & import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryDiversityOptions, meanCounts: { meanNodes: number; meanConns: number; }, maxCounts: { maxNodes: number; maxConns: number; }, meanEnabledRatio: number, growthValues: { growthNodes: number; growthConns: number; }) => { meanNodes: number; meanConns: number; maxNodes: number; maxConns: number; meanEnabledRatio: number; growthNodes: number; growthConns: number; budgetMaxNodes: number; budgetMaxConns: number; }

Build the complexity entry payload for multi-objective mode.

Parameters:

Returns: Complexity entry payload.

buildDegreeHistogram

(counts: Record<number, number>) => Record<number, number>

Build a histogram of degree frequencies from a degree-count table.

Parameters:

Returns: Map degree -> number of nodes with that degree.

buildLineageContext

(context: { _getRNG?: (() => () => number) | undefined; }, populationSnapshot: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed[]) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.lineage.utils").NeatLineageContext

Build a lineage helper context for ancestor operations.

Parameters:

Returns: Lineage helper context.

buildLineageEntry

(context: { _prevInbreedingCount?: number | undefined; }, bestGenomeSnapshot: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed, meanDepthValue: number, ancestorUniquenessScore: number) => { parents: number[]; depthBest: number; meanDepth: number; inbreeding: number; ancestorUniq: number; }

Build the lineage entry payload.

Parameters:

Returns: Lineage entry payload.

collectDepths

(populationSnapshot: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed[]) => number[]

Collect depth values for the current population.

Parameters:

Returns: Array of depth values (defaults to 0).

collectPopulationCounts

(populationSnapshot: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed[]) => { nodeCounts: number[]; connectionCounts: number[]; }

Collect node and connection counts for the population.

Parameters:

Returns: Node and connection counts arrays.

computeAncestorUniquenessSampled

(context: { _getRNG?: (() => () => number) | undefined; }, populationSnapshot: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed[]) => number

Compute ancestor uniqueness using sampled Jaccard distance.

Parameters:

Returns: Rounded ancestor uniqueness score.

computeAndStoreGrowthValues

(context: { _lastMeanNodes?: number | undefined; _lastMeanConns?: number | undefined; }, meanCounts: { meanNodes: number; meanConns: number; }) => { growthNodes: number; growthConns: number; }

Compute growth values and store the latest means on the context.

Parameters:

Returns: Growth values for nodes and connections.

computeCompatibilityStats

(genomes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryGenome[], size: number, pairSampleCount: number, rngFactoryFn: () => () => number, compatibilityDistance: ((a: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryGenome, b: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryGenome) => number) | undefined) => { meanCompat: number; varCompat: number; }

Compute pairwise compatibility statistics via sampling.

Parameters:

Returns: Mean and variance of sampled compatibilities.

computeDegreeCounts

(entropyGraph: { nodes: { geneId: number; }[]; connections: { from: { geneId: number; }; to: { geneId: number; }; enabled: boolean; }[]; }) => Record<number, number>

Compute per-node degree counts for enabled connections.

Parameters:

Returns: Map geneId -> degree count.

computeEnabledRatios

(populationSnapshot: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed[]) => number[]

Compute enabled ratios per genome.

Parameters:

Returns: Array of enabled ratios.

computeEntropyFromHistogram

(histogram: Record<number, number>, totalNodes: number) => number

Compute entropy from a degree-frequency histogram.

Parameters:

Returns: Entropy value (non-negative).

computeEntropyStats

(genomes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryGenome[], structuralEntropyFn: (genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryGenome) => number) => { meanEntropy: number; varEntropy: number; }

Compute structural entropy mean and variance across the population.

Parameters:

Returns: Mean and variance of entropy values.

computeGraphletEntropy

(genomes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryGenome[], size: number, graphletSampleCount: number, rngFactoryFn: () => () => number) => number

Sample graphlet motifs and compute entropy over their edge counts.

Parameters:

Returns: Graphlet entropy value.

computeHyperVolumeProxy

(telemetryOptions: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").NeatOptions & import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryDiversityOptions, population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed[]) => number

Compute a hypervolume-like proxy for the Pareto front.

Parameters:

Returns: Hypervolume proxy value.

computeLineageStats

(lineageEnabled: boolean, genomes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryGenome[], size: number, pairSampleCount: number, rngFactoryFn: () => () => number) => { lineageMeanDepth: number; lineageMeanPairDist: number; }

Compute lineage depth and pairwise depth-distance statistics.

Parameters:

Returns: Lineage mean depth and pairwise distance.

computeMaxCounts

(counts: { nodeCounts: number[]; connectionCounts: number[]; }) => { maxNodes: number; maxConns: number; }

Compute max node and connection counts.

Parameters:

Returns: Max node and connection counts.

computeMeanCounts

(counts: { nodeCounts: number[]; connectionCounts: number[]; }) => { meanNodes: number; meanConns: number; }

Compute mean node and connection counts.

Parameters:

Returns: Mean node and connection counts.

computeMeanDepth

(depthValues: number[]) => number

Compute the mean depth from a depth list.

Parameters:

Returns: Mean depth value.

computeMeanEnabledRatio

(enabledRatios: number[]) => number

Compute mean of enabled ratios.

Parameters:

Returns: Mean enabled ratio.

computeOperatorStatsSnapshot

(operatorStats: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").OperatorStatsMap | undefined) => { op: string; succ: number; att: number; }[]

Snapshot operator statistics into a telemetry-friendly array.

Parameters:

Returns: Operator stats snapshot array.

computePairJaccardDistance

(context: { _getRNG?: (() => () => number) | undefined; }, populationSnapshot: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed[], firstIndex: number, secondIndex: number) => number | undefined

Compute Jaccard distance between ancestor sets for a pair.

Parameters:

Returns: Jaccard distance or undefined when both sets are empty.

computeParetoFrontSizes

(population: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed[]) => number[]

Compute sizes of early Pareto fronts.

Parameters:

Returns: Array of front sizes (rank 0..4).

countAncestorIntersection

(ancestorsA: Set<number>, ancestorsB: Set<number>) => number

Count the size of an ancestor intersection.

Parameters:

Returns: Intersection count.

countEnabledEdges

(genome: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryGenome, selectedNodes: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").NodeLike[]) => number

Count enabled edges between the selected nodes in a genome.

Parameters:

Returns: Edge count capped at 3.

ensureTelemetryBuffer

(telemetryContext: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryBufferContext) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").TelemetryEntry[]

Ensure the telemetry buffer is initialized.

Parameters:

Returns: A mutable telemetry buffer.

getCachedEntropy

(generation: number | undefined, entropyGraph: Record<string, unknown>) => number | undefined

Read a cached entropy value if it exists and belongs to the current generation.

Parameters:

Returns: Cached entropy number, or undefined when not available.

getTelemetryCoreSnapshot

(sourceEntry: Record<string, unknown>, fields: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryCoreFields) => Partial<Record<string, unknown>>

Build a snapshot of the core telemetry fields present on the entry; does not mutate the source entry.

Parameters:

Returns: Shallow snapshot of core fields that exist on the entry.

isLineageEligible

(context: { _lineageEnabled?: boolean | undefined; }, populationSnapshot: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").GenomeDetailed[]) => boolean

Check whether lineage metrics should be computed.

Parameters:

Returns: True when lineage stats should be computed.

mergeTelemetryCoreFields

(sourceEntry: Record<string, unknown>, coreSnapshot: Partial<Record<string, unknown>>) => Record<string, unknown>

Re-attach core fields to the filtered entry. Mutates the entry so the caller keeps the original reference.

Parameters:

Returns: The same entry reference with core fields restored.

OperatorStatsMap

Operator stats map shape for telemetry extraction.

pickDistinctIndices

(upperBound: number, count: number, rng: () => number) => number[]

Pick a fixed number of distinct random indices.

Parameters:

Returns: Array of distinct indices.

pickDistinctPairIndices

(context: { _getRNG?: (() => () => number) | undefined; }, populationSize: number) => { firstIndex: number; secondIndex: number; }

Pick two distinct indices using the context RNG.

Parameters:

Returns: Pair of distinct indices.

safelyApplyTelemetrySelect

(telemetryContext: TContext, telemetryEntry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").TelemetryEntry, applyTelemetrySelectFn: (this: TContext, entry: Record<string, unknown>) => Record<string, unknown>) => void

Apply telemetry selection while swallowing any selection errors.

Parameters:

safelyStreamTelemetryEntry

(telemetryContext: { options?: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryStreamOptions | undefined; }, telemetryEntry: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").TelemetryEntry) => void

Stream telemetry entry when a stream callback is configured.

Parameters:

setCachedEntropy

(generation: number | undefined, entropyGraph: Record<string, unknown>, entropyValue: number) => void

Cache an entropy value for the current generation on the graph object.

Parameters:

stripUnselectedTelemetryKeys

(sourceEntry: Record<string, unknown>, selection: Set<string>, fields: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.telemetry.types").TelemetryCoreFields) => Record<string, unknown>

Remove non-core keys that are not whitelisted by the selection set. Mutates the provided entry in-place for efficiency.

Parameters:

Returns: The same entry reference after filtering.

TelemetryBufferContext

Minimal telemetry buffer context shape.

TelemetryCoreFields

Core telemetry field keys used by selection helpers.

TelemetryDiversityOptions

Diversity telemetry options for sampling and novelty defaults.

TelemetryEntryRecord

Telemetry entry shape used for constructing snapshots.

TelemetryGenome

Minimal genome shape used by telemetry helpers.

TelemetrySelectContext

Minimal telemetry selection context shape.

TelemetryStreamOptions

Minimal telemetry stream options for streaming helpers.

trimTelemetryBuffer

(telemetryBufferRef: import("/home/runner/work/NeatapticTS/NeatapticTS/src/neat/neat.types").TelemetryEntry[], maxEntries: number) => void

Trim the telemetry buffer to a maximum size.

Parameters:

neat/neat.types.ts

AnyObj

Shared lightweight structural types for modular NEAT components.

These are deliberately kept small & structural (duck-typed) so that helper modules can interoperate without importing the concrete (heavier) Neat class, avoiding circular references while the codebase is being progressively extracted / refactored.

Guidelines:

ComplexityMetrics

Aggregate structural complexity metrics capturing size & growth pressure.

ConnectionLike

Lightweight connection representation used by telemetry and structural helpers.

DiversityStats

Diversity statistics captured each generation. Individual fields may be omitted in telemetry output if diversity tracking is partially disabled to reduce runtime cost.

GenomeDetailed

More concrete genome surface used by telemetry and lineage helpers. Extends the minimal GenomeLike with node/connection shapes and a few internal bookkeeping fields used by telemetry.

GenomeLike

Minimal genome structural surface used by several helpers (incrementally expanded).

NOTE: nodes and connections remain intentionally structural/opaque until a stable public abstraction is finalised.

LineageSnapshot

Snapshot of lineage & ancestry statistics for the current generation.

NeatLike

Minimal surface every helper currently expects from a NEAT instance while extraction continues. Kept intentionally loose; prefer concrete fields when helpers are stabilised. Represented as a simple record to avoid an empty interface that duplicates its supertype.

NeatOptions

Options subset used by telemetry helpers. Kept narrow to avoid leaking full runtime options into the helper type surface.

NodeLike

Lightweight node representation used by telemetry and structural helpers.

ObjAges

Map of objective key to age in generations since introduction.

ObjectiveDescriptor

Descriptor for a single optimisation objective (single or multi‑objective runs).

ObjectiveEvent

Objective add/remove lifecycle event for telemetry and auditing.

ObjEvent

Dynamic objective lifecycle event (addition or removal).

Deprecated: Use ObjectiveEvent instead.

ObjImportance

Map of objective key to its importance metrics (range / variance).

ObjImportanceEntry

Contribution / dispersion metrics for an objective over a recent window. Used to gauge whether an objective meaningfully influences selection.

OperatorStat

Per-generation statistic for a genetic operator.

Success is operator‑specific (e.g. produced a structurally valid mutation). A high attempt count with low success can indicate constraints becoming tight (e.g. structural budgets reached) – useful for adaptive operator scheduling.

OperatorStatsRecord

Aggregated success / attempt counters over a window or entire run.

ParetoArchiveEntry

Pareto archive entry capturing a genome plus its objective values.

PerformanceMetrics

Timing metrics for coarse evolutionary phases (milliseconds).

SpeciationHarnessContext

Minimal runtime surface required by speciation helpers. Tests and harnesses can narrow the options type via the generic parameter.

SpeciationOptions

Speciation options for the NEAT speciation controller.

Extends {@link NeatOptions} with speciation-specific configuration used by:

SpeciesAlloc

Offspring allocation for a species during reproduction.

SpeciesHistoryEntry

Species statistics captured for a particular generation.

SpeciesHistoryStat

Species statistics at a single historical snapshot (generation boundary).

SpeciesHistoryStatExtended

Extended per-species historical snapshot with optional backfilled metrics that may be computed lazily (innovationRange, enabledRatio).

SpeciesLastStats

Rolling statistics tracked for each species between generations. These values inform stagnation heuristics and adaptive controllers.

SpeciesLike

Internal species representation used by helpers. Kept minimal and structural.

TelemetryEntry

Telemetry summary for one generation.

Optional properties are feature‑dependent; consumers MUST test for presence.

Generated from source JSDoc • GitHub