New ES routines
This commit is contained in:
parent
c6589b5951
commit
4c4ce70c04
17 changed files with 1100 additions and 98 deletions
|
|
@ -1,19 +1,18 @@
|
|||
#include <es/eoESFullChrom.h>
|
||||
|
||||
#include <es/eoEsBase.h>
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
typedef vector<double> Vec;
|
||||
|
||||
/** Just a simple function that takes an eoVector<float> and sets the fitnes
|
||||
to -sphere (we'll see later how to minimize rather than maximize!)
|
||||
/** Just a simple function that takes an eoEsBase<float> and sets the fitnes
|
||||
to sphere
|
||||
@param _ind A floatingpoint vector
|
||||
*/
|
||||
float real_value(const eoESFullChrom<float>& _ind)
|
||||
|
||||
double real_value(const eoEsBase<double>& _ind)
|
||||
{
|
||||
double sum = 0; /* compute in double format, even if return a float */
|
||||
for (unsigned i = 0; i < _ind.size(); i++)
|
||||
sum += _ind[i] * _ind[i];
|
||||
return -sum;
|
||||
return sum;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Reference in a new issue