diff --git a/eo/tutorial/Lesson3/real_value.h b/eo/tutorial/Lesson3/real_value.h new file mode 100644 index 00000000..7fe002b6 --- /dev/null +++ b/eo/tutorial/Lesson3/real_value.h @@ -0,0 +1,20 @@ +#include +//----------------------------------------------------------------------------- +/** Just a simple function that takes an vector and sets the fitnes + to the sphere function. Please use doubles not float!!! + @param _ind A floatingpoint vector +*/ + +// INIT +double real_value(const std::vector& _ind) +{ + double sum = 0; + for (unsigned i = 0; i < _ind.size(); i++) + { + sum += _ind[i] * _ind[i]; + } + return sum; +} + + +