Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Species

A class holding a species

Hierarchy

  • Species

Index

Constructors

constructor

Properties

Private avgScore

avgScore: number

bestNetwork

bestNetwork: Network

highScore

highScore: number

Readonly Private members

members: Set<Network>

The member networks in this species

Private representative

representative: Network

The representative network of this species

Private score

score: number

The score of this species

stagnation

stagnation: number

Methods

breed

cull

  • cull(percentage?: number, representativeIsBest?: boolean): void
  • Kill a specific percentage of networks

    Parameters

    • Default value percentage: number = 0.5

      the kill rate

    • Default value representativeIsBest: boolean = true

      is representative always the best member?

    Returns void

fitnessSharing

  • fitnessSharing(): void
  • Dividing the fitness value of each individual by the size of the species and save the adjusted fitness.

    Returns void

getAvgAdjustedScore

  • getAvgAdjustedScore(): number

getSumAdjustedScores

  • getSumAdjustedScores(): number

isCompatible

  • isCompatible(network: Network): boolean
  • Returns whether a genome is compatible with the species or not

    Parameters

    • network: Network

      An array of genomes to determine compatibility with (currently assumes two)

    Returns boolean

    Whether a genome is compatible with the species

put

reset

  • reset(): void

size

  • size(): number

sortedMembersArray

sumScores

  • sumScores(): number

toString

  • toString(): string

updateScore

  • updateScore(representativeIsBest?: boolean): void
  • Update the score of this species and updating the best network.

    Parameters

    • Default value representativeIsBest: boolean = true

    Returns void

Generated using TypeDoc