UNPKG

@adrianperea/genie.js

Version:

A highly flexible, data-agnostic, and UI-independent Genetic Algorithm Library

9 lines (7 loc) 228 B
export function mutate(child, rate) { child.dna = child.dna.map((chromosome) => { const mutatedGenes = chromosome.mutate(chromosome.genes, rate); return chromosome.copyWithGenes(mutatedGenes); }); return child; }