@Test public void testGetSumOfSquareError() { System.out.println("getSumOfSquareError"); setCalibrationData(host); host.setRamMb(32244); CpuOnlySplinePolynomialEnergyPredictor instance = new CpuOnlySplinePolynomialEnergyPredictor(); double result = instance.getSumOfSquareError(host); assert(result >= 0.0); }
private double getSumOfSquareError(PolynomialSplineFunction function, double[] xObserved, double[] yObserved) { double answer = 0; for (int i = 0; i < xObserved.length; i++) { double error = yObserved[i] - function.value(xObserved[i]); answer = answer + (error * error); } return answer; }
CpuOnlySplinePolynomialEnergyPredictor extends AbstractEnergyPredictor { private double getSumOfSquareError(PolynomialSplineFunction function, double[] xObserved, double[] yObserved) { double answer = 0; for (int i = 0; i < xObserved.length; i++) { double error = yObserved[i] - function.value(xObserved[i]); answer = answer + (error * error); } return answer; } }
CpuOnlySplinePolynomialEnergyPredictor extends AbstractEnergyPredictor { private double getSumOfSquareError(PolynomialSplineFunction function, double[] xObserved, double[] yObserved) { double answer = 0; for (int i = 0; i < xObserved.length; i++) { double error = yObserved[i] - function.value(xObserved[i]); answer = answer + (error * error); } return answer; } CpuOnlySplinePolynomialEnergyPredictor();  CpuOnlySplinePolynomialEnergyPredictor(PropertiesConfiguration config); }
CpuOnlySplinePolynomialEnergyPredictor extends AbstractEnergyPredictor { private double getSumOfSquareError(PolynomialSplineFunction function, double[] xObserved, double[] yObserved) { double answer = 0; for (int i = 0; i < xObserved.length; i++) { double error = yObserved[i] - function.value(xObserved[i]); answer = answer + (error * error); } return answer; } CpuOnlySplinePolynomialEnergyPredictor();  CpuOnlySplinePolynomialEnergyPredictor(PropertiesConfiguration config); @Override EnergyUsagePrediction getHostPredictedEnergy(Host host, Collection<VM> virtualMachines, TimePeriod duration); @Override EnergyUsagePrediction getVMPredictedEnergy(VM vm, Collection<VM> virtualMachines, Host host, TimePeriod timePeriod); EnergyUsagePrediction predictTotalEnergy(Host host, double usageCPU, TimePeriod timePeriod); @Override double predictPowerUsed(Host host); @Override double predictPowerUsed(Host host, double usageCPU); @Override double getSumOfSquareError(Host host); @Override double getRootMeanSquareError(Host host); @Override String toString(); @Override void printFitInformation(Host host); }
CpuOnlySplinePolynomialEnergyPredictor extends AbstractEnergyPredictor { private double getSumOfSquareError(PolynomialSplineFunction function, double[] xObserved, double[] yObserved) { double answer = 0; for (int i = 0; i < xObserved.length; i++) { double error = yObserved[i] - function.value(xObserved[i]); answer = answer + (error * error); } return answer; } CpuOnlySplinePolynomialEnergyPredictor();  CpuOnlySplinePolynomialEnergyPredictor(PropertiesConfiguration config); @Override EnergyUsagePrediction getHostPredictedEnergy(Host host, Collection<VM> virtualMachines, TimePeriod duration); @Override EnergyUsagePrediction getVMPredictedEnergy(VM vm, Collection<VM> virtualMachines, Host host, TimePeriod timePeriod); EnergyUsagePrediction predictTotalEnergy(Host host, double usageCPU, TimePeriod timePeriod); @Override double predictPowerUsed(Host host); @Override double predictPowerUsed(Host host, double usageCPU); @Override double getSumOfSquareError(Host host); @Override double getRootMeanSquareError(Host host); @Override String toString(); @Override void printFitInformation(Host host);  }