本文整理汇总了Java中vnreal.algorithms.utils.SubgraphBasicVN.Utils.getStressLevel方法的典型用法代码示例。如果您正苦于以下问题:Java Utils.getStressLevel方法的具体用法?Java Utils.getStressLevel怎么用?Java Utils.getStressLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vnreal.algorithms.utils.SubgraphBasicVN.Utils
的用法示例。
在下文中一共展示了Utils.getStressLevel方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: calculate
import vnreal.algorithms.utils.SubgraphBasicVN.Utils; //导入方法依赖的package包/类
public double calculate(NetworkStack stack) {
SubstrateNetwork sNetwork = stack.getSubstrate();
int sumLinkStress = 0;
int counter = 0;
for (SubstrateLink sl : sNetwork.getEdges()) {
int stress = Utils.getStressLevel(sl);
sumLinkStress += stress;
if (stress != 0) {
++counter;
}
}
if (counter == 0)
return Double.NaN;
return (sumLinkStress / (double) counter);
}
示例2: calculate
import vnreal.algorithms.utils.SubgraphBasicVN.Utils; //导入方法依赖的package包/类
public double calculate(NetworkStack stack) {
SubstrateNetwork sNetwork = stack.getSubstrate();
int sumLinkStress = 0;
for (SubstrateLink sl : sNetwork.getEdges())
sumLinkStress += Utils.getStressLevel(sl);
return (sumLinkStress / (double) sNetwork.getEdges().size());
}
示例3: calculate
import vnreal.algorithms.utils.SubgraphBasicVN.Utils; //导入方法依赖的package包/类
public double calculate(NetworkStack stack) {
SubstrateNetwork sNetwork = stack.getSubstrate();
int max = 0;
for (SubstrateLink sl : sNetwork.getEdges()) {
int stress = Utils.getStressLevel(sl);
if (stress > max) {
max = stress;
}
}
return max;
}
示例4: transform
import vnreal.algorithms.utils.SubgraphBasicVN.Utils; //导入方法依赖的package包/类
public Double transform(SubstrateLink l) {
if (!Utils.fulfills(vldemands, l.get())) {
return Double.POSITIVE_INFINITY;
}
double stress = Utils.getStressLevel(l);
if (biggestLinkStress < stress) {
biggestLinkStress = stress;
}
return (1.0 / (biggestLinkStress + delta_L - stress));
}
示例5: getStressLevel
import vnreal.algorithms.utils.SubgraphBasicVN.Utils; //导入方法依赖的package包/类
public double getStressLevel(SubstrateNetwork sNetwork, SubstrateNode n) {
return Utils.getStressLevel(n);
}
示例6: transform
import vnreal.algorithms.utils.SubgraphBasicVN.Utils; //导入方法依赖的package包/类
public Double transform(SubstrateLink l) {
if (!Utils.fulfills(vldemands, l.get())) {
return Double.POSITIVE_INFINITY;
}
return (double) Utils.getStressLevel(l);
}