UNPKG

@syntest/core

Version:

The common core of the SynTest Framework

66 lines 2.37 kB
import { SearchAlgorithm } from "../SearchAlgorithm"; import { ObjectiveManager } from "../../objective/managers/ObjectiveManager"; import { EncodingSampler } from "../../EncodingSampler"; import { Crossover } from "../../operators/crossover/Crossover"; import { BudgetManager } from "../../budget/BudgetManager"; import { TerminationManager } from "../../termination/TerminationManager"; import { Encoding } from "../../Encoding"; import { EventManager } from "../../../event/EventManager"; /** * Base class for Evolutionary Algorithms (EA). * Uses the T encoding. */ export declare abstract class EvolutionaryAlgorithm<T extends Encoding> extends SearchAlgorithm<T> { /** * The sampler used to sample new encodings. * @protected */ protected _encodingSampler: EncodingSampler<T>; /** * The population of the EA. * This population is evolved over time and becomes more optimized. * @protected */ protected _population: T[]; /** * The size of the population. * @protected */ protected _populationSize: number; protected _crossover: Crossover<T>; /** * Constructor. * * @param eventManager The event manager * @param objectiveManager The objective manager used by the specific algorithm * @param encodingSampler The encoding sampler used by the specific algorithm * @param crossover The crossover operator to apply * * @protected */ protected constructor(eventManager: EventManager<T>, objectiveManager: ObjectiveManager<T>, encodingSampler: EncodingSampler<T>, crossover: Crossover<T>); /** * @inheritDoc * @protected */ protected _initialize(budgetManager: BudgetManager<T>, terminationManager: TerminationManager): Promise<void>; /** * @inheritDoc * @protected */ protected _iterate(budgetManager: BudgetManager<T>, terminationManager: TerminationManager): Promise<void>; /** * Generates offspring based on the current population. * * @protected */ protected _generateOffspring(): T[]; /** * Makes a selection of the population based on the environment. * * @param size The size of the selection * @protected */ protected abstract _environmentalSelection(size: number): void; } //# sourceMappingURL=EvolutionaryAlgorithm.d.ts.map