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


Java CloudletSchedulerTimeShared类代码示例

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


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

示例1: createVM

import org.cloudbus.cloudsim.CloudletSchedulerTimeShared; //导入依赖的package包/类
private static List<Vm> createVM(int userId, int vms) {

		//Creates a container to store VMs. This list is passed to the broker later
		LinkedList<Vm> list = new LinkedList<Vm>();

		//VM Parameters
		long size = 10000; //image size (MB)
		int ram = 512; //vm memory (MB)
		int mips = 1000;
		long bw = 1000;
		int pesNumber = 1; //number of cpus
		String vmm = "Xen"; //VMM name

		//create VMs
		Vm[] vm = new Vm[vms];

		for(int i=0;i<vms;i++){
			vm[i] = new Vm(i, userId, mips, pesNumber, ram, bw, size, vmm, new CloudletSchedulerTimeShared());
			//for creating a VM with a space shared scheduling policy for cloudlets:
			//vm[i] = Vm(i, userId, mips, pesNumber, ram, bw, size, priority, vmm, new CloudletSchedulerSpaceShared());

			list.add(vm[i]);
		}

		return list;
	}
 
开发者ID:Udacity2048,项目名称:CloudSimDisk,代码行数:27,代码来源:CloudSimExample6.java

示例2: createVM

import org.cloudbus.cloudsim.CloudletSchedulerTimeShared; //导入依赖的package包/类
private static List<Vm> createVM(int userId, int vms, int idShift) {
	//Creates a container to store VMs. This list is passed to the broker later
	LinkedList<Vm> list = new LinkedList<Vm>();

	//VM Parameters
	long size = 10000; //image size (MB)
	int ram = 512; //vm memory (MB)
	int mips = 250;
	long bw = 1000;
	int pesNumber = 1; //number of cpus
	String vmm = "Xen"; //VMM name

	//create VMs
	Vm[] vm = new Vm[vms];

	for(int i=0;i<vms;i++){
		vm[i] = new Vm(idShift + i, userId, mips, pesNumber, ram, bw, size, vmm, new CloudletSchedulerTimeShared());
		list.add(vm[i]);
	}

	return list;
}
 
开发者ID:Udacity2048,项目名称:CloudSimDisk,代码行数:23,代码来源:CloudSimExample7.java

示例3: createVM

import org.cloudbus.cloudsim.CloudletSchedulerTimeShared; //导入依赖的package包/类
private static List<Vm> createVM(int userId, int vms, int idShift) {
	// Creates a container to store VMs. This list is passed to the broker later
	LinkedList<Vm> list = new LinkedList<Vm>();
	
	// VM Parameters
	long size = 10000; // image size (MB)
	int ram = 512; // vm memory (MB)
	int mips = 250;
	long bw = 1000;
	int pesNumber = 1; // number of cpus
	String vmm = "Xen"; // VMM name
	
	// create VMs
	Vm[] vm = new Vm[vms];
	
	for (int i = 0; i < vms; i++) {
		vm[i] = new Vm(idShift + i, userId, mips, pesNumber, ram, bw, size, vmm,
				new CloudletSchedulerTimeShared());
		list.add(vm[i]);
	}
	
	return list;
}
 
开发者ID:Udacity2048,项目名称:CloudSimDisk,代码行数:24,代码来源:CloudSimExample8.java

示例4: createVM

import org.cloudbus.cloudsim.CloudletSchedulerTimeShared; //导入依赖的package包/类
private static List<Vm> createVM(int userId, int vms, int idShift) {
	//Creates a container to store VMs. This list is passed to the broker later
	LinkedList<Vm> list = new LinkedList<Vm>();

	//VM Parameters
	long size = 10000; //image size (MB)
	int ram = 512; //vm memory (MB)
	int mips = 250;
	long bw = 1000;
	int pesNumber = 1; //number of cpus
	String vmm = "Xen"; //VMM name

	//create VMs
	Vm[] vm = new Vm[vms];

	for(int i=0;i < vms;i++){
		vm[i] = new Vm(idShift + i, userId, mips, pesNumber, ram, bw, size, vmm, new CloudletSchedulerTimeShared());
		list.add(vm[i]);
	}

	return list;
}
 
开发者ID:hewolf,项目名称:VirtualMachinePlacement,代码行数:23,代码来源:CloudSimExample9.java

