Class: EvoSynth::Selections::Identity

Inherits:
Object
  • Object
show all
Defined in:
lib/evosynth/operators/selections/identity.rb

Overview

Selects select_count (from beginning of population)

Instance Method Summary collapse

Instance Method Details

#select(population, select_count = 1) ⇒ Object



33
34
35
36
37
38
# File 'lib/evosynth/operators/selections/identity.rb', line 33

def select(population, select_count = 1)
  selected_population = EvoSynth::Population.new
  selected_population << population.first(select_count)
  selected_population.flatten!
  selected_population
end

#to_sObject



40
41
42
# File 'lib/evosynth/operators/selections/identity.rb', line 40

def to_s
  "identity selection"
end