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


Java CloudletSchedulerSpaceShared类代码示例

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


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

示例1: createVM

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

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

        //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
        CondorVM[] vm = new CondorVM[vms];

        for (int i = 0; i < vms; i++) {
            double ratio = 1.0;
            vm[i] = new CondorVM(i, userId, mips * ratio, pesNumber, ram, bw, size, vmm, new CloudletSchedulerSpaceShared());
            list.add(vm[i]);
        }

        return list;
    }
 
开发者ID:WorkflowSim,项目名称:WorkflowSim-1.0,代码行数:25,代码来源:WorkflowSimMultipleWorkflowsExample1.java

示例2: createVM

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

    //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
    CondorVM[] vm = new CondorVM[vms];
    for (int i = 0; i < vms; i++) {
        double ratio = 1.0;
        vm[i] = new CondorVM(i, userId, mips * ratio, pesNumber, ram, bw, size, vmm, new CloudletSchedulerSpaceShared());
        list.add(vm[i]);
    }
    return list;
}
 
开发者ID:WorkflowSim,项目名称:WorkflowSim-1.0,代码行数:22,代码来源:WorkflowSimBasicExample1.java

示例3: createVM

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

        //Creates a container to store VMs. This list is passed to the broker later
        LinkedList<CondorVM> list = new LinkedList<>();
        //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
        CondorVM[] vm = new CondorVM[vms];
        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.1;	// the cost of using storage in this resource
        double costPerBw = 0.1;			// the cost of using bw in this resource
        for (int i = 0; i < vms; i++) {
            double ratio = 1.0;
            vm[i] = new CondorVM(i, userId, mips * ratio, pesNumber, ram, bw, size, vmm,
                    cost, costPerMem, costPerStorage, costPerBw, new CloudletSchedulerSpaceShared());
            list.add(vm[i]);
        }
        return list;
    }
 
开发者ID:WorkflowSim,项目名称:WorkflowSim-1.0,代码行数:27,代码来源:WorkflowSimCostExample2.java

示例4: createVM

import org.cloudbus.cloudsim.CloudletSchedulerSpaceShared; //导入依赖的package包/类
protected static List<CondorVM> createVM(int userId, int vms, int vmIdBase) {

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

        //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
        CondorVM[] vm = new CondorVM[vms];
        for (int i = 0; i < vms; i++) {
            double ratio = 1.0;
            vm[i] = new CondorVM(vmIdBase + i, userId, mips * ratio, pesNumber, ram, bw, size, vmm, new CloudletSchedulerSpaceShared());
            list.add(vm[i]);
        }
        return list;
    }
 
开发者ID:WorkflowSim,项目名称:WorkflowSim-1.0,代码行数:23,代码来源:WorkflowSimMultipleClusterExample1.java

示例5: createVM

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

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

        //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
        CondorVM[] vm = new CondorVM[vms];
        Random bwRandom = new Random(System.currentTimeMillis());
        for (int i = 0; i < vms; i++) {
            double ratio = bwRandom.nextDouble();
            vm[i] = new CondorVM(i, userId, mips * ratio, pesNumber, ram, (long) (bw * ratio), size, vmm, new CloudletSchedulerSpaceShared());
            list.add(vm[i]);
        }
        return list;
    }
 
开发者ID:WorkflowSim,项目名称:WorkflowSim-1.0,代码行数:24,代码来源:HEFTPlanningAlgorithmExample1.java

示例6: addVMs

import org.cloudbus.cloudsim.CloudletSchedulerSpaceShared; //导入依赖的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

示例7: createVMs

import org.cloudbus.cloudsim.CloudletSchedulerSpaceShared; //导入依赖的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

示例8: addVMs

import org.cloudbus.cloudsim.CloudletSchedulerSpaceShared; //导入依赖的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.CloudletSchedulerSpaceShared类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。