diff --git a/mo/src/problems/eval/moQAPIncrEval.h b/mo/src/problems/eval/moQAPIncrEval.h index 3fd529a7f..5c47623d9 100644 --- a/mo/src/problems/eval/moQAPIncrEval.h +++ b/mo/src/problems/eval/moQAPIncrEval.h @@ -61,10 +61,10 @@ public: int d; int k; - unsigned i, j; - - _neighbor.getIndices(n, i, j); + unsigned i = _neighbor.first(); + unsigned j = _neighbor.second(); + // _neighbor.getIndices(n, i, j); d = (A[i][i]-A[j][j])*(B[_solution[j]][_solution[j]]-B[_solution[i]][_solution[i]]) + (A[i][j]-A[j][i])*(B[_solution[j]][_solution[i]]-B[_solution[i]][_solution[j]]); diff --git a/mo/src/problems/permutation/moIndexedSwapNeighbor.h b/mo/src/problems/permutation/moIndexedSwapNeighbor.h index 06491f134..d30305100 100644 --- a/mo/src/problems/permutation/moIndexedSwapNeighbor.h +++ b/mo/src/problems/permutation/moIndexedSwapNeighbor.h @@ -107,6 +107,22 @@ public: index( _first + n * (n - 1) / 2 ); } + /** + * Getter of the firt location + * @return first indice + */ + unsigned int first() { + return indices.first; + } + + /** + * Getter of the second location + * @return second indice + */ + unsigned int second() { + return indices.second; + } + private: std::pair indices;