fixed test

This commit is contained in:
LPTK 2013-06-13 15:05:17 +02:00
commit 93b4e2568c

View file

@ -13,11 +13,25 @@
typedef eoReal< eoMinimizingFitness > EOT;
typedef moRealNeighbor< EOT > Neighbor;
double objective_function(const EOT & sol)
{
double sum = 0;
for ( size_t i = 0; i < sol.size(); ++i )
{
sum += sol[i] * sol[i];
}
return sum;
}
int main(int ac, char** av)
{
//moNeighborhoodStat<Neighbor> nhStat
moFitnessVarianceStat<EOT> stat;
eoEvalFuncPtr< EOT, double > eval( objective_function );
EOT solution(2, 5);
eval(solution);
stat(solution);
//assert(stat.value() == 1);
std::cout << "ok " << stat.value() << std::endl;