UNPKG

@adrianperea/genie.js

Version:

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

14 lines (12 loc) 329 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.mutate = mutate; function mutate(child, rate) { child.dna = child.dna.map(function (chromosome) { var mutatedGenes = chromosome.mutate(chromosome.genes, rate); return chromosome.copyWithGenes(mutatedGenes); }); return child; }