@Test public void scoreTest() { ClusterState clusterState = getTestClusterState(); assertEquals(-4, scoreCalculatorRandom.calculateScore(clusterState).getHardScore(0)); assertEquals(1, scoreCalculatorRandom.calculateScore(clusterState).getSoftScore(0)); assertTrue(scoreCalculatorRandom.calculateScore(clusterState).getSoftScore(1) >= 0); }
@Override public BendableScore calculateScore(ClusterState solution) { int[] hardScores = { calculateHardScore(solution) }; int[] softScores = { solution.countOffHosts(), rand.nextInt(POSSIBLE_SCORES), -VmPlacementConfig.initialClusterState.get().countVmMigrationsNeeded(solution)}; return BendableScore.valueOf(hardScores, softScores); }
ScoreCalculatorRandom implements SimpleScoreCalculator<ClusterState> { @Override public BendableScore calculateScore(ClusterState solution) { int[] hardScores = { calculateHardScore(solution) }; int[] softScores = { solution.countOffHosts(), rand.nextInt(POSSIBLE_SCORES), -VmPlacementConfig.initialClusterState.get().countVmMigrationsNeeded(solution)}; return BendableScore.valueOf(hardScores, softScores); } }
ScoreCalculatorRandom implements SimpleScoreCalculator<ClusterState> { @Override public BendableScore calculateScore(ClusterState solution) { int[] hardScores = { calculateHardScore(solution) }; int[] softScores = { solution.countOffHosts(), rand.nextInt(POSSIBLE_SCORES), -VmPlacementConfig.initialClusterState.get().countVmMigrationsNeeded(solution)}; return BendableScore.valueOf(hardScores, softScores); }  }
ScoreCalculatorRandom implements SimpleScoreCalculator<ClusterState> { @Override public BendableScore calculateScore(ClusterState solution) { int[] hardScores = { calculateHardScore(solution) }; int[] softScores = { solution.countOffHosts(), rand.nextInt(POSSIBLE_SCORES), -VmPlacementConfig.initialClusterState.get().countVmMigrationsNeeded(solution)}; return BendableScore.valueOf(hardScores, softScores); }  @Override BendableScore calculateScore(ClusterState solution); }
ScoreCalculatorRandom implements SimpleScoreCalculator<ClusterState> { @Override public BendableScore calculateScore(ClusterState solution) { int[] hardScores = { calculateHardScore(solution) }; int[] softScores = { solution.countOffHosts(), rand.nextInt(POSSIBLE_SCORES), -VmPlacementConfig.initialClusterState.get().countVmMigrationsNeeded(solution)}; return BendableScore.valueOf(hardScores, softScores); }  @Override BendableScore calculateScore(ClusterState solution);  }