Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// @flow
import rfdc from "rfdc";
import fittest from "../singleSelector/fittest.js";
import tournament3 from "../pairSelector/tournament3.js";
import greater from "../fitnessComparator/greater.js";
import delay from "../utils/delay.js";
const cloneDeep = rfdc();
type Individual = { entity: T, fitness: number };
type Parameters = {
seed: T[],
fitnessEvaluator: T => number,
fitnessComparator: (number, number) => boolean,
iterationCallback: ({
iterationNumber: number,
elapsedTime: number,
bestIndividual: Individual,
population: Individual[]
}) => boolean,
mutationFunction: T => T,
crossoverFunction: (T, T) => [T, T],
selectSingleFunction: (