fixed test
This commit is contained in:
parent
8c4e91584f
commit
93b4e2568c
1 changed files with 14 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue