@Test public void scoreTest() { ClusterState clusterState = getTestClusterState(); assertEquals(-4, scoreCalculatorDistribution.calculateScore(clusterState).getHardScore()); assertEquals(-67, scoreCalculatorDistribution.calculateScore(clusterState).getSoftScore()); assertEquals(-67, scoreCalculatorDistribution.calculateScore(clusterState).getSoftScore()); }
@Override public HardMediumSoftScore calculateScore(ClusterState solution) { int hardScore = calculateHardScore(solution); int mediumScore = - (solution.countOffHosts() + solution.countIdleHosts()); int migrations = VmPlacementConfig.initialClusterState.get().countVmMigrationsNeeded(solution); int stdevCpuPerc = (int)(100 * solution.calculateStdDevCpuPercUsedPerHost()); int softScore = -stdevCpuPerc - migrations; return HardMediumSoftScore.valueOf(hardScore, mediumScore, softScore); }
ScoreCalculatorDistribution implements SimpleScoreCalculator<ClusterState> { @Override public HardMediumSoftScore calculateScore(ClusterState solution) { int hardScore = calculateHardScore(solution); int mediumScore = - (solution.countOffHosts() + solution.countIdleHosts()); int migrations = VmPlacementConfig.initialClusterState.get().countVmMigrationsNeeded(solution); int stdevCpuPerc = (int)(100 * solution.calculateStdDevCpuPercUsedPerHost()); int softScore = -stdevCpuPerc - migrations; return HardMediumSoftScore.valueOf(hardScore, mediumScore, softScore); } }
ScoreCalculatorDistribution implements SimpleScoreCalculator<ClusterState> { @Override public HardMediumSoftScore calculateScore(ClusterState solution) { int hardScore = calculateHardScore(solution); int mediumScore = - (solution.countOffHosts() + solution.countIdleHosts()); int migrations = VmPlacementConfig.initialClusterState.get().countVmMigrationsNeeded(solution); int stdevCpuPerc = (int)(100 * solution.calculateStdDevCpuPercUsedPerHost()); int softScore = -stdevCpuPerc - migrations; return HardMediumSoftScore.valueOf(hardScore, mediumScore, softScore); }  }
ScoreCalculatorDistribution implements SimpleScoreCalculator<ClusterState> { @Override public HardMediumSoftScore calculateScore(ClusterState solution) { int hardScore = calculateHardScore(solution); int mediumScore = - (solution.countOffHosts() + solution.countIdleHosts()); int migrations = VmPlacementConfig.initialClusterState.get().countVmMigrationsNeeded(solution); int stdevCpuPerc = (int)(100 * solution.calculateStdDevCpuPercUsedPerHost()); int softScore = -stdevCpuPerc - migrations; return HardMediumSoftScore.valueOf(hardScore, mediumScore, softScore); }  @Override HardMediumSoftScore calculateScore(ClusterState solution); }
ScoreCalculatorDistribution implements SimpleScoreCalculator<ClusterState> { @Override public HardMediumSoftScore calculateScore(ClusterState solution) { int hardScore = calculateHardScore(solution); int mediumScore = - (solution.countOffHosts() + solution.countIdleHosts()); int migrations = VmPlacementConfig.initialClusterState.get().countVmMigrationsNeeded(solution); int stdevCpuPerc = (int)(100 * solution.calculateStdDevCpuPercUsedPerHost()); int softScore = -stdevCpuPerc - migrations; return HardMediumSoftScore.valueOf(hardScore, mediumScore, softScore); }  @Override HardMediumSoftScore calculateScore(ClusterState solution);  }