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


Java Utils.rnd方法代码示例

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


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

示例1: generateRandomBandwidthDemands

import vnreal.algorithms.utils.SubgraphBasicVN.Utils; //导入方法依赖的package包/类
public static void generateRandomBandwidthDemands(
		VirtualNetwork vNetwork, int minDemandBandwidth,
		int maxDemandBandwidth, Random random,
		boolean useCommonConstraints) {
	
	for (VirtualLink l : vNetwork.getEdges()) {
		int value = Utils.rnd(minDemandBandwidth, maxDemandBandwidth, random);
		if (useCommonConstraints) {
			CommonDemand d = new CommonDemand(value, l);
			l.add(d);
		} else {
			BandwidthDemand bw = new BandwidthDemand(l);
			bw.setDemandedBandwidth((double) value);
			l.add(bw);
		}
	}
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:18,代码来源:RandomDemandGenerator.java

示例2: generateRandomCPUResources

import vnreal.algorithms.utils.SubgraphBasicVN.Utils; //导入方法依赖的package包/类
public static void generateRandomCPUResources(SubstrateNetwork sNetwork,
		int minResourceCPU, int maxResourceCPU, Random random, boolean useCommonConstraints) {

	for (SubstrateNode n : sNetwork.getVertices()) {
		int value = Utils.rnd(minResourceCPU, maxResourceCPU, random);
		
		if (useCommonConstraints) {
			CommonResource r = new CommonResource(value, n);
			n.add(r);
		} else {
			CpuResource cpu = new CpuResource(n);
			cpu.setCycles((double) value);
			n.add(cpu);
		}
	}
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:17,代码来源:RandomResourceGenerator.java

示例3: generateRandomBandwidthResources

import vnreal.algorithms.utils.SubgraphBasicVN.Utils; //导入方法依赖的package包/类
public static void generateRandomBandwidthResources(
		SubstrateNetwork sNetwork, int minResourceBandwidth,
		int maxResourceBandwidth, Random random,
		boolean useCommonConstraints) {

	for (SubstrateLink l : sNetwork.getEdges()) {
		int value = Utils.rnd(minResourceBandwidth, maxResourceBandwidth, random);
		
		if (useCommonConstraints) {
			CommonResource r = new CommonResource(value, l);
			l.add(r);
		} else {
			BandwidthResource bw = new BandwidthResource(l);
			bw.setBandwidth((double) value);
			l.add(bw);
		}
	}
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:19,代码来源:RandomResourceGenerator.java

示例4: generateRandomCPUDemands

import vnreal.algorithms.utils.SubgraphBasicVN.Utils; //导入方法依赖的package包/类
public static void generateRandomCPUDemands(VirtualNetwork vNetwork,
		Integer[] cpuDemands, Random random) {

	for (VirtualNode n : vNetwork.getVertices()) {
		CpuDemand cpu = new CpuDemand(n);
		int pos = Utils.rnd(0, cpuDemands.length - 1, random);
		int value = cpuDemands[pos];
		cpu.setDemandedCycles((double) value);
		n.add(cpu);
	}
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:12,代码来源:RandomSetDemandGenerator.java

示例5: generateRandomBandwidthDemands

import vnreal.algorithms.utils.SubgraphBasicVN.Utils; //导入方法依赖的package包/类
public static void generateRandomBandwidthDemands(
		VirtualNetwork vNetwork,
		Integer[] bandwidthDemands, Random random) {

	for (VirtualLink l : vNetwork.getEdges()) {
		BandwidthDemand bw = new BandwidthDemand(l);
		int pos = Utils.rnd(0, bandwidthDemands.length - 1, random);
		int value = bandwidthDemands[pos];
		bw.setDemandedBandwidth((double) value);
		l.add(bw);
	}
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:13,代码来源:RandomSetDemandGenerator.java

示例6: generateRandomDelayDemands

import vnreal.algorithms.utils.SubgraphBasicVN.Utils; //导入方法依赖的package包/类
public static void generateRandomDelayDemands(
		VirtualNetwork vNetwork,
		Integer[] delayDemands, Random random) {

	for (VirtualLink l : vNetwork.getEdges()) {
		int pos = Utils.rnd(0, delayDemands.length - 1, random);
		int value = delayDemands[pos];
		StaticMaxDelayDemand bw = new StaticMaxDelayDemand(l, value);
		l.add(bw);
	}
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:12,代码来源:RandomSetDemandGenerator.java

示例7: generateRandomCPUDemands

import vnreal.algorithms.utils.SubgraphBasicVN.Utils; //导入方法依赖的package包/类
public static void generateRandomCPUDemands(VirtualNetwork vNetwork,
		int minDemandCPU, int maxDemandCPU, Random random, boolean useCommonConstraints) {

	for (VirtualNode n : vNetwork.getVertices()) {
		int value = Utils.rnd(minDemandCPU, maxDemandCPU, random);
		if (useCommonConstraints) {
			CommonDemand d = new CommonDemand(value, n);
			n.add(d);
		} else {
			CpuDemand cpu = new CpuDemand(n);
			cpu.setDemandedCycles((double) value);
			n.add(cpu);
		}
	}
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:16,代码来源:RandomDemandGenerator.java

示例8: generateFreeSlotsResources

import vnreal.algorithms.utils.SubgraphBasicVN.Utils; //导入方法依赖的package包/类
public static void generateFreeSlotsResources(SubstrateNetwork network, HashMap<String, LinkedList<String>> labelsAndVNFTypes, int minFreeSlotsResources, int maxFreeSlotsResources, Random random) {
	for (SubstrateNode n : network.getVertices()) {
		int slots = Utils.rnd(minFreeSlotsResources, maxFreeSlotsResources, random);
		
		LinkedList<String> keys = new LinkedList<String>(labelsAndVNFTypes.keySet());
		String label = keys.get(Utils.rnd(0, keys.size() - 1, random));
		n.add(new FreeSlotsResource(label, slots, n));
	}
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:10,代码来源:RandomResourceGenerator.java

示例9: generateRandomCapacityResources

import vnreal.algorithms.utils.SubgraphBasicVN.Utils; //导入方法依赖的package包/类
public static void generateRandomCapacityResources(SubstrateNetwork sNetwork,
		int minCapacity, int maxCapacity, Random random,
		boolean useCommonRessource) {

	int value = Utils.rnd(minCapacity, maxCapacity, random);
	for (SubstrateNode n : sNetwork.getVertices()) {
		if (useCommonRessource) {
			n.add(new CommonResource(value, n));
		} else {
			n.add(new CapacityResource(value, n));
		}
	}
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:14,代码来源:RandomResourceGenerator.java

示例10: generateRandomCPUResources

import vnreal.algorithms.utils.SubgraphBasicVN.Utils; //导入方法依赖的package包/类
public static void generateRandomCPUResources(SubstrateNetwork sNetwork,
		Integer[] cpuResources, Random random) {

	for (SubstrateNode n : sNetwork.getVertices()) {
		CpuResource cpu = new CpuResource(n);
		int pos = Utils.rnd(0, cpuResources.length - 1, random);
		int value = cpuResources[pos];
		cpu.setCycles((double) value);
		n.add(cpu);
	}
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:12,代码来源:RandomSetResourceGenerator.java

示例11: generateRandomBandwidthResources

import vnreal.algorithms.utils.SubgraphBasicVN.Utils; //导入方法依赖的package包/类
public static void generateRandomBandwidthResources(
		SubstrateNetwork sNetwork,
		Integer[] bandwidthResources,
		Random random) {

	for (SubstrateLink l : sNetwork.getEdges()) {
		BandwidthResource bw = new BandwidthResource(l);
		int pos = Utils.rnd(0, bandwidthResources.length - 1, random);
		int value = bandwidthResources[pos];
		bw.setBandwidth((double) value);
		l.add(bw);
	}
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:14,代码来源:RandomSetResourceGenerator.java

示例12: generateRandomDelayResources

import vnreal.algorithms.utils.SubgraphBasicVN.Utils; //导入方法依赖的package包/类
public static void generateRandomDelayResources(SubstrateNetwork network,
		Integer[] DelayResources, Random random) {
	
	for (SubstrateLink l : network.getEdges()) {
		int pos = Utils.rnd(0, DelayResources.length - 1, random);
		int value = DelayResources[pos];
		l.add(new StaticDelayResource(l, value));
	}
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:10,代码来源:RandomSetResourceGenerator.java

示例13: generateRandomMaxDelayDemands

import vnreal.algorithms.utils.SubgraphBasicVN.Utils; //导入方法依赖的package包/类
public static void generateRandomMaxDelayDemands(VirtualNetwork vNetwork, int minDelayDemand, int maxDelayDemand, Random random) {
	for (VirtualLink n : vNetwork.getEdges()) {
		int value = Utils.rnd(minDelayDemand, maxDelayDemand, random);
		n.add(new StaticMaxDelayDemand(n, value));
	}
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:7,代码来源:RandomDemandGenerator.java


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