Class: Darwinning::EvolutionTypes::Reproduction

Inherits:
Object
  • Object
show all
Defined in:
lib/darwinning/evolution_types/reproduction.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Reproduction

Available crossover_methods:

:alternating_swap
:random_swap

8
9
10
# File 'lib/darwinning/evolution_types/reproduction.rb', line 8

def initialize(options = {})
  @crossover_method = options.fetch(:crossover_method, :alternating_swap)
end

Instance Method Details

#evolve(m1, m2) ⇒ Object


12
13
14
# File 'lib/darwinning/evolution_types/reproduction.rb', line 12

def evolve(m1, m2)
  sexytimes(m1, m2)
end

#pairwise?Boolean

Returns:

  • (Boolean)

16
17
18
# File 'lib/darwinning/evolution_types/reproduction.rb', line 16

def pairwise?
  true
end