class PickStrategy
Attributes
pick_proportion[RW]
Public Class Methods
new()
click to toggle source
# File lib/gimuby/genetic/population/pick_strategy/pick_strategy.rb, line 4 def initialize @pick_proportion ||= 25.to_f / 100.to_f end
Public Instance Methods
pick(population)
click to toggle source
pick some solution inside the population
# File lib/gimuby/genetic/population/pick_strategy/pick_strategy.rb, line 11 def pick(population) raise NotImplementedError end
Protected Instance Methods
get_number_to_pick(population)
click to toggle source
# File lib/gimuby/genetic/population/pick_strategy/pick_strategy.rb, line 17 def get_number_to_pick(population) number = population.solutions.length * @pick_proportion number.round end