deciderScoreComparatorFactory.setSuccessiveNoHardChangeRepetitionMultiplicand(5.0);
deciderScoreComparatorFactory.setHardWeightSurvivalRatio(0.9);
LocalSearchSolverScope localSearchSolverScope = createLocalSearchSolverScope();
deciderScoreComparatorFactory.solvingStarted(localSearchSolverScope);
LocalSearchStepScope localSearchStepScope = localSearchSolverScope.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));
localSearchSolverScope.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, ((HardPenaltyDeciderScoreComparator)
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, ((HardPenaltyDeciderScoreComparator)
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, ((HardPenaltyDeciderScoreComparator)
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, ((HardPenaltyDeciderScoreComparator)
deciderScoreComparatorFactory.createDeciderScoreComparator()).getHardWeight());
deciderScoreComparatorFactory.stepDecided(localSearchStepScope);
localSearchStepScope.setScore(DefaultHardAndSoftScore.valueOf(-10, -200));
deciderScoreComparatorFactory.stepTaken(localSearchStepScope);
}