Added new files to the brew, mainly distance and new-op-interface related

This commit is contained in:
jmerelo 2000-02-07 17:16:16 +00:00
commit 7db1492943
40 changed files with 2490 additions and 992 deletions

View file

@ -1,23 +1,20 @@
#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) );
}
#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 real_value(const eoESFullChrom<float>& _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;
}