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:
parent
e6d874bc1b
commit
92251dc96f
20 changed files with 626 additions and 247 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue