UNPKG

@syntest/search

Version:

The common core of the SynTest Framework

73 lines 2.83 kB
import { Logger } from "@syntest/logging"; import { Archive } from "../Archive"; import { BudgetManager } from "../budget/BudgetManager"; import { Encoding } from "../Encoding"; import { ObjectiveManager } from "../objective/managers/ObjectiveManager"; import { ObjectiveFunction } from "../objective/ObjectiveFunction"; import { SearchSubject } from "../SearchSubject"; import { TerminationManager } from "../termination/TerminationManager"; /** * Abstract search algorithm to search for an optimal solution within the search space. * * The search algorithm is dependent on the encoding of the search space. * * @author Mitchell Olsthoorn */ export declare abstract class SearchAlgorithm<T extends Encoding> { protected static LOGGER: Logger; /** * The population. * * @protected */ protected _population: T[]; /** * Manager that keeps track of which objectives have been covered and are still to be searched. * @protected */ protected _objectiveManager: ObjectiveManager<T>; /** * Abstract constructor. * * @param eventManager The event manager * @param objectiveManager The objective manager * @protected */ protected constructor(objectiveManager: ObjectiveManager<T>); /** * Initialization phase of the search process. * * @protected * @param budgetManager The budget manager to track budget progress * @param terminationManager The termination trigger manager */ protected abstract _initialize(budgetManager: BudgetManager<T>, terminationManager: TerminationManager): Promise<void> | void; /** * Iteration phase of the search process. * * @protected * @param budgetManager The budget manager to track budget progress * @param terminationManager The termination trigger manager */ protected abstract _iterate(budgetManager: BudgetManager<T>, terminationManager: TerminationManager): Promise<void>; /** * Search the search space for an optimal solution until one of the termination conditions are met. * * @param subject The subject of the search * @param budgetManager The budget manager to track budget progress * @param terminationManager The termination trigger manager */ search(subject: SearchSubject<T>, budgetManager: BudgetManager<T>, terminationManager: TerminationManager): Promise<Archive<T>>; calculateObjectivePerformance(objectives: ObjectiveFunction<T>[]): Map<ObjectiveFunction<T>, number>; /** * Return the objective manager. */ getObjectiveManager(): ObjectiveManager<T>; private getCovered; private getUncovered; /** * The progress of the search process. */ progress(objectiveType?: string): number; } //# sourceMappingURL=SearchAlgorithm.d.ts.map