update comment
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@2276 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
55627d0377
commit
841e0fc9b6
1 changed files with 105 additions and 94 deletions
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||||
Contact: paradiseo-help@lists.gforge.inria.fr
|
Contact: paradiseo-help@lists.gforge.inria.fr
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _IndexNeighbor_h
|
#ifndef _IndexNeighbor_h
|
||||||
#define _IndexNeighbor_h
|
#define _IndexNeighbor_h
|
||||||
|
|
@ -40,9 +40,8 @@
|
||||||
/**
|
/**
|
||||||
* Index Neighbor
|
* Index Neighbor
|
||||||
*/
|
*/
|
||||||
template< class EOT, class Fitness=typename EOT::Fitness >
|
template<class EOT, class Fitness = typename EOT::Fitness>
|
||||||
class moIndexNeighbor : virtual public moNeighbor<EOT, Fitness>
|
class moIndexNeighbor: virtual public moNeighbor<EOT, Fitness> {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
using moNeighbor<EOT, Fitness>::fitness;
|
using moNeighbor<EOT, Fitness>::fitness;
|
||||||
|
|
@ -50,14 +49,17 @@ public:
|
||||||
/**
|
/**
|
||||||
* Default Constructor
|
* Default Constructor
|
||||||
*/
|
*/
|
||||||
moIndexNeighbor() : moNeighbor<EOT, Fitness>(), key(0) {}
|
moIndexNeighbor() :
|
||||||
|
moNeighbor<EOT, Fitness> (), key(0) {
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copy Constructor
|
* Copy Constructor
|
||||||
* @param _n the neighbor to copy
|
* @param _n the neighbor to copy
|
||||||
*/
|
*/
|
||||||
moIndexNeighbor(const moIndexNeighbor& _n) : moNeighbor<EOT, Fitness>(_n) {
|
moIndexNeighbor(const moIndexNeighbor& _n) :
|
||||||
this->key = _n.key ;
|
moNeighbor<EOT, Fitness> (_n) {
|
||||||
|
this->key = _n.key;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -65,10 +67,19 @@ public:
|
||||||
* @param _source the source neighbor
|
* @param _source the source neighbor
|
||||||
*/
|
*/
|
||||||
|
|
||||||
moIndexNeighbor<EOT, Fitness> & operator=(const moIndexNeighbor<EOT, Fitness> & _source) {
|
moIndexNeighbor<EOT, Fitness> & operator=(const moIndexNeighbor<EOT,
|
||||||
|
Fitness> & _source) {
|
||||||
moNeighbor<EOT, Fitness>::operator=(_source);
|
moNeighbor<EOT, Fitness>::operator=(_source);
|
||||||
this->key = _source.key ;
|
this->key = _source.key;
|
||||||
return *this ;
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Move a solution
|
||||||
|
* @param _solution the related solution
|
||||||
|
*/
|
||||||
|
virtual void move(EOT & _solution) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -92,7 +103,7 @@ public:
|
||||||
* @param _key index of the IndexNeighbor
|
* @param _key index of the IndexNeighbor
|
||||||
*/
|
*/
|
||||||
void index(unsigned int _key) {
|
void index(unsigned int _key) {
|
||||||
key=_key;
|
key = _key;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -100,7 +111,7 @@ public:
|
||||||
* @return if _neighbor and this one are equals
|
* @return if _neighbor and this one are equals
|
||||||
*/
|
*/
|
||||||
virtual bool equals(moIndexNeighbor<EOT>& _neighbor) {
|
virtual bool equals(moIndexNeighbor<EOT>& _neighbor) {
|
||||||
return (key==_neighbor.index());
|
return (key == _neighbor.index());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue