Class: Darwinning::EvolutionTypes::Mutation

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Mutation

Returns a new instance of Mutation.


7
8
9
# File 'lib/darwinning/evolution_types/mutation.rb', line 7

def initialize(options = {})
  @mutation_rate = options.fetch(:mutation_rate, 0.0)
end

Instance Attribute Details

#mutation_rateObject (readonly)

Returns the value of attribute mutation_rate


5
6
7
# File 'lib/darwinning/evolution_types/mutation.rb', line 5

def mutation_rate
  @mutation_rate
end

Instance Method Details

#evolve(members) ⇒ Object


11
12
13
# File 'lib/darwinning/evolution_types/mutation.rb', line 11

def evolve(members)
  mutate(members)
end

#pairwise?Boolean

Returns:

  • (Boolean)

15
16
17
# File 'lib/darwinning/evolution_types/mutation.rb', line 15

def pairwise?
  false
end