Début du dev de newMo
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1639 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
25c45dd1fa
commit
e13fd250d1
34 changed files with 1946 additions and 48 deletions
34
branches/newMo/src/comparator/moNeighborComparator.h
Normal file
34
branches/newMo/src/comparator/moNeighborComparator.h
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#ifndef _moNeighborComparator_h
|
||||
#define _moNeighborComparator_h
|
||||
|
||||
#include <neighborhood/moNeighbor.h>
|
||||
|
||||
template< class Neigh >
|
||||
class moNeighborComparator : public eoBF<const Neigh & , const Neigh & , bool>
|
||||
{
|
||||
public:
|
||||
|
||||
/*
|
||||
* true if the neighbor1 is better than neighbor2
|
||||
*/
|
||||
virtual bool operator()(const Neigh & neighbor1, const Neigh & neighbor2) {
|
||||
return (neighbor1.fitness() > neighbor2.fitness());
|
||||
}
|
||||
|
||||
/** Return the class id.
|
||||
* @return the class name as a std::string
|
||||
*/
|
||||
virtual std::string className() const { return "moNeighborComparator"; }
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// coding: iso-8859-1
|
||||
// mode: C++
|
||||
// c-file-offsets: ((c . 0))
|
||||
// c-file-style: "Stroustrup"
|
||||
// fill-column: 80
|
||||
// End:
|
||||
Loading…
Add table
Add a link
Reference in a new issue