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