module SurviveMethods
Public Instance Methods
max_fitness(population)
click to toggle source
# File lib/survive_methods.rb, line 7 def max_fitness(population) population.sort! { |a, b| b.fitness <=> a.fitness } @population = population[0..(@population.size-1)] end
min_fitness(population)
click to toggle source
# File lib/survive_methods.rb, line 2 def min_fitness(population) population.sort! { |a, b| a.fitness <=> b.fitness } @population = population[0..(@population.size-1)] end