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


Java VirtualLink.get方法代码示例

本文整理汇总了Java中vnreal.network.virtual.VirtualLink.get方法的典型用法代码示例。如果您正苦于以下问题:Java VirtualLink.get方法的具体用法?Java VirtualLink.get怎么用?Java VirtualLink.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vnreal.network.virtual.VirtualLink的用法示例。


在下文中一共展示了VirtualLink.get方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: cost

import vnreal.network.virtual.VirtualLink; //导入方法依赖的package包/类
public static double cost(VirtualNetwork virtualNetwork) {
    double nodeCost = 0;
    for (VirtualNode virtualNode : virtualNetwork.getVertices()) {
        for (CpuDemand cpuDemand : virtualNode.get(CpuDemand.class)) {
            nodeCost += cpuDemand.getDemandedCycles() * cpuDemand.getMappings().size();
        }
    }

    double linkCost = 0;
    for (VirtualLink virtualLink : virtualNetwork.getEdges()) {
        for (BandwidthDemand bandwidthDemand : virtualLink.get(BandwidthDemand.class)) {
            linkCost += bandwidthDemand.getDemandedBandwidth() * bandwidthDemand.getMappings().size();
        }
    }

    return nodeCost + linkCost;
}
 
开发者ID:liruixpc11,项目名称:crucian,代码行数:18,代码来源:VirtualCostEvaluator.java

示例2: revenue

import vnreal.network.virtual.VirtualLink; //导入方法依赖的package包/类
public static double revenue(VirtualNetwork virtualNetwork) {
    double nodeRevenue = 0;
    for (VirtualNode virtualNode : virtualNetwork.getVertices()) {
        for (CpuDemand cpuDemand : virtualNode.get(CpuDemand.class)) {
            nodeRevenue += cpuDemand.getDemandedCycles();
        }
    }

    double linkRevenue = 0;
    for (VirtualLink virtualLink : virtualNetwork.getEdges()) {
        for (BandwidthDemand bandwidthDemand : virtualLink.get(BandwidthDemand.class)) {
            linkRevenue += bandwidthDemand.getDemandedBandwidth();
        }
    }

    return nodeRevenue + linkRevenue;
}
 
开发者ID:liruixpc11,项目名称:crucian,代码行数:18,代码来源:RevenueEvaluator.java

示例3: calculate

