UNPKG

tycho-solver

Version:

Evolutionary computation and optimization library

29 lines (28 loc) 726 B
/** * Core types for the Tycho Solver library */ /** * Represents a fitness function that evaluates the quality of a solution */ export type FitnessFunction<T> = (individual: T) => number; /** * Configuration options for evolutionary algorithms */ export interface EvolutionaryConfig { populationSize: number; maxGenerations: number; selectionPressure?: number; mutationRate?: number; crossoverRate?: number; elitism?: number; } /** * Interface for evolutionary algorithm implementations */ export interface EvolutionaryAlgorithm<T> { evolve(generations?: number): Promise<T>; getBestSolution(): T; getBestFitness(): number; getPopulation(): T[]; getGeneration(): number; }