本文整理汇总了Java中org.cloudbus.cloudsim.util.MathUtil.median方法的典型用法代码示例。如果您正苦于以下问题:Java MathUtil.median方法的具体用法?Java MathUtil.median怎么用?Java MathUtil.median使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.cloudbus.cloudsim.util.MathUtil
的用法示例。
在下文中一共展示了MathUtil.median方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getUtilizationMad
import org.cloudbus.cloudsim.util.MathUtil; //导入方法依赖的package包/类
/**
* Gets the utilization MAD in MIPS.
*
* @return the utilization mean in MIPS
*/
public double getUtilizationMad() {
double mad = 0;
if (!getUtilizationHistory().isEmpty()) {
int n = HISTORY_LENGTH;
if (HISTORY_LENGTH > getUtilizationHistory().size()) {
n = getUtilizationHistory().size();
}
double median = MathUtil.median(getUtilizationHistory());
double[] deviationSum = new double[n];
for (int i = 0; i < n; i++) {
deviationSum[i] = Math.abs(median - getUtilizationHistory().get(i));
}
mad = MathUtil.median(deviationSum);
}
return mad;
}
示例2: getUtilizationMad
import org.cloudbus.cloudsim.util.MathUtil; //导入方法依赖的package包/类
/**
* Gets the utilization MAD in MIPS.
*
* @return the utilization mean in MIPS
*/
public double getUtilizationMad() {
double mad = 0;
if (!getUtilizationHistory().isEmpty()) {
int n = HISTORY_LENGTH;
if (HISTORY_LENGTH > getUtilizationHistory().size()) {
n = getUtilizationHistory().size();
}
double median = MathUtil.median(getUtilizationHistory());
double[] deviationSum = new double[n];
for (int i = 0; i < n; i++) {
deviationSum[i] = Math.abs(median - getUtilizationHistory().get(i));
}
mad = Stat.median(deviationSum);
}
return mad;
}
示例3: getUtilizationMad
import org.cloudbus.cloudsim.util.MathUtil; //导入方法依赖的package包/类
/**
* Gets the utilization Median Absolute Deviation (MAD) in MIPS.
* @return
*/
public double getUtilizationMad() {
if (!getUtilizationHistory().isEmpty()) {
int n = Math.min(MAX_HISTORY_ENTRIES, getUtilizationHistory().size());
double median = MathUtil.median(getUtilizationHistory());
double[] deviationSum = new double[n];
for (int i = 0; i < n; i++) {
deviationSum[i] = Math.abs(median - getUtilizationHistory().get(i));
}
return MathUtil.median(deviationSum);
}
return 0;
}