当前位置: 首页>>代码示例>>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;未经允许,请勿转载。