Clouds Im Example 8

Share Embed Donate


Short Description

Cloud ex rep...

Description

Experiment 3.5 How to create simulation entities in run-time using a global manager entity package org.cloudbus.cloudsim.examples; import import import import import

java.text.DecimalFormat; java.util.ArrayList; java.util.Calendar; java.util.LinkedList; java.util.List;

import import import import import import import import import import import import import import import import import import import import

org.cloudbus.cloudsim.Cloudlet; org.cloudbus.cloudsim.CloudletSchedulerTimeShared; org.cloudbus.cloudsim.Datacenter; org.cloudbus.cloudsim.DatacenterBroker; org.cloudbus.cloudsim.DatacenterCharacteristics; org.cloudbus.cloudsim.Host; org.cloudbus.cloudsim.Log; org.cloudbus.cloudsim.Pe; org.cloudbus.cloudsim.Storage; org.cloudbus.cloudsim.UtilizationModel; org.cloudbus.cloudsim.UtilizationModelFull; org.cloudbus.cloudsim.Vm; org.cloudbus.cloudsim.VmAllocationPolicySimple; org.cloudbus.cloudsim.VmSchedulerTimeShared; org.cloudbus.cloudsim.core.CloudSim; org.cloudbus.cloudsim.core.SimEntity; org.cloudbus.cloudsim.core.SimEvent; org.cloudbus.cloudsim.provisioners.BwProvisionerSimple; org.cloudbus.cloudsim.provisioners.PeProvisionerSimple; org.cloudbus.cloudsim.provisioners.RamProvisionerSimple;

/** * An example showing how to create simulation entities * (a DatacenterBroker in this example) in run-time using * a globar manager entity (GlobalBroker). */ public class CloudSimExample8 { /** The cloudlet list. */ private static List cloudletList; /** The vmList. */ private static List vmList; private static List createVM(int userId, int vms, int idShift) { //Creates a container to store VMs. This list is passed

to the broker later LinkedList list = new LinkedList(); //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
View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF