• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java VmAllocationPolicy类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.cloudbus.cloudsim.VmAllocationPolicy的典型用法代码示例。如果您正苦于以下问题:Java VmAllocationPolicy类的具体用法?Java VmAllocationPolicy怎么用?Java VmAllocationPolicy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



VmAllocationPolicy类属于org.cloudbus.cloudsim包,在下文中一共展示了VmAllocationPolicy类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: PowerDatacenter

import org.cloudbus.cloudsim.VmAllocationPolicy; //导入依赖的package包/类
/**
 * Instantiates a new datacenter.
 * 
 * @param name the name
 * @param characteristics the res config
 * @param schedulingInterval the scheduling interval
 * @param utilizationBound the utilization bound
 * @param vmAllocationPolicy the vm provisioner
 * @param storageList the storage list
 * @throws Exception the exception
 */
public PowerDatacenter(
		String name,
		DatacenterCharacteristics characteristics,
		VmAllocationPolicy vmAllocationPolicy,
		List<Storage> storageList,
		double schedulingInterval) throws Exception {
	super(name, characteristics, vmAllocationPolicy, storageList, schedulingInterval);

	setPower(0.0);
	setDisableMigrations(false);
	setCloudletSubmitted(-1);
	setMigrationCount(0);
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:25,代码来源:PowerDatacenter.java


示例2: createSDNDatacenter

import org.cloudbus.cloudsim.VmAllocationPolicy; //导入依赖的package包/类
protected static SDNDatacenter createSDNDatacenter(String name, String physicalTopology, NetworkOperatingSystem snos, VmAllocationPolicyFactory vmAllocationFactory) {
	// In order to get Host information, pre-create NOS.
	nos=snos;
	List<Host> hostList = nos.getHostList();

	String arch = "x86"; // system architecture
	String os = "Linux"; // operating system
	String vmm = "Xen";
	
	double time_zone = 10.0; // time zone this resource located
	double cost = 3.0; // the cost of using processing in this resource
	double costPerMem = 0.05; // the cost of using memory in this resource
	double costPerStorage = 0.001; // the cost of using storage in this
									// resource
	double costPerBw = 0.0; // the cost of using bw in this resource
	LinkedList<Storage> storageList = new LinkedList<Storage>(); // we are not adding SAN
												// devices by now

	DatacenterCharacteristics characteristics = new DatacenterCharacteristics(
			arch, os, vmm, hostList, time_zone, cost, costPerMem,
			costPerStorage, costPerBw);

	// Create Datacenter with previously set parameters
	SDNDatacenter datacenter = null;
	try {
		VmAllocationPolicy vmPolicy = vmAllocationFactory.create(hostList);
		maxHostHandler = (PowerUtilizationMaxHostInterface)vmPolicy;
		datacenter = new SDNDatacenter(name, characteristics, vmPolicy, storageList, 0, nos);
		
		
		nos.setDatacenter(datacenter);
	} catch (Exception e) {
		e.printStackTrace();
	}
	
	return datacenter;
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:38,代码来源:SDNExample.java


示例3: SDNDatacenter

import org.cloudbus.cloudsim.VmAllocationPolicy; //导入依赖的package包/类
public SDNDatacenter(String name, DatacenterCharacteristics characteristics, VmAllocationPolicy vmAllocationPolicy, List<Storage> storageList, double schedulingInterval, NetworkOperatingSystem nos) throws Exception {
	super(name, characteristics, vmAllocationPolicy, storageList, schedulingInterval);
	
	this.nos=nos;
	this.requestsTable = new HashMap<Integer, Request>();
	
	//nos.init();
}
 
开发者ID:jayjmin,项目名称:cloudsimsdn,代码行数:9,代码来源:SDNDatacenter.java


示例4: updateVmMonitor

import org.cloudbus.cloudsim.VmAllocationPolicy; //导入依赖的package包/类
private void updateVmMonitor(double logTime) {
	VmAllocationPolicy vmAlloc = datacenter.getVmAllocationPolicy();
	if(vmAlloc instanceof OverbookingVmAllocationPolicy) {
		for(Vm v: this.vmList) {
			SDNVm vm = (SDNVm)v;
			double mipsOBR = ((OverbookingVmAllocationPolicy)vmAlloc).getCurrentOverbookingRatioMips((SDNVm) vm);
			LogWriter log = LogWriter.getLogger("vm_OBR_mips.csv");
			log.printLine(vm.getName()+","+logTime+","+mipsOBR);
			
			double bwOBR =  ((OverbookingVmAllocationPolicy)vmAlloc).getCurrentOverbookingRatioBw((SDNVm) vm);
			log = LogWriter.getLogger("vm_OBR_bw.csv");
			log.printLine(vm.getName()+","+logTime+","+bwOBR);
		}
	}
}
 
开发者ID:jayjmin,项目名称:cloudsimsdn,代码行数:16,代码来源:NetworkOperatingSystem.java


示例5: start

import org.cloudbus.cloudsim.VmAllocationPolicy; //导入依赖的package包/类
/**
 * Starts the simulation.
 * 
 * @param experimentName
 *            the experiment name
 * @param outputFolder
 *            the output folder
 * @param vmAllocationPolicy
 *            the vm allocation policy
 */
protected void start(String experimentName, String outputFolder,
		VmAllocationPolicy vmAllocationPolicy) {
	System.out.println("Starting " + experimentName);

	try {
		// 创建数据中心
		PowerDatacenter datacenter = (PowerDatacenter) Helper
				.createDatacenter("Datacenter", PowerDatacenter.class,
						hostList, vmAllocationPolicy);

		// 允许进行迁移
		datacenter.setDisableMigrations(false);

		broker.submitVmList(vmList);
		broker.submitCloudletList(cloudletList);

		CloudSim.terminateSimulation(Constants.SIMULATION_LIMIT);
		double lastClock = CloudSim.startSimulation();

		List<Cloudlet> newList = broker.getCloudletReceivedList();
		Log.printLine("Received " + newList.size() + " cloudlets");

		CloudSim.stopSimulation();

		Helper.printResults(datacenter, vmList, lastClock, experimentName,
				Constants.OUTPUT_CSV, outputFolder);

	} catch (Exception e) {
		e.printStackTrace();
		Log.printLine("The simulation has been terminated due to an unexpected error");
		System.exit(0);
	}

	Log.printLine("Finished " + experimentName);
}
 
开发者ID:demiaowu,项目名称:annotation-of-cloudsim3.0.3,代码行数:46,代码来源:RunnerAbstract.java


示例6: start

import org.cloudbus.cloudsim.VmAllocationPolicy; //导入依赖的package包/类
/**
 * Starts the simulation.
 * 
 * @param experimentName the experiment name
 * @param outputFolder the output folder
 * @param vmAllocationPolicy the vm allocation policy
 */
protected void start(String experimentName, String outputFolder, VmAllocationPolicy vmAllocationPolicy) {
	System.out.println("Starting " + experimentName);

	try {
		PowerDatacenter datacenter = (PowerDatacenter) Helper.createDatacenter(
				"Datacenter",
				PowerDatacenter.class,
				hostList,
				vmAllocationPolicy);

		datacenter.setDisableMigrations(false);

		broker.submitVmList(vmList);
		broker.submitCloudletList(cloudletList);

		CloudSim.terminateSimulation(Constants.SIMULATION_LIMIT);
		double lastClock = CloudSim.startSimulation();

		List<Cloudlet> newList = broker.getCloudletReceivedList();
		Log.printLine("Received " + newList.size() + " cloudlets");

		CloudSim.stopSimulation();

		Helper.printResults(
				datacenter,
				vmList,
				lastClock,
				experimentName,
				Constants.OUTPUT_CSV,
				outputFolder);

	} catch (Exception e) {
		e.printStackTrace();
		Log.printLine("The simulation has been terminated due to an unexpected error");
		System.exit(0);
	}

	Log.printLine("Finished " + experimentName);
}
 
开发者ID:tuwiendsg,项目名称:CAPT,代码行数:47,代码来源:RunnerAbstract.java


示例7: WorkflowDatacenter

import org.cloudbus.cloudsim.VmAllocationPolicy; //导入依赖的package包/类
public WorkflowDatacenter(String name,
        DatacenterCharacteristics characteristics,
        VmAllocationPolicy vmAllocationPolicy,
        List<Storage> storageList,
        double schedulingInterval) throws Exception {
    super(name, characteristics, vmAllocationPolicy, storageList, schedulingInterval);
}
 
开发者ID:WorkflowSim,项目名称:WorkflowSim-1.0,代码行数:8,代码来源:WorkflowDatacenter.java


示例8: PowerDatacenterExtra

import org.cloudbus.cloudsim.VmAllocationPolicy; //导入依赖的package包/类
public PowerDatacenterExtra(String name,
		DatacenterCharacteristics characteristics,
		VmAllocationPolicy vmAllocationPolicy, List<Storage> storageList,
		double schedulingInterval) throws Exception {
	super(name, characteristics, vmAllocationPolicy, storageList,
			schedulingInterval);
}
 
开发者ID:StVak,项目名称:cloudsimPowerStats,代码行数:8,代码来源:PowerDatacenterExtra.java


示例9: getVmAllocationPolicy

import org.cloudbus.cloudsim.VmAllocationPolicy; //导入依赖的package包/类
@Override
public VmAllocationPolicy getVmAllocationPolicy(List<? extends Host> hostList, int dataCenterIndex) {
	return new VmAllocationPolicy_Custom(hostList,dataCenterIndex);
}
 
开发者ID:CagataySonmez,项目名称:EdgeCloudSim,代码行数:5,代码来源:SampleScenarioFactory.java


示例10: SDNDatacenter

import org.cloudbus.cloudsim.VmAllocationPolicy; //导入依赖的package包/类
public SDNDatacenter(String name, DatacenterCharacteristics characteristics, VmAllocationPolicy vmAllocationPolicy, List<Storage> storageList, double schedulingInterval, NetworkOperatingSystem nos) throws Exception {
	super(name, characteristics, vmAllocationPolicy, storageList, schedulingInterval);
	
	this.nos=nos;
	//nos.init();
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:7,代码来源:SDNDatacenter.java


示例11: FogDevice

import org.cloudbus.cloudsim.VmAllocationPolicy; //导入依赖的package包/类
public FogDevice(
		String name, 
		FogDeviceCharacteristics characteristics,
		VmAllocationPolicy vmAllocationPolicy,
		List<Storage> storageList,
		double schedulingInterval,
		double uplinkBandwidth, double downlinkBandwidth, double uplinkLatency, double ratePerMips) throws Exception {
	super(name, characteristics, vmAllocationPolicy, storageList, schedulingInterval);
	setCharacteristics(characteristics);
	setVmAllocationPolicy(vmAllocationPolicy);
	setLastProcessTime(0.0);
	setStorageList(storageList);
	setVmList(new ArrayList<Vm>());
	setSchedulingInterval(schedulingInterval);
	setUplinkBandwidth(uplinkBandwidth);
	setDownlinkBandwidth(downlinkBandwidth);
	setUplinkLatency(uplinkLatency);
	setRatePerMips(ratePerMips);
	setAssociatedActuatorIds(new ArrayList<Pair<Integer, Double>>());
	for (Host host : getCharacteristics().getHostList()) {
		host.setDatacenter(this);
	}
	setActiveApplications(new ArrayList<String>());
	// If this resource doesn't have any PEs then no useful at all
	if (getCharacteristics().getNumberOfPes() == 0) {
		throw new Exception(super.getName()
				+ " : Error - this entity has no PEs. Therefore, can't process any Cloudlets.");
	}
	// stores id of this class
	getCharacteristics().setId(super.getId());
	
	applicationMap = new HashMap<String, Application>();
	appToModulesMap = new HashMap<String, List<String>>();
	northTupleQueue = new LinkedList<Tuple>();
	southTupleQueue = new LinkedList<Pair<Tuple, Integer>>();
	setNorthLinkBusy(false);
	setSouthLinkBusy(false);
	
	
	setChildrenIds(new ArrayList<Integer>());
	setChildToOperatorsMap(new HashMap<Integer, List<String>>());
	
	this.cloudTrafficMap = new HashMap<Integer, Integer>();
	
	this.lockTime = 0;
	
	this.energyConsumption = 0;
	this.lastUtilization = 0;
	setTotalCost(0);
	setModuleInstanceCount(new HashMap<String, Map<String, Integer>>());
	setChildToLatencyMap(new HashMap<Integer, Double>());
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:53,代码来源:FogDevice.java


示例12: PSDatacenter

import org.cloudbus.cloudsim.VmAllocationPolicy; //导入依赖的package包/类
public PSDatacenter(String name, DatacenterCharacteristics characteristics, VmAllocationPolicy vmAllocationPolicy,
		List<Storage> storageList, double schedulingInterval) throws Exception {
	super(name, characteristics, vmAllocationPolicy, storageList, schedulingInterval);
}
 
开发者ID:raphaeldeaquino,项目名称:mcloudsim,代码行数:5,代码来源:PSDatacenter.java


示例13: start

import org.cloudbus.cloudsim.VmAllocationPolicy; //导入依赖的package包/类
/**
 * Starts the simulation.
 * 
 * @param experimentName the experiment name
 * @param outputFolder the output folder
 * @param vmAllocationPolicy the vm allocation policy
 */
protected void start(String experimentName, String outputFolder, VmAllocationPolicy vmAllocationPolicy) {
	System.out.println("Starting " + experimentName);

	try {
		PowerDatacenter datacenter = (PowerDatacenter) Helper.createDatacenter(
				"Datacenter",
				PowerDatacenter.class,
				hostList,
				vmAllocationPolicy);

		datacenter.setDisableMigrations(false);

		broker.submitVmList(vmList);
		broker.submitCloudletList(cloudletList);

		CloudSim.terminateSimulation(Constants.SIMULATION_LIMIT);
		
		//Start Simulation
		
		double lastClock = CloudSim.startSimulation();

		//Simulation Completed!
		
		List<Cloudlet> newList = broker.getCloudletReceivedList();
		Log.printLine("Received " + newList.size() + " cloudlets");

		CloudSim.stopSimulation();

		Helper.printResults(
				datacenter,
				vmList,
				lastClock,
				experimentName,
				Constants.OUTPUT_CSV,
				outputFolder);

	} catch (Exception e) {
		e.printStackTrace();
		Log.printLine("The simulation has been terminated due to an unexpected error");
		System.exit(0);
	}

	Log.printLine("Finished " + experimentName);
}
 
开发者ID:Udacity2048,项目名称:CloudSimDisk,代码行数:52,代码来源:RunnerAbstract.java


示例14: createDatacenter

import org.cloudbus.cloudsim.VmAllocationPolicy; //导入依赖的package包/类
/**
 * Creates the datacenter.
 * 
 * @param name the name
 * @param datacenterClass the datacenter class
 * @param hostList the host list
 * @param vmAllocationPolicy the vm allocation policy
 * @param simulationLength
 * 
 * @return the power datacenter
 * 
 * @throws Exception the exception
 */
public static Datacenter createDatacenter(
		String name,
		Class<? extends Datacenter> datacenterClass,
		List<PowerHost> hostList,
		VmAllocationPolicy vmAllocationPolicy) throws Exception {
	String arch = "x86"; // system architecture
	String os = "Linux"; // operating system
	String vmm = "Xen";
	double time_zone = 10.0; // time zone this resource located
	double cost = 3.0; // the cost of using processing in this resource
	double costPerMem = 0.05; // the cost of using memory in this resource
	double costPerStorage = 0.001; // the cost of using storage in this resource
	double costPerBw = 0.0; // the cost of using bw in this resource

	DatacenterCharacteristics characteristics = new DatacenterCharacteristics(
			arch,
			os,
			vmm,
			hostList,
			time_zone,
			cost,
			costPerMem,
			costPerStorage,
			costPerBw);

	Datacenter datacenter = null;
	try {
		datacenter = datacenterClass.getConstructor(
				String.class,
				DatacenterCharacteristics.class,
				VmAllocationPolicy.class,
				List.class,
				Double.TYPE).newInstance(
				name,
				characteristics,
				vmAllocationPolicy,
				new LinkedList<Storage>(),
				Constants.SCHEDULING_INTERVAL);
	} catch (Exception e) {
		e.printStackTrace();
		System.exit(0);
	}

	return datacenter;
}
 
开发者ID:Udacity2048,项目名称:CloudSimDisk,代码行数:59,代码来源:Helper.java


示例15: create

import org.cloudbus.cloudsim.VmAllocationPolicy; //导入依赖的package包/类
public VmAllocationPolicy create(List<? extends Host> list,
HostSelectionPolicy hostSelectionPolicy,
VmMigrationPolicy vmMigrationPolicy
);
 
开发者ID:jayjmin,项目名称:cloudsimsdn,代码行数:5,代码来源:SDNExampleOverbooking.java


示例16: createSDNDatacenter

import org.cloudbus.cloudsim.VmAllocationPolicy; //导入依赖的package包/类
protected static SDNDatacenter createSDNDatacenter(String name, 
		String physicalTopology, 
		NetworkOperatingSystem snos, 
		VmAllocationPolicyFactory vmAllocationFactory,
		HostSelectionPolicy hostSelectionPolicy,
		VmMigrationPolicy vmMigrationPolicy) {
	// In order to get Host information, pre-create NOS.
	nos=snos;
	List<Host> hostList = nos.getHostList();
	
	String arch = "x86"; // system architecture
	String os = "Linux"; // operating system
	String vmm = "Xen";
	
	double time_zone = 10.0; // time zone this resource located
	double cost = 3.0; // the cost of using processing in this resource
	double costPerMem = 0.05; // the cost of using memory in this resource
	double costPerStorage = 0.001; // the cost of using storage in this
									// resource
	double costPerBw = 0.0; // the cost of using bw in this resource
	LinkedList<Storage> storageList = new LinkedList<Storage>(); // we are not adding SAN
												// devices by now

	DatacenterCharacteristics characteristics = new DatacenterCharacteristics(
			arch, os, vmm, hostList, time_zone, cost, costPerMem,
			costPerStorage, costPerBw);

	// Create Datacenter with previously set parameters
	SDNDatacenter datacenter = null;
	try {
		VmAllocationPolicy vmPolicy = vmAllocationFactory.create(hostList, hostSelectionPolicy, vmMigrationPolicy);
		maxHostHandler = (PowerUtilizationMaxHostInterface)vmPolicy;
		datacenter = new SDNDatacenter(name, characteristics, vmPolicy, storageList, 0, nos);
		
		
		nos.setDatacenter(datacenter);
	} catch (Exception e) {
		e.printStackTrace();
	}
	
	return datacenter;
}
 
开发者ID:jayjmin,项目名称:cloudsimsdn,代码行数:43,代码来源:SDNExampleOverbooking.java


示例17: FederationDatacenter

import org.cloudbus.cloudsim.VmAllocationPolicy; //导入依赖的package包/类
public FederationDatacenter(String name, DatacenterCharacteristics characteristics, 
		VmAllocationPolicy vmAllocationPolicy, List<Storage> storageList, double schedulingInterval)
		throws Exception 
{
	super(name, characteristics, vmAllocationPolicy, storageList, schedulingInterval);
}
 
开发者ID:ecarlini,项目名称:smartfed,代码行数:7,代码来源:FederationDatacenter.java


示例18: NetworkDatacenter

import org.cloudbus.cloudsim.VmAllocationPolicy; //导入依赖的package包/类
/**
 * Allocates a new NetworkDatacenter object.
 * 
 * @param name the name to be associated with this entity (as required by Sim_entity class from
 *        simjava package)
 * @param characteristics an object of DatacenterCharacteristics
 * @param storageList a LinkedList of storage elements, for data simulation
 * @param vmAllocationPolicy the vmAllocationPolicy
 * 
 * @throws Exception This happens when one of the following scenarios occur:
 *         <ul>
 *         <li>creating this entity before initializing CloudSim package
 *         <li>this entity name is <tt>null</tt> or empty
 *         <li>this entity has <tt>zero</tt> number of PEs (Processing Elements). <br>
 *         No PEs mean the Cloudlets can't be processed. A CloudResource must contain one or
 *         more Machines. A Machine must contain one or more PEs.
 *         </ul>
 * 
 * @pre name != null
 * @pre resource != null
 * @post $none
 */
public NetworkDatacenter(
		String name,
		DatacenterCharacteristics characteristics,
		VmAllocationPolicy vmAllocationPolicy,
		List<Storage> storageList,
		double schedulingInterval) throws Exception {
	super(name, characteristics, vmAllocationPolicy, storageList, schedulingInterval);
	VmToSwitchid = new HashMap<Integer, Integer>();
	HostToSwitchid = new HashMap<Integer, Integer>();
	VmtoHostlist = new HashMap<Integer, Integer>();
	Switchlist = new HashMap<Integer, Switch>();
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:35,代码来源:NetworkDatacenter.java


示例19: PowerDatacenterNonPowerAware

import org.cloudbus.cloudsim.VmAllocationPolicy; //导入依赖的package包/类
/**
 * Instantiates a new datacenter.
 * 
 * @param name the name
 * @param characteristics the res config
 * @param schedulingInterval the scheduling interval
 * @param utilizationBound the utilization bound
 * @param vmAllocationPolicy the vm provisioner
 * @param storageList the storage list
 * 
 * @throws Exception the exception
 */
public PowerDatacenterNonPowerAware(
		String name,
		DatacenterCharacteristics characteristics,
		VmAllocationPolicy vmAllocationPolicy,
		List<Storage> storageList,
		double schedulingInterval) throws Exception {
	super(name, characteristics, vmAllocationPolicy, storageList, schedulingInterval);
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:21,代码来源:PowerDatacenterNonPowerAware.java


示例20: MyPowerDatacenter

import org.cloudbus.cloudsim.VmAllocationPolicy; //导入依赖的package包/类
/**
 * Creates a new datacenter.
 * 
 * @param name
 *            the name
 * @param characteristics
 *            the res configurations
 * @param schedulingInterval
 *            the scheduling interval
 * @param vmAllocationPolicy
 *            the vm provisioner
 * @param storageList
 *            the storage list
 * @throws Exception
 *             the exception
 */
public MyPowerDatacenter(String name, DatacenterCharacteristics characteristics,
		VmAllocationPolicy vmAllocationPolicy, List<MyPowerHarddriveStorage> storageList, double schedulingInterval)
		throws Exception {
	super(name, characteristics, vmAllocationPolicy, storageList, schedulingInterval);

	// sets initial variables
	setTotalDatacenterEnergy(0.0);
	setTotalStorageEnergy(0.0);
}
 
开发者ID:Udacity2048,项目名称:CloudSimDisk,代码行数:26,代码来源:MyPowerDatacenter.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java NameComponent类代码示例发布时间:2022-05-21
下一篇:
Java IdleConnectionTimeoutThread类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap