@zfunction/genetics-js
Version:
Genetic and evolutionary algorithms framework for the web
24 lines (23 loc) • 814 B
TypeScript
import { IntegerIndividual } from '../../../individual/numeric/integer/';
import { IndividualToken } from '../../base/';
import { NumericReader } from '../base/';
/**
* ## Integer Reader
* Reads an [[IntegerIndividual]] from a definition.
* The format of the definition is the following
* ```
* 3 5 7 23 // OK
* -4 -5 -8 // OK (Negative numbers allowed).
* ```
*/
export declare class IntegerReader extends NumericReader<IntegerIndividual> {
readonly tokenDefinition: Array<IndividualToken<number>>;
/**
* Reads a definition and converts
* into an [[IntegerIndividual]].
* @param definition of the individual.
* @return the read individual.
* @throws Error if definition is not correct.
*/
read(definition: string): IntegerIndividual;
}