当前位置: 首页>>代码示例>>Java>>正文


Java VirtualLink.addHiddenHopDemand方法代码示例

本文整理汇总了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);
	
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:19,代码来源:GenericMappingAlgorithm.java

示例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);
}
 
开发者ID:liruixpc11,项目名称:crucian,代码行数:20,代码来源:GenericMappingAlgorithm.java

示例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);
}
 
开发者ID:fabe85,项目名称:Alevin,代码行数:20,代码来源:GenericMappingAlgorithm.java

示例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));
            }
        }
    }
}
 
开发者ID:liruixpc11,项目名称:crucian,代码行数:76,代码来源:ScenarioImporter.java


注:本文中的vnreal.network.virtual.VirtualLink.addHiddenHopDemand方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。