Class Agent<ChromosomeType, FitnessType>Abstract

Description

An agent is a virtual entity that can be placed in a simulation. It contains a set of chromosomes and compute a fitness value that is used during the selection and crossover process.

Type Parameters

  • ChromosomeType = DefaultGenesType

    Type of the group (array, tensor, set, etc.) of genes. The genome will be a group of this type. By default, it is an array of numbers.

  • FitnessType = DefaultFitnessType

    The type of the returned score of the agent. By default, it is a number.

Hierarchy

  • Agent

Constructors

Accessors

Methods

Constructors

  • new Agent<ChromosomeType, FitnessType>(): Agent<ChromosomeType, FitnessType>
  • Type Parameters

    Returns Agent<ChromosomeType, FitnessType>

Accessors

  • get genome(): Genome<ChromosomeType>
  • Group of chromosomes that forms the agent

    Returns Genome<ChromosomeType>

Methods

  • getScore(): Promise<FitnessType>
  • Description

    Gets the fitness value of the agent.

    Returns

    The fitness value of the agent.

    Returns Promise<FitnessType>

  • crossover<ChromosomeType, FitnessType>(agentA: Agent<ChromosomeType, FitnessType>, agentB: Agent<ChromosomeType, FitnessType>, splitFunction: SplitFunction<ChromosomeType, ChromosomeType>, mixFunction: MixFunction<ChromosomeType, ChromosomeType>, mutationFunction: MutationFunction<ChromosomeType>, agentGenerator: AgentGenerator<ChromosomeType, FitnessType>): Agent<ChromosomeType, FitnessType>
  • Generates a child agent from two agents.

    Returns

    The child agent.

    Type Parameters

    Parameters

    • agentA: Agent<ChromosomeType, FitnessType>

      The first agent.

    • agentB: Agent<ChromosomeType, FitnessType>

      The second agent.

    • splitFunction: SplitFunction<ChromosomeType, ChromosomeType>

      The function used to split the genomes.

    • mixFunction: MixFunction<ChromosomeType, ChromosomeType>

      The function used to mix the genomes.

    • mutationFunction: MutationFunction<ChromosomeType>

      The function used to mutate the genomes.

    • agentGenerator: AgentGenerator<ChromosomeType, FitnessType>

      The agent generator used to generate the child agent.

    Returns Agent<ChromosomeType, FitnessType>

Generated using TypeDoc