UNPKG

enome

Version:

A genome generation and evolution library.

19 lines (18 loc) 1.23 kB
import { Agent, AgentEnvironment, IAgentUpdate, IInteraction, IStateUpdate } from 'enviro-rx'; import { Observer, Subscription } from 'rxjs'; import { Genome, IEvaluation, IEvolvable, IGenomeOptions, IOrganismOptions, IPopulationOptions, ReactiveProperty } from '../index'; export declare abstract class Organism<Gen extends IGenomeOptions, Pop extends IPopulationOptions, Org extends IOrganismOptions, Data, Pheno, AState, EState> extends Agent<AState, EState> implements IEvolvable<Gen, Pheno> { genotype: Genome<Gen>; options: Org; phenotype: Pheno; alive: ReactiveProperty<boolean>; readonly id: string; constructor(genotype: Genome<Gen>, options: Org); abstract interact(state: IStateUpdate<EState>): IAgentUpdate<AState>; abstract observe(interaction: IInteraction<AState, EState>): Data; abstract evaluate(data: Data[], genotype: Genome<Gen>, phenotype: Pheno): IEvaluation<Gen, Data, Pheno>; abstract createPhenotype(genotype: Genome<Gen>): Pheno; evaluation(env: AgentEnvironment<AState, EState>, evaluations: Observer<IEvaluation<Gen, Data, Pheno>>): Subscription; private observeInteraction(interaction); private evaluateObservations(observations); }