Method: EvoSynth::Mutations::GaussMutation#mutate
- Defined in:
- lib/evosynth/operators/mutations/gauss_mutation.rb
#mutate(individual) ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/evosynth/operators/mutations/gauss_mutation.rb', line 45 def mutate(individual) mutated = individual.deep_clone mutated.genome.map! do |gene| gene += EvoSynth.nrand(0.0, @sigma) gene = @lower_bound if gene < @lower_bound gene = @upper_bound if gene > @upper_bound gene end mutated end |