示例5: createVmList

import org.cloudbus.cloudsim.CloudletSchedulerTimeShared; //导入依赖的package包/类
public void createVmList(int brockerId){
	int hostCounter=0;
	int vmCounter=0;
	
	//Create VMs for each hosts
	Document doc = SimSettings.getInstance().getEdgeDevicesDocument();
	NodeList datacenterList = doc.getElementsByTagName("datacenter");
	for (int i = 0; i < datacenterList.getLength(); i++) {
		Node datacenterNode = datacenterList.item(i);
		Element datacenterElement = (Element) datacenterNode;
		NodeList hostNodeList = datacenterElement.getElementsByTagName("host");
		for (int j = 0; j < hostNodeList.getLength(); j++) {
			
			vmList.add(hostCounter, new ArrayList<EdgeVM>());
			
			Node hostNode = hostNodeList.item(j);
			Element hostElement = (Element) hostNode;
			NodeList vmNodeList = hostElement.getElementsByTagName("VM");
			for (int k = 0; k < vmNodeList.getLength(); k++) {
				Node vmNode = vmNodeList.item(k);					
				Element vmElement = (Element) vmNode;

				String vmm = vmElement.getAttribute("vmm");
				int numOfCores = Integer.parseInt(vmElement.getElementsByTagName("core").item(0).getTextContent());
				double mips = Double.parseDouble(vmElement.getElementsByTagName("mips").item(0).getTextContent());
				int ram = Integer.parseInt(vmElement.getElementsByTagName("ram").item(0).getTextContent());
				long storage = Long.parseLong(vmElement.getElementsByTagName("storage").item(0).getTextContent());
				long bandwidth = SimSettings.getInstance().getWlanBandwidth() / (hostNodeList.getLength()+vmNodeList.getLength());
				
				//VM Parameters		
				EdgeVM vm = new EdgeVM(vmCounter, brockerId, mips, numOfCores, ram, bandwidth, storage, vmm, new CloudletSchedulerTimeShared());
				vm.setVmType(SimSettings.VM_TYPES.EDGE_VM);
				vmList.get(hostCounter).add(vm);
				vmCounter++;
			}

			hostCounter++;
		}
	}
}
 
开发者ID:CagataySonmez,项目名称:EdgeCloudSim,代码行数:41,代码来源:EdgeServerManager.java

示例6: createVM

import org.cloudbus.cloudsim.CloudletSchedulerTimeShared; //导入依赖的package包/类
private static List<Vm> createVM(int userId, int vms) {

		//Creates a container to store VMs. This list is passed to the broker later
		LinkedList<Vm> list = new LinkedList<Vm>();

		//VM Parameters
		long size = 10000; //image size (MB)
		int ram = 512; //vm memory (MB)
		int mips = 1000;
		long bw = 1000;
		int pesNumber = 1; //number of cpus
		String vmm = "Xen"; //VMM name
		Random r = new Random(1);
		//create VMs
		Vm[] vm = new Vm[vms];

		for(int i=0;i<vms;i++){
			mips = 500 + r.nextInt(500);
			vm[i] = new Vm(i, userId, mips, pesNumber, ram, bw, size, vmm, new CloudletSchedulerTimeShared());
			//for creating a VM with a space shared scheduling policy for cloudlets:
			//vm[i] = Vm(i, userId, mips, pesNumber, ram, bw, size, priority, vmm, new CloudletSchedulerSpaceShared());

			list.add(vm[i]);
		}

		return list;
	}
 
开发者ID:sidjee,项目名称:Ant-Colony-Optimization-Framework,代码行数:28,代码来源:graphImplement.java

示例7: createSmall

import org.cloudbus.cloudsim.CloudletSchedulerTimeShared; //导入依赖的package包/类
private static Vm createSmall(int userId)
{		
	Vm vm = new Vm(ResourceCounter.nextVmID(), 
			userId, 
			6502.18, 
			1, 
			new Double(1.7 * 1024 ).intValue(), // RAM: 1.7 GB
			new Long(1 * 1024 * 1024), // i assume at least 1MB p/s  
			new Long(160 * 1024), // DISK: 160 GB
			"Xen", 
			new CloudletSchedulerTimeShared());
	VmTyped vmt = new VmTyped(vm, VmType.SMALL);
	return vm;
}
 
开发者ID:ecarlini,项目名称:smartfed,代码行数:15,代码来源:VmFactory.java

示例8: createMedium

import org.cloudbus.cloudsim.CloudletSchedulerTimeShared; //导入依赖的package包/类
private static Vm createMedium(int userId)
{		
	Vm vm = new Vm(ResourceCounter.nextVmID(), 
			userId, 
			6502.18, // data not available, i assume as small instances
			1, 
			new Double(3.75 * 1024).intValue(), // 3.75 GB
			new Long(1 * 1024 * 1024), // i assume at least 1MB p/s  
			new Long(410 * 1024), // 410 GB
			"Xen", 
			new CloudletSchedulerTimeShared());
	VmTyped vmt = new VmTyped(vm, VmType.MEDIUM);
	return vm;
}
 
开发者ID:ecarlini,项目名称:smartfed,代码行数:15,代码来源:VmFactory.java

示例9: createLarge

import org.cloudbus.cloudsim.CloudletSchedulerTimeShared; //导入依赖的package包/类
private static Vm createLarge(int userId)
{		
	Vm vm = new Vm(ResourceCounter.nextVmID(), 
			userId, 
			8022, 
			2, 
			new Double(7.5 * 1024).intValue(), // 7.5 GB
			new Long(1 * 1024 * 1024), // i assume at least 1MB p/s  
			new Long(850 * 1024), // 850 GB
			"Xen", 
			new CloudletSchedulerTimeShared());
	VmTyped vmt = new VmTyped(vm, VmType.LARGE);
	return vm;
}
 
开发者ID:ecarlini,项目名称:smartfed,代码行数:15,代码来源:VmFactory.java

示例10: createXLarge

import org.cloudbus.cloudsim.CloudletSchedulerTimeShared; //导入依赖的package包/类
private static Vm createXLarge(int userId)
{		
	Vm vm = new Vm(ResourceCounter.nextVmID(), 
			userId, 
			5202.15 * 4, 
			4, 
			new Double(15 * 1024).intValue(), // 15 GB
			new Long(1 * 1024 * 1024), // i assume at least 1MB p/s  
			new Long(1690 * 1024), // 1690 GB
			"Xen", 
			new CloudletSchedulerTimeShared());
	VmTyped vmt = new VmTyped(vm, VmType.XLARGE);
	return vm;
}
 
开发者ID:ecarlini,项目名称:smartfed,代码行数:15,代码来源:VmFactory.java

示例11: getCustomVm

import org.cloudbus.cloudsim.CloudletSchedulerTimeShared; //导入依赖的package包/类
public static Vm getCustomVm(int userId, double mips, int cores, int ramMB, long bandMB, long diskMB)
{		
	VmTyped vmt = new VmTyped(-1, 
			userId, 
			mips, 
			cores, 
			ramMB,
			bandMB,
			diskMB,
			"Xen", 
			new CloudletSchedulerTimeShared(), 
			VmType.CUSTOM);	
	return vmt;
}
 
开发者ID:ecarlini,项目名称:smartfed,代码行数:15,代码来源:VmFactory.java

示例12: getDesiredVm

import org.cloudbus.cloudsim.CloudletSchedulerTimeShared; //导入依赖的package包/类
/**
 * Create a customVm that will not be actually deployed, thus it will have meaningless value as internal id. 
 * @param userId
 * @param mips
 * @param cores
 * @param ramMB
 * @param bandMB
 * @param diskMB
 * @return
 */
public static Vm getDesiredVm(int userId, double mips, int cores, int ramMB, long bandMB, long diskMB){
	Vm vm = new Vm(-1, 
			userId, 
			mips, 
			cores, 
			ramMB,
			bandMB,
			diskMB,
			"Xen", 
			new CloudletSchedulerTimeShared());	
	VmTyped vmt = new VmTyped(vm, VmType.CUSTOM);
	return vmt;
}
 
开发者ID:ecarlini,项目名称:smartfed,代码行数:24,代码来源:VmFactory.java

示例13: addVMs

import org.cloudbus.cloudsim.CloudletSchedulerTimeShared; //导入依赖的package包/类
/**
 * Creates the virtual machines.
 * 
 * @param VMNr
 *            : the number of virtual machines to create brokerId: the id of
 *            the broker created timeSharedScheduling: to choose between the
 *            time shared or space shared shceduling algorithms
 * 
 * @return list of virtual machines
 * 
 */
