git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@2185 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
boufaras 2011-03-11 16:01:59 +00:00
commit 3265913219

View file

@ -109,16 +109,14 @@ public:
virtual void init(EOT& _solution, Neighbor& _current) { virtual void init(EOT& _solution, Neighbor& _current) {
//Compute the mapping only for the first init //Compute the mapping only for the first init
if (mutex) { if (mutex==true) {
setMapping(); setMapping();
mutex = false; mutex = false;
} }
moOrderNeighborhood<Neighbor>::init(_solution, _current); moOrderNeighborhood<Neighbor>::init(_solution, _current);
_current.setKswap(Kswap); _current.setKswap(Kswap);
_current.reSizeIndices(Kswap); _current.reSizeIndices(Kswap);
_current.setSize(_solution.size()); _current.setSize(_solution.size());
getMapping(currentIndex); getMapping(currentIndex);
_current.setIndices(indices); _current.setIndices(indices);
} }
@ -129,11 +127,9 @@ public:
* @param _current the next neighbor * @param _current the next neighbor
*/ */
virtual void next(EOT& _solution, Neighbor& _current) { virtual void next(EOT& _solution, Neighbor& _current) {
moOrderNeighborhood<Neighbor>::next(_solution, _current); moOrderNeighborhood<Neighbor>::next(_solution, _current);
getMapping(currentIndex); getMapping(currentIndex);
_current.setIndices(indices); _current.setIndices(indices);
} }
/** /**
@ -142,9 +138,10 @@ public:
*/ */
virtual void getMapping(unsigned int _currentIndex) { virtual void getMapping(unsigned int _currentIndex) {
for (unsigned int i = 0; i <= Kswap; i++) for (unsigned int i = 0; i <= Kswap; i++){
indices[i] = mapping[_currentIndex + i * neighborhoodSize]; indices[i] = mapping[_currentIndex + i * neighborhoodSize];
} }
}
/** /**
* Set the mapping of K-indexes * Set the mapping of K-indexes