Class: ParentRangeNewGenerationStrategy

Inherits:
NewGenerationStrategy show all
Defined in:
lib/gimuby/genetic/solution/new_generation_strategy/parent_range_new_generation_strategy.rb

Instance Method Summary collapse

Constructor Details

#initialize(widen_range_ratio = 1.10) ⇒ ParentRangeNewGenerationStrategy

Returns a new instance of ParentRangeNewGenerationStrategy.



6
7
8
# File 'lib/gimuby/genetic/solution/new_generation_strategy/parent_range_new_generation_strategy.rb', line 6

def initialize(widen_range_ratio = 1.10)
  @widen_range_ratio = widen_range_ratio
end

Instance Method Details

#reproduce(solution1, solution2) ⇒ Object



10
11
12
13
14
# File 'lib/gimuby/genetic/solution/new_generation_strategy/parent_range_new_generation_strategy.rb', line 10

def reproduce(solution1, solution2)
  x_values1 = solution1.get_solution_representation
  x_values2 = solution2.get_solution_representation
  reproduce_from_representation(x_values1, x_values2)
end