Method: EvoSynth::Problems::FloatBenchmarkFuntions.rastgrin
- Defined in:
- lib/evosynth/problems/float_benchmark_functions.rb
.rastgrin(xs) ⇒ Object
Rastgrin (Törn & Zilinskas 1989)
global minimum: f(x) = 0 at x(i) = 0, i = 1..n
63 64 65 |
# File 'lib/evosynth/problems/float_benchmark_functions.rb', line 63 def FloatBenchmarkFuntions.rastgrin(xs) 10 * xs.size + xs.inject(0.0) { |sum, x| sum += x**2 - 10 * Math.cos(2 * Math::PI * x) } end |