Module: FeldtRuby::Optimize::DE_MutationStrategy_Rand_1

Included in:
DEOptimizer_Rand_1_Bin
Defined in:
lib/feldtruby/optimize/differential_evolution.rb

Overview

The most-used DE/rand/1/* mutation strategy.

Instance Method Summary collapse

Instance Method Details

#mutate(targetIndex, donorParentsIndices) ⇒ Object



150
151
152
153
# File 'lib/feldtruby/optimize/differential_evolution.rb', line 150

def mutate(targetIndex, donorParentsIndices)
	p1, p2, p3 = get_candidates_with_indices(donorParentsIndices)
	p3 + (scale_factor(targetIndex) * (p1 - p2))
end

#num_parents_to_sampleObject

We need three parents for donor vector. And then the target, so 1+3 in total.



148
# File 'lib/feldtruby/optimize/differential_evolution.rb', line 148

def num_parents_to_sample; 4; end