Added Marc's ES files and .dsp files for others
This commit is contained in:
parent
0d8648c0e6
commit
449ed17ff8
71 changed files with 6359 additions and 4825 deletions
23
eo/test/real_value.h
Normal file
23
eo/test/real_value.h
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#include <eoESFullChrom.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!)
|
||||
@param _ind A floatingpoint vector
|
||||
*/
|
||||
float the_real_value(Vec& _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;
|
||||
}
|
||||
|
||||
typedef eoESFullChrom<float> Ind;
|
||||
|
||||
void real_value(Ind & _ind) {
|
||||
_ind.fitness( the_real_value(_ind) );
|
||||
}
|
||||
Reference in a new issue