當前位置: 首頁>>代碼示例>>Java>>正文


Java Utils.getStressLevel方法代碼示例

本文整理匯總了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);
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:19,代碼來源:AvActiveLinkStress.java

示例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());
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:10,代碼來源:AvLinkStress.java

示例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;
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:14,代碼來源:MaxLinkStress.java

示例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));
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:13,代碼來源:LinkStressTransformer.java

示例5: getStressLevel

import vnreal.algorithms.utils.SubgraphBasicVN.Utils; //導入方法依賴的package包/類
public double getStressLevel(SubstrateNetwork sNetwork, SubstrateNode n) {
	return Utils.getStressLevel(n);
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:4,代碼來源:BasicVNAssignmentAlgorithm.java

示例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);
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:7,代碼來源:OptimalMappingsAlgorithm.java


注:本文中的vnreal.algorithms.utils.SubgraphBasicVN.Utils.getStressLevel方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。