@ Override protected void searchStep ( ) { // execute pipeline pipeline . stream ( ) . forEachOrdered ( l -> { // attach listener l . addSearchListener ( pipelineListener ) ; // set initial solution (copy!) l . setCurrentSolution ( Solution . checkedCopy ( getCurrentSolution ( ) ) ) ; // run local search l . start ( ) ; // get best solution found by search l SolutionType bestSol = l . getBestSolution ( ) ; Evaluation bestSolEvaluation = l . getBestSolutionEvaluation ( ) ; Validation bestSolValidation = l . getBestSolutionValidation ( ) ; // if not null and different from current solution (i.e. improved): // update current and best solution accordingly if ( bestSol != null && ! bestSol . equals ( getCurrentSolution ( ) ) ) { updateCurrentAndBestSolution ( bestSol , bestSolEvaluation , bestSolValidation ) ; } // remove listener l . removeSearchListener ( pipelineListener ) ; } ) ; // pipeline complete: stop search stop ( ) ; }
Executes all local searches in the pipeline where the best solution of the previous search is used as initial solution for the next search . When the entire pipeline has been executed the search step is complete and the search terminates .