Small modif in moIndexedSwapNeighbor

This commit is contained in:
verel 2014-06-25 17:02:38 +02:00
commit edefae4b28
17 changed files with 141 additions and 54 deletions

View file

@ -109,9 +109,9 @@ public:
* @param _solution solution from which the neighborhood is visited
* @param _key index of the IndexNeighbor
*/
virtual void index(EOT & _solution, unsigned int _key) {
key = _key;
}
virtual void index(EOT & _solution, unsigned int _key) {
key = _key;
}
/**
* @param _neighbor a neighbor
@ -121,6 +121,22 @@ public:
return (key == _neighbor.index());
}
/**
* Write object with its index
* @param _os A std::ostream.
*/
virtual void printOn(std::ostream& _os) const {
if (this->invalid()) {
_os << "INVALID ";
}
else
{
_os << this->fitness() << ' ';
}
_os << key ;
}
protected:
// key allowing to describe the neighbor
unsigned int key;

View file

@ -130,7 +130,7 @@ public:
return "moRndWithoutReplNeighborhood";
}
private:
protected:
unsigned int maxIndex;
std::vector<unsigned int> indexVector;
};