From 37c3989ee902f0cb78261d8b36a1c9f49fe18804 Mon Sep 17 00:00:00 2001 From: paradiseo Date: Thu, 22 Jan 2009 10:18:10 +0000 Subject: [PATCH] test on PSO changed. --- eo/test/t-eoExtendedVelocity.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/eo/test/t-eoExtendedVelocity.cpp b/eo/test/t-eoExtendedVelocity.cpp index d40d2881..c42fb4c6 100644 --- a/eo/test/t-eoExtendedVelocity.cpp +++ b/eo/test/t-eoExtendedVelocity.cpp @@ -19,10 +19,10 @@ double f (const Particle & _particle) int main_function(int argc, char **argv) { const unsigned POP_SIZE = 6, VEC_SIZE = 2, NEIGHBORHOOD_SIZE=2; - + // the population: eoPop pop; - + // Evaluation eoEvalFuncPtr eval( f ); @@ -33,33 +33,33 @@ int main_function(int argc, char **argv) eoVelocityInitFixedLength < Particle > veloRandom (VEC_SIZE, sGen); eoFirstIsBestInit < Particle > localInit; pop.append (POP_SIZE, random); - + // topology eoLinearTopology topology(NEIGHBORHOOD_SIZE); eoInitializer init(eval,veloRandom,localInit,topology,pop); - init(); + init(); // velocity eoExtendedVelocity velocity (topology,1,1,1,1); - + // the test itself for (unsigned int i = 0; i < POP_SIZE; i++) { std::cout << " Initial particle n°" << i << " velocity: " << std::endl; for (unsigned int j = 0; j < VEC_SIZE; j++) - std::cout << " v" << j << "=" << pop[i].velocities[j] << std::endl; + std::cout << " v" << j << "=" << pop[i].velocities[j] << std::endl; } - + for (unsigned int i = 0; i < POP_SIZE; i++) velocity (pop[i],i); - + for (unsigned int i = 0; i < POP_SIZE; i++) { std::cout << " Final particle n°" << i << " velocity: " << std::endl; for (unsigned int j = 0; j < VEC_SIZE; j++) - std::cout << " v" << j << "=" << pop[i].velocities[j] << std::endl; + std::cout << " v" << j << "=" << pop[i].velocities[j] << std::endl; } - + return EXIT_SUCCESS; } int main(int argc, char **argv) @@ -72,5 +72,5 @@ int main(int argc, char **argv) { std::cout << "Exception: " << e.what() << " in t-eoExtendedVelocity" << std::endl; } - + return EXIT_SUCCESS; }