class

Chromosome(T)

Inherits Reference < Object

Each chromosome represents a solution for the algorithm. You should subclass this.

Constructors

new(dna : T)
Source

Class methods

random

Create a random new chromosome. Should be overridden.

Source

Instance methods

breed(other_chromosome : Chromosome(T))
Source
crossover_strategy
Source
fitness

Fitness function. Must be overridden.

Source
fitness_calculation
Source
inspect_dna

Represent dna as string, mostly for development, testing and visualization.

Source
mutate!

Override

Source
solution?

This should return whether or not the chromosome represents a complete solution. Override if criterea for good enough solution can be determined.

Source