The type of genome objects in the population.
Constructs a new instance of the GeneticSearch class.
The configuration for the genetic search.
The strategy configuration for genetic operations.
OptionalidGenerator: IdGeneratorInterface<TGenome>An optional ID generator for the genomes.
Protected_generationProtected_populationProtected_populationProtected ReadonlyconfigProtected ReadonlygenomeProtected ReadonlyidProtected ReadonlypopulationProtected ReadonlystrategyRetrieves the phenome cache used by the genetic search algorithm.
The phenome cache instance.
The current generation number.
The current generation number.
Calculates and returns the partitions of the population for the genetic operations.
A tuple containing:
Sets the current population of genomes.
The new population of genomes.
ProtectedcrossoverCrosses the given input population.
The population of genomes to cross.
The number of new genomes to create.
An array of new genomes created by crossing the input population.
Runs the genetic search algorithm.
The configuration for the genetic search algorithm.
A promise that resolves when the algorithm has finished running.
Runs a single step of the genetic search algorithm.
Optionalscheduler: SchedulerInterface<TGenome>Optional. The scheduler to use for the genetic search algorithm.
A promise that resolves with the fitness of the best genome in the population.
Retrieves the population summary, optionally rounding the statistics to a specified precision.
OptionalroundPrecision: numberOptional. The number of decimal places to round the summary statistics to. If not provided, no rounding is applied.
The population summary, with statistics rounded to the specified precision if provided.
ProtectedmutateMutates the given input population.
The population of genomes to mutate.
The number of new genomes to create.
An array of new genomes created by mutating the input population.
ProtectedrefreshRefreshes the population buffer from the evaluated population.
The population of genomes to refresh the population buffer with.
Sets the current population of genomes.
The new population of genomes.
Whether to reset the ID generator. Defaults to true.
A genetic search algorithm.
Remarks
This class implements the genetic search algorithm. The algorithm is configured using the [[GeneticSearchConfig]] object.
The algorithm uses the following components, which can be customized by providing a custom implementation: