diff --git a/eo/src/eoParticleBestInit.h b/eo/src/eoParticleBestInit.h index 79d78ed3f..b847f7162 100644 --- a/eo/src/eoParticleBestInit.h +++ b/eo/src/eoParticleBestInit.h @@ -63,8 +63,9 @@ public: void operator () (POT & _po1) { - for (unsigned i = 0; i < _po1.size (); i++) - _po1.bestPositions[i] = _po1[i]; + //Set the bestPositions + _po1.bestPositions = _po1 ; + // set the fitness _po1.best(_po1.fitness()); @@ -74,4 +75,3 @@ public: #endif /*_EOPARTICLEBESTINIT_H */ -