forager.phaseEnded(localSearchSolverPhaseScope);
}
private LocalSearchSolverPhaseScope createLocalSearchSolverPhaseScope() {
DefaultSolverScope solverScope = new DefaultSolverScope();
LocalSearchSolverPhaseScope localSearchSolverPhaseScope = new LocalSearchSolverPhaseScope(solverScope);
DroolsScoreDirectorFactory scoreDirectorFactory = new DroolsScoreDirectorFactory();
scoreDirectorFactory.setSolutionDescriptor(TestdataSolution.buildSolutionDescriptor());
scoreDirectorFactory.setScoreDefinition(new SimpleScoreDefinition());
solverScope.setScoreDirector(scoreDirectorFactory.buildScoreDirector());
Random workingRandom = mock(Random.class);
when(workingRandom.nextInt(2)).thenReturn(0);
solverScope.setWorkingRandom(workingRandom);
solverScope.setBestScore(DefaultSimpleScore.valueOf(-10));
LocalSearchStepScope lastLocalSearchStepScope = new LocalSearchStepScope(localSearchSolverPhaseScope);
lastLocalSearchStepScope.setScore(DefaultSimpleScore.valueOf(-100));
localSearchSolverPhaseScope.setLastCompletedStepScope(lastLocalSearchStepScope);
return localSearchSolverPhaseScope;
}