import vnreal.network.virtual.VirtualLink; //导入方法依赖的package包/类
@Override
public double calculate(NetworkStack stack) {
	double totalBW = 0;
	for (VirtualNetwork net : stack.getVirtuals()) {
		for (VirtualLink link : net.getEdges()) {
			BandwidthDemand dem = (BandwidthDemand) link.get(BandwidthDemand.class);
			if (dem != null) {
				totalBW += dem.getDemandedBandwidth();
			}
		}
	}
	return totalBW;
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:14,代码来源:TotalBWDem.java

示例4: mapLinks

import vnreal.network.virtual.VirtualLink; //导入方法依赖的package包/类
/**
 * mapping of links
 */
boolean mapLinks(VirtualNetwork vNetwork, SubstrateNetwork sNetwork,
		NodeLinkMapping result) {

	for (VirtualLink vl : vNetwork.getEdges()) {
		Pair<VirtualNode> nodes = vNetwork.getEndpoints(vl);

		SubstrateNode from = result.getSubstrateNode(nodes.getFirst());
		SubstrateNode to = result.getSubstrateNode(nodes.getSecond());

		if (from.getId() == to.getId()) {
			continue;
		}

		SubstrateLinkStressTransformer transformer = new SubstrateLinkStressTransformer(
				this, sNetwork, vl.get(), biggestLinkStress, delta_L);
		DistanceEntry distance = getDistance(sNetwork, from, to,
				transformer);
		assert (distance == null || Utils.fulfills(distance.path, vl.get()));

		if (distance == null) {
			return false;
		}

		result.add(vl, distance.path);
		demandedResources.addAll(Utils.occupyPathResources(vl,
				distance.path, sNetwork));

		SubstrateNode currentNode = from;
		for (SubstrateLink sl : distance.path) {
			double stress = getStressLevel(sNetwork, currentNode, sl);
			if (stress > biggestLinkStress) {
				biggestLinkStress = stress;
			}
			currentNode = sNetwork.getOpposite(currentNode, sl);
		}
	}
	return true;
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:42,代码来源:BasicVNAssignmentAlgorithm.java

示例5: hasLinkMappings

import vnreal.network.virtual.VirtualLink; //导入方法依赖的package包/类
public static boolean hasLinkMappings(VirtualLink vLink) {
	for (AbstractDemand dem : vLink.get())
		if (!dem.getMappings().isEmpty())
			return true;

	return false;
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:8,代码来源:MiscelFunctions.java

示例6: getBandwidthDemand

import vnreal.network.virtual.VirtualLink; //导入方法依赖的package包/类
public static BandwidthDemand getBandwidthDemand(VirtualLink vl) {
	for (AbstractDemand r : vl.get()) {
		if (r instanceof BandwidthDemand) {
			return (BandwidthDemand) r;
		}
	}

	return null;
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:10,代码来源:Utils.java

示例7: mapLinks

import vnreal.network.virtual.VirtualLink; //导入方法依赖的package包/类
/**
 * mapping of links
 */
boolean mapLinks(VirtualNetwork vNetwork, SubstrateNetwork sNetwork,
                 Mapping result) {

    for (VirtualLink vl : vNetwork.getEdges()) {
        Pair<VirtualNode> nodes = vNetwork.getEndpoints(vl);

        SubstrateNode from = result.getSubstrateNode(nodes.getFirst());
        SubstrateNode to = result.getSubstrateNode(nodes.getSecond());

        if (from.getId() == to.getId()) {
            continue;
        }

        SubstrateLinkStressTransformer transformer = new SubstrateLinkStressTransformer(
                this, sNetwork,
                vl.get(), biggestLinkStress,
                delta_L);
        DistanceEntry distance = getDistance(sNetwork, from, to, transformer);
        assert (distance == null || Utils.fulfills(distance.path, vl.get()));

        if (distance == null) {
            return false;
        }

        result.add(vl, distance.path);
        demandedResources.addAll(Utils.occupyPathResources(vl,
                distance.path, sNetwork, useEnergyDemand));

        SubstrateNode currentNode = from;
        for (SubstrateLink sl : distance.path) {
            double stress = getStressLevel(sNetwork, currentNode, sl);
            if (stress > biggestLinkStress) {
                biggestLinkStress = stress;
            }
            currentNode = sNetwork.getOpposite(currentNode, sl);
        }
    }
    return true;
}
 
开发者ID:liruixpc11,项目名称:crucian,代码行数:43,代码来源:BasicVNAssignmentAlgorithm.java

示例8: addSub

import vnreal.network.virtual.VirtualLink; //导入方法依赖的package包/类
@Override
public void addSub(VirtualLink virtualLink) {
    virtualLinks.add(virtualLink);
    for (BandwidthDemand demand : virtualLink.get(BandwidthDemand.class)) {
        coarsenBandwidthDemand.addDemand(demand);
    }
}
 
开发者ID:liruixpc11,项目名称:crucian,代码行数:8,代码来源:CoarsenVirtualLink.java

示例9: mapLinks

import vnreal.network.virtual.VirtualLink; //导入方法依赖的package包/类
/**
 * mapping of links
 */
boolean mapLinks(VirtualNetwork vNetwork, SubstrateNetwork sNetwork,
		Mapping result) {

	for (VirtualLink vl : vNetwork.getEdges()) {
		Pair<VirtualNode> nodes = vNetwork.getEndpoints(vl);

		SubstrateNode from = result.getSubstrateNode(nodes.getFirst());
		SubstrateNode to = result.getSubstrateNode(nodes.getSecond());

		if (from.getId() == to.getId()) {
			continue;
		}

		SubstrateLinkStressTransformer transformer = new SubstrateLinkStressTransformer(
				this, sNetwork, vl.get(), biggestLinkStress, delta_L);
		DistanceEntry distance = getDistance(sNetwork, from, to,
				transformer);
		assert (distance == null || Utils.fulfills(distance.path, vl.get()));

		if (distance == null) {
			return false;
		}

		result.add(vl, distance.path);
		demandedResources.addAll(Utils.occupyPathResources(vl,
				distance.path, sNetwork, useEnergyDemand));

		SubstrateNode currentNode = from;
		for (SubstrateLink sl : distance.path) {
			double stress = getStressLevel(sNetwork, currentNode, sl);
			if (stress > biggestLinkStress) {
				biggestLinkStress = stress;
			}
			currentNode = sNetwork.getOpposite(currentNode, sl);
		}
	}
	return true;
}
 
开发者ID:fabe85,项目名称:Alevin,代码行数:42,代码来源:BasicVNAssignmentAlgorithm.java


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