From 43f0d7ea79773efcc95c5f5eff49880bc1f178a7 Mon Sep 17 00:00:00 2001 From: evomarc Date: Wed, 22 May 2002 02:13:06 +0000 Subject: [PATCH] I had forgotten the real_value.h - SecondRealEA did not compile! --- eo/tutorial/Lesson3/real_value.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 eo/tutorial/Lesson3/real_value.h diff --git a/eo/tutorial/Lesson3/real_value.h b/eo/tutorial/Lesson3/real_value.h new file mode 100644 index 000000000..7fe002b63 --- /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; +} + + +