@ Override protected void searchStep ( ) { // get random move Move < ? super SolutionType > move = getNeighbourhood ( ) . getRandomMove ( getCurrentSolution ( ) , getRandom ( ) ) ; // got move ? if ( move != null ) { // accept if improvement if ( isImprovement ( move ) ) { // accept move accept ( move ) ; } else { // no improvement reject ( move ) ; } } else { // no move/neighbour reported by neighbourhood stop ( ) ; } }
Creates a random neighbour of the current solution and accepts it if it improves over the current solution .