methods/crossover

Crossover methods for genetic algorithms.

These methods implement the crossover strategies described in the Instinct algorithm, enabling the creation of offspring with unique combinations of parent traits.

Read this file as an inheritance-policy shelf: each method answers a different question about how aggressively two parents should be mixed.

A practical chooser for first experiments:

Minimal workflow:

const broadMixing = crossover.UNIFORM;

const oneCut = crossover.SINGLE_POINT;

const twoCut = {
  ...crossover.TWO_POINT,
  config: [0.25, 0.75],
};

const blendedOffspring = crossover.AVERAGE;
flowchart LR
  Parents[Two parent genomes] --> Segment[Segment-preserving crossover]
  Parents --> GeneWise[Gene-wise crossover]
  Parents --> Blend[Numeric blending]
  Segment --> Single[SINGLE_POINT]
  Segment --> Double[TWO_POINT]
  GeneWise --> Uniform[UNIFORM]
  Blend --> Average[AVERAGE]

methods/crossover/crossover.ts

Generated from source JSDoc • GitHub