private static void addVMs(int VMNr, int brokerId, boolean timeSharedScheduling, int mips) {

	// VM description
	//int mips = Processors.Intel.Pentium_4_Extreme_Edition.mips;
	//int mips = Processors.AMD.Athlon_FX_57.mips;
	long size = 10240; // image size (MB)
	int ram = 512; // vm memory (MB)
	long bw = 1024; // MB/s
	int pesNumber = 1; // number of cpus
	String vmm = "Xen"; // VMM name

	for (int i = 0; i < VMNr; i++) {

		Vm vm;
		
		int VM_ID = vmlist.size();
		
		if (timeSharedScheduling) {
			// create VM that uses time shared scheduling to schedule Cloudlets
			vm = new Vm(VM_ID, brokerId, mips, pesNumber, ram, bw, size, vmm,
					new CloudletSchedulerTimeShared());
		}

		else {
			// create VM that uses space shared scheduling to schedule Cloudlets
			vm = new Vm(VM_ID, brokerId, mips, pesNumber, ram, bw, size, vmm,
					new CloudletSchedulerSpaceShared());
		}

		// add the VM to the vmList
		vmlist.add(vm);
	}
}
 
开发者ID:halolimat,项目名称:clocacits,代码行数:45,代码来源:pso_example2.java

示例14: createVMs

import org.cloudbus.cloudsim.CloudletSchedulerTimeShared; //导入依赖的package包/类
/**
 * Creates the virtual machines.
 * 
 * @param
 * 			VMNr: the number of virtual machines to create
 * 			brokerId: the id of the broker created
 * 			timeSharedScheduling: to choose between the time shared or space shared shceduling algorithms
 *
 * @return list of virtual machines
 * 
 */	
private static List<Vm> createVMs(int VMNr, int brokerId, boolean timeSharedScheduling){
	
	/** The vmlist. */			
	List<Vm> vmlist = new ArrayList<Vm>();
	
	// VM description
	int mips = Processors.Intel.Pentium_4_Extreme_Edition.mips;
	long size = 10240; // image size (MB)
	int ram = 512; // vm memory (MB)
	long bw = 1024; // MB/s
	int pesNumber = 1; // number of cpus
	String vmm = "Xen"; // VMM name

	for(int i = 0 ; i < VMNr ; i++){
		
		Vm vm;
		
		if(timeSharedScheduling){
			//create VM that uses time shared scheduling to schedule Cloudlets
			vm = new Vm(i, brokerId, mips, pesNumber, ram, bw, size, vmm,	new CloudletSchedulerTimeShared());
		}
		
		else{
			//create VM that uses space shared scheduling to schedule Cloudlets
			vm = new Vm(i, brokerId, mips, pesNumber, ram, bw, size, vmm,	new CloudletSchedulerSpaceShared());
		}
		
		// add the VM to the vmList
		vmlist.add(vm);
	}
	
	return vmlist;
}
 
开发者ID:halolimat,项目名称:clocacits,代码行数:45,代码来源:pso_example3_avgExecTime.java

示例15: addVMs

import org.cloudbus.cloudsim.CloudletSchedulerTimeShared; //导入依赖的package包/类
private static void addVMs(int VMNr, int brokerId, boolean timeSharedScheduling, int mips) {

		mips = Processors.Intel.Pentium_4_Extreme_Edition.mips;
		//mips = Processors.AMD.Athlon_FX_57.mips;
		long size = 10000;
		int ram = 512;
		long bw = 1000;
		int pesNumber = 1;
		String vmm = "Xen";

		for (int i = 0; i < VMNr; i++) {

			Vm vm;
			
			int VM_ID = vmlist.size();
			
			if (timeSharedScheduling) {
				vm = new Vm(VM_ID, brokerId, mips, pesNumber, ram, bw, size, vmm,
						new CloudletSchedulerTimeShared());
			}

			else {
				vm = new Vm(VM_ID, brokerId, mips, pesNumber, ram, bw, size, vmm,
						new CloudletSchedulerSpaceShared());
			}

			vmlist.add(vm);
		}
	}
 
开发者ID:halolimat,项目名称:clocacits,代码行数:30,代码来源:pso_example1.java


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