assertSame(b, pickedScope);
forager.phaseEnded(phaseScope);
}
private LocalSearchPhaseScope createPhaseScope() {
DefaultSolverScope solverScope = new DefaultSolverScope();
LocalSearchPhaseScope phaseScope = new LocalSearchPhaseScope(solverScope);
InnerScoreDirector scoreDirector = mock(InnerScoreDirector.class);
when(scoreDirector.getSolutionDescriptor()).thenReturn(TestdataSolution.buildSolutionDescriptor());
when(scoreDirector.getScoreDefinition()).thenReturn(new SimpleScoreDefinition());
solverScope.setScoreDirector(scoreDirector);
Random workingRandom = mock(Random.class);
when(workingRandom.nextInt(2)).thenReturn(0);
solverScope.setWorkingRandom(workingRandom);
solverScope.setBestScore(SimpleScore.valueOf(-10));
LocalSearchStepScope lastLocalSearchStepScope = new LocalSearchStepScope(phaseScope);
lastLocalSearchStepScope.setScore(SimpleScore.valueOf(-100));
phaseScope.setLastCompletedStepScope(lastLocalSearchStepScope);
return phaseScope;
}