The type of object representing an individual. Must extend WithFitness.
Initializes a new instance of the Genetic Algorithm. *
The type of object representing an individual. Must extend WithFitness.
Initial configuration object implementing geneticAlgorithmOptions.
Protected Optional InternalfitnessFitness evaluation function.
The current generation number in the evolutionary process. Starts at 1 and increments with each successful evolution step.
The current population of individuals in their current evolutionary state.
Starts or continues the evolution process for a given number of generations.
The process will stop early if the fitnessObjective is met or if stop() is manually invoked.
*
A promise that resolves with the fittest individual found in the final population.
Stops any active execution and fully resets the state of the algorithm (generation back to 1 and population reset to the original initial population).
Sets the crossover method to mix the genetic code of the parents. *
Function that takes two parents and returns a new child combining their properties.
The GeneticAlgorithm instance to enable method chaining (fluent API).
Sets the fitness function to evaluate each individual in the population. *
Asynchronous function that calculates and returns the numerical fitness value.
The GeneticAlgorithm instance to enable method chaining (fluent API).
Sets the mutation method for the created children. *
Function that randomly alters features of a child individual.
The GeneticAlgorithm instance to enable method chaining (fluent API).
Sets the parent selection method. *
Function responsible for choosing two parents from the current population.
The GeneticAlgorithm instance to enable method chaining (fluent API).
Immediately stops the ongoing asynchronous evolution process (evolve) upon completing the current step.
Main class for running an asynchronous Genetic Algorithm. Allows optimizing (maximizing or minimizing) a population of entities based on custom fitness, selection, crossover, and mutation functions. *