Parallel initialization for PSO

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@763 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
canape 2007-11-06 15:16:45 +00:00
commit 5eb6eb9a09
4 changed files with 139 additions and 7 deletions

View file

@ -63,6 +63,7 @@ public:
//! @param eoVelocity< POT >& __velocity - velocity operator;
//! @param eoFlight< POT >& __flight - flight operator;
peoPSO(
eoInitializerBase <POT> & _Init,
eoContinue< POT >& __cont,
peoPopEval< POT >& __pop_eval,
eoVelocity < POT > &_velocity,
@ -77,6 +78,7 @@ public:
private:
eoInitializerBase <POT> & Init;
eoContinue< POT >& cont;
peoPopEval< POT >& pop_eval;
eoPop< POT >* pop;
@ -86,12 +88,12 @@ private:
template < class POT > peoPSO< POT > :: peoPSO(
eoInitializerBase <POT> & _Init,
eoContinue< POT >& __cont,
peoPopEval< POT >& __pop_eval,
eoVelocity < POT > &__velocity,
eoFlight < POT > &__flight
) : cont( __cont ), pop_eval(__pop_eval ),velocity( __velocity),flight( __flight)
) : Init(_Init),cont( __cont ), pop_eval(__pop_eval ),velocity( __velocity),flight( __flight)
{
pop_eval.setOwner( *this );
}
@ -106,8 +108,10 @@ template< class POT > void peoPSO< POT > :: operator ()( eoPop< POT >& __pop ) {
template< class POT > void peoPSO< POT > :: run() {
printDebugMessage( "Performing the first evaluation of the population." );
Init();
velocity.getTopology().setup(*pop);
do {
printDebugMessage( "Performing the velocity evaluation." );
printDebugMessage( "Performing the velocity evaluation." );
velocity.apply ( *pop );
printDebugMessage( "Performing the flight." );
flight.apply ( *pop );