deciderScoreComparatorFactory.setSuccessiveNoHardChangeRepetitionMultiplicand(5.0);
deciderScoreComparatorFactory.setHardWeightSurvivalRatio(0.9);
LocalSearchSolverPhaseScope localSearchSolverPhaseScope = createLocalSearchSolverPhaseScope();
deciderScoreComparatorFactory.phaseStarted(localSearchSolverPhaseScope);
LocalSearchStepScope localSearchStepScope = localSearchSolverPhaseScope.getLastCompletedLocalSearchStepScope();
// Under hardScoreActivationThreshold 1
localSearchStepScope = nextStepScope(localSearchStepScope);
deciderScoreComparatorFactory.beforeDeciding(localSearchStepScope);
assertTrue(deciderScoreComparatorFactory.createDeciderScoreComparator() instanceof NaturalScoreComparator);
deciderScoreComparatorFactory.stepDecided(localSearchStepScope);
localSearchStepScope.setScore(DefaultHardAndSoftScore.valueOf(-11, -200));
deciderScoreComparatorFactory.stepTaken(localSearchStepScope);
// Under hardScoreActivationThreshold 2
localSearchStepScope = nextStepScope(localSearchStepScope);
deciderScoreComparatorFactory.beforeDeciding(localSearchStepScope);
assertTrue(deciderScoreComparatorFactory.createDeciderScoreComparator() instanceof NaturalScoreComparator);
deciderScoreComparatorFactory.stepDecided(localSearchStepScope);
localSearchStepScope.setScore(DefaultHardAndSoftScore.valueOf(-10, -200));
localSearchSolverPhaseScope.setBestSolutionStepIndex(localSearchStepScope.getStepIndex());
deciderScoreComparatorFactory.stepTaken(localSearchStepScope);
// Above hardScoreActivationThreshold 0
localSearchStepScope = nextStepScope(localSearchStepScope);
deciderScoreComparatorFactory.beforeDeciding(localSearchStepScope);
assertTrue(deciderScoreComparatorFactory.createDeciderScoreComparator() instanceof NaturalScoreComparator);
deciderScoreComparatorFactory.stepDecided(localSearchStepScope);
localSearchStepScope.setScore(DefaultHardAndSoftScore.valueOf(-10, -200));
deciderScoreComparatorFactory.stepTaken(localSearchStepScope);
// Above hardScoreActivationThreshold 1
localSearchStepScope = nextStepScope(localSearchStepScope);
deciderScoreComparatorFactory.beforeDeciding(localSearchStepScope);
assertEquals(1000, ((FlatteningHardAndSoftScoreComparator)
deciderScoreComparatorFactory.createDeciderScoreComparator()).getHardWeight());
deciderScoreComparatorFactory.stepDecided(localSearchStepScope);
localSearchStepScope.setScore(DefaultHardAndSoftScore.valueOf(-10, -200));
deciderScoreComparatorFactory.stepTaken(localSearchStepScope);
// Above hardScoreActivationThreshold 2
localSearchStepScope = nextStepScope(localSearchStepScope);
deciderScoreComparatorFactory.beforeDeciding(localSearchStepScope);
assertEquals(900, ((FlatteningHardAndSoftScoreComparator)
deciderScoreComparatorFactory.createDeciderScoreComparator()).getHardWeight());
deciderScoreComparatorFactory.stepDecided(localSearchStepScope);
localSearchStepScope.setScore(DefaultHardAndSoftScore.valueOf(-10, -200));
deciderScoreComparatorFactory.stepTaken(localSearchStepScope);
// Above hardScoreActivationThreshold 3
localSearchStepScope = nextStepScope(localSearchStepScope);
deciderScoreComparatorFactory.beforeDeciding(localSearchStepScope);
assertEquals(810, ((FlatteningHardAndSoftScoreComparator)
deciderScoreComparatorFactory.createDeciderScoreComparator()).getHardWeight());
deciderScoreComparatorFactory.stepDecided(localSearchStepScope);
localSearchStepScope.setScore(DefaultHardAndSoftScore.valueOf(-10, -200));
deciderScoreComparatorFactory.stepTaken(localSearchStepScope);
// Above hardScoreActivationThreshold 4
localSearchStepScope = nextStepScope(localSearchStepScope);
deciderScoreComparatorFactory.beforeDeciding(localSearchStepScope);
assertTrue(deciderScoreComparatorFactory.createDeciderScoreComparator() instanceof NaturalScoreComparator);
deciderScoreComparatorFactory.stepDecided(localSearchStepScope);
localSearchStepScope.setScore(DefaultHardAndSoftScore.valueOf(-10, -200));
deciderScoreComparatorFactory.stepTaken(localSearchStepScope);
// Above hardScoreActivationThreshold 5
localSearchStepScope = nextStepScope(localSearchStepScope);
deciderScoreComparatorFactory.beforeDeciding(localSearchStepScope);
assertEquals(1000, ((FlatteningHardAndSoftScoreComparator)
deciderScoreComparatorFactory.createDeciderScoreComparator()).getHardWeight());
deciderScoreComparatorFactory.stepDecided(localSearchStepScope);
localSearchStepScope.setScore(DefaultHardAndSoftScore.valueOf(-10, -200));
deciderScoreComparatorFactory.stepTaken(localSearchStepScope);
}