abstract class Talgene::Generation(T)

Overview

A convenience abstract class to avoid some boilerplate over the implementation of a #advance method.

Included Modules

Defined in:

models/generation.cr

Constructors

Instance Method Summary

Instance methods inherited from module Talgene::Advanceable(Talgene::Generation(T))

advance(count : Int)
advance : T(T)
advance

Constructor Detail

def self.new(population : Array(T)) #

Creates a new Talgene::Generation instance with supplied array of individuals.


[View source]

Instance Method Detail

def best_fitness #

Convenience method to fetch the best fitness yielded from the population. Same as fittest.fitness


[View source]
def fittest : T #

Returns the population individual that scored the best fitness. Once this is computed, the value is cached for future calls.

Expects T implements #fitness. See Talgene::Fittable.


[View source]
def population : Array(T) #

Returns the population of this generation.


[View source]