@syntest/core
Version:
The common core of the SynTest Framework
67 lines • 2.13 kB
TypeScript
import { ExecutionResult } from "./ExecutionResult";
import { ObjectiveFunction } from "./objective/ObjectiveFunction";
import { EncodingSampler } from "./EncodingSampler";
import { Decoder } from "./Decoder";
/**
* Encoding of the search problem.
*
* @author Mitchell Olsthoorn
*/
export declare abstract class Encoding {
protected _crowdingDistance: number;
protected _rank: number;
protected _id: string;
protected _assertions: Map<string, string>;
/**
* Mapping from objective to their distance values for this test case.
* @protected
*/
protected _objectives: Map<ObjectiveFunction<Encoding>, number>;
/**
* The last execution result of this test case.
* @protected
*/
protected _executionResult: ExecutionResult;
/**
* Constructor.
*/
constructor();
abstract mutate(sampler: EncodingSampler<Encoding>): Encoding;
abstract hashCode(decoder: Decoder<Encoding, string>): number;
getCrowdingDistance(): number;
setCrowdingDistance(value: number): void;
getRank(): number;
setRank(value: number): void;
get id(): string;
get assertions(): Map<string, string>;
set assertions(value: Map<string, string>);
abstract copy(): Encoding;
/**
* Return the execution result.
*/
getExecutionResult(): ExecutionResult;
/**
* Store the execution result.
*
* @param executionResult The execution result to store
*/
setExecutionResult(executionResult: ExecutionResult): void;
/**
* Return the distance for the given objective.
*
* @param objectiveFunction The objective.
*/
getDistance(objectiveFunction: ObjectiveFunction<Encoding>): number;
/**
* Store the distance to an objective for this encoding.
*
* @param objectiveFunction The objective
* @param distance The distance
*/
setDistance(objectiveFunction: ObjectiveFunction<Encoding>, distance: number): void;
/**
* Return the length of the encoding/chromosome
*/
abstract getLength(): number;
}
//# sourceMappingURL=Encoding.d.ts.map