From b1175c10ab433c1dd1d1bdb2cac8870dc69ed642 Mon Sep 17 00:00:00 2001 From: canape Date: Tue, 26 Feb 2008 08:53:48 +0000 Subject: [PATCH] peoPopEval.h modified git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1005 331e1502-861f-0410-8da2-ba01fb791d7f --- trunk/paradiseo-peo/src/peoPopEval.h | 31 +++++++++++++++------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/trunk/paradiseo-peo/src/peoPopEval.h b/trunk/paradiseo-peo/src/peoPopEval.h index f6440a885..a8a5ce467 100644 --- a/trunk/paradiseo-peo/src/peoPopEval.h +++ b/trunk/paradiseo-peo/src/peoPopEval.h @@ -153,20 +153,23 @@ template< class EOT > void peoPopEval< EOT >::operator()(eoPop< EOT >& __dummy, template< class EOT > void peoPopEval< EOT >::operator()(eoPop< EOT >& __pop ) { - for ( unsigned i = 0; i < __pop.size(); i++ ) - { - __pop[ i ].fitness(typename EOT :: Fitness() ); - progression[ &__pop[ i ] ].first = funcs.size() - 1; - progression[ &__pop[ i ] ].second = funcs.size(); - for ( unsigned j = 0; j < funcs.size(); j++ ) - { - /* Queuing the 'invalid' solution and its associated owner */ - tasks.push( &__pop[ i ] ); - } - } - total = funcs.size() * __pop.size(); - requestResourceRequest( funcs.size() * __pop.size() ); - stop(); + if ( __pop.size() && (funcs.size() * __pop.size()) ) + { + for ( unsigned i = 0; i < __pop.size(); i++ ) + { + __pop[ i ].fitness(typename EOT :: Fitness() ); + progression[ &__pop[ i ] ].first = funcs.size() - 1; + progression[ &__pop[ i ] ].second = funcs.size(); + for ( unsigned j = 0; j < funcs.size(); j++ ) + { + /* Queuing the 'invalid' solution and its associated owner */ + tasks.push( &__pop[ i ] ); + } + } + total = funcs.size() * __pop.size(); + requestResourceRequest( funcs.size() * __pop.size() ); + stop(); + } }