@zfunction/genetics-js
Version:
Genetic and evolutionary algorithms framework for the web
41 lines (40 loc) • 1.59 kB
TypeScript
import { NumericIndividual, NumericRange } from '../../../individual/numeric/base';
import { BaseGenerator, GeneratorParams } from './../../base/';
/**
* ## NumericParams
* Params of the [[Numeric Generator]].
*/
export interface NumericParams extends GeneratorParams {
/**
* Range of the individuals that
* are going to be generated.
*/
range: NumericRange;
particularValue: (index: number) => number | undefined;
}
/**
* ## NumericGenerator
* Generator of [[NumericIndividuals]]
*/
export declare abstract class NumericGenerator<I extends NumericIndividual> extends BaseGenerator<I, NumericParams, number> {
/**
* Generates a [[NumericIndividual]]
* with the specified params.
* @param length of the individual that is going to be generated.
* @param range of the individual that is going to be generated.
* @param engine (of `random-js`) that is going to be used.
* @return [[NumericIndividual]] with the generated genotype.
* @throws RangeError if `length` is not greater than `0`.
* @throws Error if `range` is not valid.
*/
generate(length: number, range?: NumericRange, engine?: import("random-js").Engine): I;
/**
* Generates a [[NumericIndividual]] with
* the specified params.
* @param params of the generator.
* @return [[NumericIndividual]] with the generated genotype.
* @throws RangeError if `length` is not greater than `0`.
* @throws Error if `range` is not valid.
*/
generateWith(params: NumericParams): I;
}