forager.phaseEnded(localSearchSolverPhaseScope);
}
private LocalSearchSolverPhaseScope createLocalSearchSolverPhaseScope() {
DefaultSolverScope solverScope = new DefaultSolverScope();
LocalSearchSolverPhaseScope localSearchSolverPhaseScope = new LocalSearchSolverPhaseScope(solverScope);
DroolsScoreDirectorFactory scoreDirectorFactory = new DroolsScoreDirectorFactory();
scoreDirectorFactory.setScoreDefinition(new SimpleScoreDefinition());
solverScope.setScoreDirector(scoreDirectorFactory.buildScoreDirector());
solverScope.setWorkingRandom(new Random() {
public double nextDouble() {
return 0.2;
}
});
solverScope.setBestScore(DefaultSimpleScore.valueOf(-10));
LocalSearchStepScope lastLocalSearchStepScope = new LocalSearchStepScope(localSearchSolverPhaseScope);
lastLocalSearchStepScope.setScore(DefaultSimpleScore.valueOf(-100));
localSearchSolverPhaseScope.setLastCompletedLocalSearchStepScope(lastLocalSearchStepScope);
return localSearchSolverPhaseScope;
}