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


Java Utils.fulfills方法代碼示例

本文整理匯總了Java中vnreal.algorithms.utils.SubgraphBasicVN.Utils.fulfills方法的典型用法代碼示例。如果您正苦於以下問題:Java Utils.fulfills方法的具體用法?Java Utils.fulfills怎麽用?Java Utils.fulfills使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在vnreal.algorithms.utils.SubgraphBasicVN.Utils的用法示例。


在下文中一共展示了Utils.fulfills方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getMinPiNode

import vnreal.algorithms.utils.SubgraphBasicVN.Utils; //導入方法依賴的package包/類
public SubstrateNode getMinPiNode(SubstrateNetwork sNetwork,
		List<AbstractDemand> demands, Collection<SubstrateNode> v_a,
		Collection<SubstrateNode> ignoreNodes) {
	SubstrateNode result = null;
	double resultValue = 0.0, tmp = 0.0;
	for (SubstrateNode n : sNetwork.getVertices()) {
		if ((ignoreNodes == null || !ignoreNodes.contains(n))
				&& !v_a.contains(n)) {
			if (Utils.fulfills(demands, n.get())
					&& (result == null | (resultValue > (tmp = nodePotential(
							sNetwork, n, v_a))))) {

				result = n;
				resultValue = tmp;
			}
		}
	}

	return result;
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:21,代碼來源:BasicVNAssignmentAlgorithm.java

示例2: cartesian

import vnreal.algorithms.utils.SubgraphBasicVN.Utils; //導入方法依賴的package包/類
<T extends NetworkEntity<AbstractDemand>, U extends NetworkEntity<AbstractResource>> List<MappingCandidate<T, U>> cartesian(
		Collection<T> ts, Collection<U> us) {
	List<MappingCandidate<T, U>> result = new LinkedList<MappingCandidate<T, U>>();

	for (T t : ts) {
		for (U u : us) {
			if (Utils.fulfills(u, t)) {
				result.add(new MappingCandidate<T, U>(t, u));
			}
		}
	}

	return result;
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:15,代碼來源:SubgraphIsomorphismAlgorithm.java

示例3: transform

import vnreal.algorithms.utils.SubgraphBasicVN.Utils; //導入方法依賴的package包/類
public Double transform(SubstrateLink l) {
	if (!Utils.fulfills(vldemands, l.get())) {
		return Double.POSITIVE_INFINITY;
	}

	return 1.0;
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:8,代碼來源:SubstrateLinkDemandTransformer.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 = algorithm.getStressLevel(sNetwork, sNetwork
			.getEndpoints(l).getFirst(), l);
	if (biggestLinkStress < stress) {
		biggestLinkStress = stress;
	}

	return (1.0 / (biggestLinkStress + delta_L - stress));
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:14,代碼來源:SubstrateLinkStressTransformer.java

示例5: 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

示例6: mapALink

import vnreal.algorithms.utils.SubgraphBasicVN.Utils; //導入方法依賴的package包/類
/**
	 * Maps a virtual link to a substrate path and the reversed virtual link too
	 * @param v1 VirtualNode1
	 * @param v2 VirtualNode2
	 * @param path Substrate path
	 * @param request
	 * @return True if it worked, false otherwise
	 */
	private boolean mapALink(VirtualNode v1, VirtualNode v2,
			List<SubstrateLink> path, Request request) {
		VirtualNetwork vn = request.getVirtualNetwork();

		// create reversed path, because in ALEVIN links are directed
//		List<SubstrateLink> reversedPath = new LinkedList<SubstrateLink>();
//		for (SubstrateLink s : path) {
//			Pair<SubstrateNode> p = subNetwork.getEndpoints(s);
//
//			if (findDirectPathInSub(p.getFirst(), p.getSecond(), true).getId() == s
//					.getId()) {
//				reversedPath.add(findDirectPathInSub(p.getFirst(),
//						p.getSecond(), false));
//			} else {
//				reversedPath.add(findDirectPathInSub(p.getFirst(),
//						p.getSecond(), true));
//			}
//		}

		VirtualLink vl1ToEmbed = findDirectPathInVirt(v1, v2, vn, true);
		VirtualLink vl2ToEmbed = findDirectPathInVirt(v1, v2, vn, false);

		if (Utils.fulfills(path, vl1ToEmbed.get())) {
			DistributedAlgorithm.demandedResources.addAll(Utils
					.occupyPathResources(vl1ToEmbed, path, subNetwork));
//			DistributedAlgorithm.demandedResources.addAll(Utils
//					.occupyPathResources(vl2ToEmbed, reversedPath, subNetwork, false));
		} else {
			System.out.println("link doesn't fulfill demands");
			System.out.print(Utils.getBandwidthDemand(vl1ToEmbed) + " <-> ");
			for (SubstrateLink l : path) {
				System.out.print(Utils.getBandwidthAvailable(l) + " ");
			}
			System.out.println();
			return false;
		}

		request.getMapping().add(vl1ToEmbed, path);
//		request.getMapping().add(vl2ToEmbed, reversedPath);
		request.getVirtualLinksToEmbed().remove(vl1ToEmbed);
		request.getVirtualLinksToEmbed().remove(vl2ToEmbed);
		return true;
	}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:52,代碼來源:DistributedNode.java

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