Small modif in moIndexedSwapNeighbor
This commit is contained in:
parent
d3d88d4cc5
commit
edefae4b28
17 changed files with 141 additions and 54 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ public:
|
|||
return "moRndWithoutReplNeighborhood";
|
||||
}
|
||||
|
||||
private:
|
||||
protected:
|
||||
unsigned int maxIndex;
|
||||
std::vector<unsigned int> indexVector;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue