class Evopop::Candidate

Public: Represents a candidate in the population.Evopop::Candidates are abstracted as a simple data structure which contains the DNA and fitness over the fitness function.

Attributes

dna[RW]
fitness[RW]

Public Class Methods

new(dna) click to toggle source

Simple initialization of candidate object.

# File lib/evopop/candidate.rb, line 11
def initialize(dna)
  @dna = dna
end

Public Instance Methods

compose_parent_dna(c0, c1) click to toggle source
# File lib/evopop/candidate.rb, line 15
def compose_parent_dna(c0, c1)
  # Compose the dna of the first child from the first chunk of the
  # first candidate and the second chunk of the second candidate
  # dna0_left = c0.dna.take(ordinal)
  # dna1_right = c1.dna.drop(ordinal)
end