APPENDIX 1 SAMPLE CODING

207 APPENDIX 1 SAMPLE CODING A1.1 CLOUD OPTIMIZATION import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Calendar; import o...
2 downloads 0 Views 38KB Size
207

APPENDIX 1 SAMPLE CODING

A1.1 CLOUD OPTIMIZATION import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Calendar; import org.cloudbus.cloudsim.core.CloudSim; import org.cloudbus.cloudsim.core.SimEntity; import org.cloudbus.cloudsim.core.SimEvent; import org.cloudbus.cloudsim.provisioners.BwProvisionerSimple; import org.cloudbus.cloudsim.provisioners.PeProvisionerSimple; import org.cloudbus.cloudsim.provisioners.RamProvisionerSimple; public class HybridCloud { /** The cloudlet list. */ private static List Task; private static List cloudletList=new LinkedList(); private static List cloudletList1=new LinkedList(); private static List cloudletList2=new LinkedList(); public static List cl=new LinkedList(); public static int SmId,SmId1,SmId2,prid; public static Random r=new Random(); public static Vector grp,g; DatacenterBroker broker,broker1,broker2; private static List vmlist; /** The vmList. */ public static List vmList,vmList1,vmList2,prList; private static List createVM(int userId, int vms) { LinkedList list = new LinkedList(); int ra[]={512,256}; int mi[]={250,200,150}; int b[]={1000,900,800}; Random r=new Random(); long size = 10000; //image size (MB)

208 String vmm = "Xen"; //create VMs Vm[] vm = new Vm[vms]; for(int i=0;i