class Chromosome(T)
- Chromosome(T)
- Reference
- Object
Overview
Each chromosome represents a solution for the algorithm. You should subclass this.
Defined in:
chromosome.crConstructors
Class Method Summary
-
.random
Create a random new chromosome.
Instance Method Summary
- #breed(other_chromosome : Chromosome(T))
- #crossover_strategy
- #dna
-
#fitness : Int32
Fitness function.
- #fitness_calculation
-
#inspect_dna : String
Represent dna as string, mostly for development, testing and visualization.
-
#mutate! : Nil
Override
-
#solution? : Bool
This should return whether or not the chromosome represents a complete solution.
Constructor Detail
Class Method Detail
Instance Method Detail
def inspect_dna : String
#
Represent dna as string, mostly for development, testing and visualization.
def solution? : Bool
#
This should return whether or not the chromosome represents a complete solution. Override if criterea for good enough solution can be determined.