本文整理汇总了Java中vnreal.network.virtual.VirtualLink.addHiddenHopDemand方法的典型用法代码示例。如果您正苦于以下问题:Java VirtualLink.addHiddenHopDemand方法的具体用法?Java VirtualLink.addHiddenHopDemand怎么用?Java VirtualLink.addHiddenHopDemand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vnreal.network.virtual.VirtualLink
的用法示例。
在下文中一共展示了VirtualLink.addHiddenHopDemand方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setHhMappings
import vnreal.network.virtual.VirtualLink; //导入方法依赖的package包/类
public void setHhMappings(List<IHiddenHopMapping> hhs) {
for (Network<?,?,?> net : ns.getVirtuals()) {
VirtualNetwork vNet = (VirtualNetwork) net;
for (VirtualLink vLink : vNet.getEdges()) {
// Clearing past hidden hops demands
vLink.clearHiddenHopDemands();
for (AbstractDemand dem : vLink) {
for (IHiddenHopMapping hh : hhs)
if (hh.accepts(dem))
vLink.addHiddenHopDemand(hh.transform(dem));
}
}
}
// Adding the hiddenhops mapping to the link and node mapping algorithm
linkMappingAlgorithm.setHhMappings(hhs);
nodeMappingAlgorithm.setHhMappings(hhs);
}
示例2: setHhMappings
import vnreal.network.virtual.VirtualLink; //导入方法依赖的package包/类
public void setHhMappings(List<IHiddenHopMapping> hhs) {
for (@SuppressWarnings("rawtypes")
Network net : stack)
if (net instanceof VirtualNetwork) {
VirtualNetwork vNet = (VirtualNetwork) net;
for (VirtualLink vLink : vNet.getEdges()) {
// Clearing past hidden hops demands
vLink.clearHiddenHopDemands();
for (AbstractDemand dem : vLink) {
for (IHiddenHopMapping hh : hhs)
if (hh.accepts(dem))
vLink.addHiddenHopDemand(hh.transform(dem));
}
}
}
// Adding the hiddenhops mapping to the link and node mapping algorithm
linkMappingAlgorithm.setHhMappings(hhs);
nodeMappingAlgorithm.setHhMappings(hhs);
}
示例3: setHhMappings
import vnreal.network.virtual.VirtualLink; //导入方法依赖的package包/类
public void setHhMappings(List<IHiddenHopMapping> hhs) {
for (@SuppressWarnings("rawtypes")
Network net : stack)
if (net instanceof VirtualNetwork) {
VirtualNetwork vNet = (VirtualNetwork) net;
for (VirtualLink vLink : vNet.getEdges()) {
// Clearing past hidden hops demands
vLink.clearHiddenHopDemands();
for (AbstractDemand dem : vLink) {
for (IHiddenHopMapping hh : hhs)
if (hh.accepts(dem))
vLink.addHiddenHopDemand(hh.transform(dem));
}
}
}
// Adding the hiddenhops mapping to the link and node mapping algorithm
linkMappingAlgorithm.setHhMappings(hhs);
nodeMappingAlgorithm.setHhMappings(hhs);
}
示例4: processVirtualNetworks
import vnreal.network.virtual.VirtualLink; //导入方法依赖的package包/类
/**
* Creates a list of {@link VirtualNetwork}s as specified in the XML file.
*
* @param n the {@link VirtualNetwork}'s Node.
*/
private void processVirtualNetworks(Node n) {
int layer;
int id;
VirtualNode virtualNode;
for (Node virtualNet = XMLUtils.firstElementNodeChild(n); virtualNet != null; virtualNet = XMLUtils
.nextElementNode(virtualNet)) {
layer = XMLUtils.getIntAttribute(virtualNet, "layer");
ToolKit.getScenario().getNetworkStack()
.addLayer(new VirtualNetwork(layer));
Node virtualNodes = XMLUtils.firstElementNodeChild(virtualNet);
Node virtualLinks = XMLUtils.nextElementNode(virtualNodes);
// create virtual nodes
for (Node vNode = XMLUtils.firstElementNodeChild(virtualNodes); vNode != null; vNode = XMLUtils
.nextElementNode(vNode)) {
id = XMLUtils.getIntAttribute(vNode, "id");
virtualNode = new VirtualNode(id, layer);
virtualNode.setCoordinateX(XMLUtils.getDoubleAttribute(vNode,
"coordinateX"));
virtualNode.setCoordinateY(XMLUtils.getDoubleAttribute(vNode,
"coordinateY"));
if (!((VirtualNetwork) ToolKit.getScenario().getNetworkStack()
.getLayer(layer)).addVertex(virtualNode)) {
System.err.println("Failed to add Node " + id
+ " to virtual network");
throw new Error();
}
for (Node dem = XMLUtils.firstElementNodeChild(vNode); dem != null; dem = XMLUtils
.nextElementNode(dem)) {
// add the demand and the mappings
virtualNode.add(getDemand(dem, virtualNode));
}
}
// create virtual links
for (Node vLink = XMLUtils.firstElementNodeChild(virtualLinks); vLink != null; vLink = XMLUtils
.nextElementNode(vLink)) {
id = XMLUtils.getIntAttribute(vLink, "id");
Integer source = XMLUtils.getIntAttribute(vLink, "source");
Integer destination = XMLUtils.getIntAttribute(vLink,
"destination");
VirtualLink virtualLink = new VirtualLink(id, layer);
if (!((VirtualNetwork) ToolKit.getScenario().getNetworkStack()
.getLayer(layer)).addEdge(virtualLink,
getVirtualNodeForId(layer, source),
getVirtualNodeForId(layer, destination))) {
System.err.println("Failed to add Link " + id
+ " to virtual network");
throw new Error();
}
for (Node dem = XMLUtils.firstElementNodeChild(vLink); dem != null; dem = XMLUtils
.nextElementNode(dem)) {
if (dem.getNodeName().equals("Demand"))
// add the demand and the mappings
virtualLink.add(getDemand(dem, virtualLink));
else if (dem.getNodeName().equals("HiddenHopDemand"))
// also add HH Demands if present
virtualLink.addHiddenHopDemand(getDemand(dem,
virtualLink));
}
}
}
}