Documentation and tests added

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1697 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
jhumeau 2010-03-17 16:51:45 +00:00
commit 92251dc96f
20 changed files with 626 additions and 247 deletions

View file

@ -39,12 +39,10 @@
#include <continuator/moNeighborhoodStat.h>
/**
*
* From moNeighborhoodStat, to compute the neutral degree of the solution
* which is the number of solutions in the neighborhood
* with equals fitness
*
*/
*/
template< class Neighborhood >
class moNeutralDegreeNeighborStat : public moStat<typename Neighborhood::EOT, unsigned>
{
@ -54,19 +52,29 @@ public :
using moStat< EOT, unsigned >::value;
moNeutralDegreeNeighborStat(moNeigborhoodStat<Neighborhood> & _nhStat)
: moStat<EOT, unsigned>(0, "neutral degree"), nhStat(_nhStat)
{}
/**
* Default Constructor
* @param _nhStat a neighborhoodStat
*/
moNeutralDegreeNeighborStat(moNeighborhoodStat<Neighborhood> & _nhStat):
moStat<EOT, unsigned>(0, "neutral degree"), nhStat(_nhStat){}
virtual void operator()(EOT & _sol)
{
/**
* Set the neutral degree of the solution which is the number of solutions in the neighborhood with equals fitness
* @param _sol the corresponding solution
*/
virtual void operator()(EOT & _sol){
value() = nhStat.getNbEqual();
}
/**
* @return the class name
*/
virtual std::string className(void) const { return "moNeutralDegreeNeighborStat"; }
private:
moNeigborhoodStat<Neighborhood> & nhStat;
/** moNeighborhoodStat */
moNeighborhoodStat<Neighborhood> & nhStat;
};
#endif