UNPKG

@syntest/core

Version:

The common core of the SynTest Framework

103 lines 3.3 kB
import { Encoding } from "../../Encoding"; import { ObjectiveFunction } from "../ObjectiveFunction"; import { Archive } from "../../Archive"; import { SearchSubject } from "../../SearchSubject"; import { EncodingRunner } from "../../EncodingRunner"; import { BudgetManager } from "../../budget/BudgetManager"; import { TerminationManager } from "../../termination/TerminationManager"; /** * Manager that keeps track of which objectives have been covered and are still to be searched. * * @author Mitchell Olsthoorn */ export declare abstract class ObjectiveManager<T extends Encoding> { /** * Archive of covered objectives with the fittest encoding for that objective. * @protected */ protected _archive: Archive<T>; /** * Set of current objectives. * @protected */ protected _currentObjectives: Set<ObjectiveFunction<T>>; /** * Set of covered objectives. * @protected */ protected _coveredObjectives: Set<ObjectiveFunction<T>>; /** * Set of uncovered objectives. * @protected */ protected _uncoveredObjectives: Set<ObjectiveFunction<T>>; /** * Runner for executing encodings. * @protected */ protected _runner: EncodingRunner<T>; /** * The subject of the search. * @protected */ protected _subject: SearchSubject<T>; /** * Constructor. * * @param runner Encoding runner * @protected */ protected constructor(runner: EncodingRunner<T>); /** * Update the objectives. * * @param objectiveFunction * @param encoding * @param distance * @protected */ protected abstract _updateObjectives(objectiveFunction: ObjectiveFunction<T>, encoding: T, distance: number): void; /** * Evaluate multiple encodings on the current objectives. * * @param encodings The encoding to evaluate * @param budgetManager The budget manager to track the remaining budget * @param terminationManager The termination trigger manager */ evaluateMany(encodings: T[], budgetManager: BudgetManager<T>, terminationManager: TerminationManager): Promise<void>; /** * Evaluate one encoding on the current objectives. * * @param encoding The encoding to evaluate * @param budgetManager The budget manager to track evaluation * @param terminationManager The termination trigger manager */ evaluateOne(encoding: T, budgetManager: BudgetManager<T>, terminationManager: TerminationManager): Promise<void>; /** * Load the objectives from the search subject into the manager. * * @param subject The subject to load in */ abstract load(subject: SearchSubject<T>): void; /** * Return the uncovered objectives. */ getUncoveredObjectives(): Set<ObjectiveFunction<T>>; /** * Return the current objectives. */ getCurrentObjectives(): Set<ObjectiveFunction<T>>; /** * Return the covered objectives. */ getCoveredObjectives(): Set<ObjectiveFunction<T>>; /** * Return the archive. */ getArchive(): Archive<T>; /** * Determines if there are objectives left to cover. */ hasObjectives(): boolean; } //# sourceMappingURL=ObjectiveManager.d.ts.map