* Hopefully one of the swapped numbers will be nearer to its optimal
* position in the sorting and decrease the cost of the whole new sorting.
*/
@Override
protected Sorting createRandomNeighbor() {
Sorting neighbor = new Sorting(currentSolution);
int randomIndex1 = randomizer.nextInt(currentSolution.getAmountOfNumbers());
int randomIndex2 = randomizer.nextInt(currentSolution.getAmountOfNumbers() - 1);
if (randomIndex1 <= randomIndex2) {
randomIndex2++;
}
neighbor.swapIndices(randomIndex1, randomIndex2);
return neighbor;
}