本文整理匯總了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);
}