diff --git a/trunk/paradiseo-peo/src/peoEvalFuncPSO.h b/trunk/paradiseo-peo/src/peoEvalFuncPSO.h index d08515bd2..7f94974b8 100644 --- a/trunk/paradiseo-peo/src/peoEvalFuncPSO.h +++ b/trunk/paradiseo-peo/src/peoEvalFuncPSO.h @@ -1,4 +1,4 @@ -// "peoPSO.h" +// "peoEvalFuncPSO.h" // (c) OPAC Team, October 2007 @@ -11,6 +11,11 @@ #include +/** peoEvalFuncPSO: This class + * takes an existing function pointer and converts it into a evaluation + * function class. + */ + #ifdef _MSC_VER template< class POT, class FitT = POT::Fitness, class FunctionArg = const POT& > #else @@ -21,6 +26,7 @@ struct peoEvalFuncPSO: public eoEvalFunc { peoEvalFuncPSO( FitT (* _eval)( FunctionArg ) ) : eoEvalFunc(), evalFunc( _eval ) {}; + //Applies the evaluation function to a PEO virtual void operator() ( POT & _peo ) { _peo.fitness((*evalFunc)( _peo )); diff --git a/trunk/paradiseo-peo/src/peoPSO.h b/trunk/paradiseo-peo/src/peoPSO.h index 73b7b4a9f..83ef1154a 100644 --- a/trunk/paradiseo-peo/src/peoPSO.h +++ b/trunk/paradiseo-peo/src/peoPSO.h @@ -24,16 +24,19 @@ template < class POT > class peoPSO : public Runner { public: + + // Constructor for the Particle Swarm Optimization peoPSO( eoContinue< POT >& __cont, peoPopEval< POT >& __pop_eval, eoVelocity < POT > &_velocity, eoFlight < POT > &_flight); - + // Particle Swarm Optimization function - a side effect of the fact that the class is derived from the Runner class + // thus requiring the existence of a run function, the algorithm being executed on a distinct thread. void run(); - + // Function operator for specifying the population to be associated with the algorithm. void operator()( eoPop< POT >& __pop ); private: