本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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));
}
示例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));
}
示例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;
}
示例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);
}