Addition of the function PSO : Parallel evaluation
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@650 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
2cef623c31
commit
43fbde1096
9 changed files with 161 additions and 23 deletions
34
trunk/paradiseo-peo/src/peoEvalFuncPSO.h
Normal file
34
trunk/paradiseo-peo/src/peoEvalFuncPSO.h
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
// "peoPSO.h"
|
||||
|
||||
// (c) OPAC Team, October 2007
|
||||
|
||||
/*
|
||||
Contact: clive.canape@inria.fr
|
||||
*/
|
||||
|
||||
#ifndef PEOEVALFUNCPSO_H
|
||||
#define PEOEVALFUNCPSO_H
|
||||
|
||||
#include <eoEvalFunc.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
template< class POT, class FitT = POT::Fitness, class FunctionArg = const POT& >
|
||||
#else
|
||||
template< class POT, class FitT = typename POT::Fitness, class FunctionArg = const POT& >
|
||||
#endif
|
||||
struct peoEvalFuncPSO: public eoEvalFunc<POT> {
|
||||
|
||||
peoEvalFuncPSO( FitT (* _eval)( FunctionArg ) )
|
||||
: eoEvalFunc<POT>(), evalFunc( _eval ) {};
|
||||
|
||||
virtual void operator() ( POT & _peo )
|
||||
{
|
||||
_peo.fitness((*evalFunc)( _peo ));
|
||||
};
|
||||
|
||||
private:
|
||||
FitT (* evalFunc )( FunctionArg );
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue