Nettoyage et documentation des classes de bases
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1653 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
61fb1b845d
commit
31c6fe9888
9 changed files with 224 additions and 177 deletions
|
|
@ -1,34 +1,43 @@
|
|||
#ifndef _moNeighborComparator_h
|
||||
#define _moNeighborComparator_h
|
||||
#ifndef _moComparator_h
|
||||
#define _moComparator_h
|
||||
|
||||
#include <neighborhood/moNeighbor.h>
|
||||
#include <EO.h>
|
||||
#include <eoFunctor.h>
|
||||
|
||||
template< class Neigh >
|
||||
class moNeighborComparator : public eoBF<const Neigh & , const Neigh & , bool>
|
||||
// moComparator => comparer deux solutions
|
||||
// idée :
|
||||
// - eoComparator
|
||||
// - moComparator qui hérite de eoComparator ?
|
||||
// - moeoComparator qui hérite de eoComparator
|
||||
// idée J :
|
||||
// - eoComparator<TYPE> : eoBF <const TYPE & , const TYPE & , bool>
|
||||
// - eoSolComparator : eoComparator<EOT> ?
|
||||
// - moNeighborCompartor : : eoComparator<Neighbor>
|
||||
//
|
||||
// une instantiation possible !!
|
||||
template< class EOT >
|
||||
class moComparator : public eoBF<const EOT & , const EOT & , bool>
|
||||
{
|
||||
public:
|
||||
|
||||
/*
|
||||
* true if the neighbor1 is better than neighbor2
|
||||
*/
|
||||
virtual bool operator()(const Neigh & neighbor1, const Neigh & neighbor2) {
|
||||
return (neighbor1.fitness() > neighbor2.fitness());
|
||||
* Compare two solutions
|
||||
* @param _sol1 the first solution
|
||||
* @param _sol2 the second solution
|
||||
* @return true if the _sol1 is better than _sol2
|
||||
*/
|
||||
virtual bool operator()(const EOT& _sol1, const EOT& _sol2) {
|
||||
return (_sol1.fitness() > _sol2.fitness());
|
||||
}
|
||||
|
||||
/** Return the class id.
|
||||
* @return the class name as a std::string
|
||||
*/
|
||||
virtual std::string className() const { return "moNeighborComparator"; }
|
||||
/*
|
||||
* Return the class id.
|
||||
* @return the class name as a std::string
|
||||
*/
|
||||
virtual std::string className() const {
|
||||
return "moComparator";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#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