欢迎来到天天文库
浏览记录
ID:37710148
大小:17.81 KB
页数:9页
时间:2019-05-29
《cloudsim 源代码》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、/**Title:CloudSimToolkit*Description:CloudSim(CloudSimulation)ToolkitforModelingandSimulation*ofClouds*Licence:GPL-http://www.gnu.org/copyleft/gpl.html**Copyright(c)2009,TheUniversityofMelbourne,Australia*/packageorg.cloudbus.cloudsim.examples;importjava.text.DecimalFormat;importjava.util.ArrayList
2、;importjava.util.Calendar;importjava.util.LinkedList;importjava.util.List;importorg.cloudbus.cloudsim.Cloudlet;importorg.cloudbus.cloudsim.CloudletSchedulerTimeShared;importorg.cloudbus.cloudsim.Datacenter;importorg.cloudbus.cloudsim.DatacenterBroker;importorg.cloudbus.cloudsim.DatacenterCharacteri
3、stics;importorg.cloudbus.cloudsim.Host;importorg.cloudbus.cloudsim.Log;importorg.cloudbus.cloudsim.Pe;importorg.cloudbus.cloudsim.Storage;importorg.cloudbus.cloudsim.UtilizationModel;importorg.cloudbus.cloudsim.UtilizationModelFull;importorg.cloudbus.cloudsim.Vm;importorg.cloudbus.cloudsim.VmAlloca
4、tionPolicySimple;importorg.cloudbus.cloudsim.VmSchedulerTimeShared;importorg.cloudbus.cloudsim.core.CloudSim;importorg.cloudbus.cloudsim.provisioners.BwProvisionerSimple;importorg.cloudbus.cloudsim.provisioners.PeProvisionerSimple;importorg.cloudbus.cloudsim.provisioners.RamProvisionerSimple;/***As
5、impleexampleshowinghowtocreate*adatacenterwithtwohostsandruntwo*cloudletsonit.Thecloudletsrunin*VMswithdifferentMIPSrequirements.*Thecloudletswilltakedifferenttime*tocompletetheexecutiondependingon*therequestedVMperformance.*/publicclassCloudSimExample3{/**Thecloudletlist.*/privatestaticList6、et>cloudletList;/**Thevmlist.*/privatestaticListvmlist;/***Createsmain()torunthisexample*/publicstaticvoidmain(String[]args){Log.printLine("StartingCloudSimExample3...");try{//Firststep:InitializetheCloudSimpackage.Itshouldbecalled//beforecreatinganyentities.intnum_user=1;//numberofcloudusersCa7、lendarcalendar=Calendar.getInstance();booleantrace_flag=false;//meantraceevents//InitializetheCloudSimlibraryCloudSim.init(num_user,calendar,trace_flag);//Secondstep:CreateDatacenters//Datacentersarethereso
6、et>cloudletList;/**Thevmlist.*/privatestaticListvmlist;/***Createsmain()torunthisexample*/publicstaticvoidmain(String[]args){Log.printLine("StartingCloudSimExample3...");try{//Firststep:InitializetheCloudSimpackage.Itshouldbecalled//beforecreatinganyentities.intnum_user=1;//numberofcloudusersCa
7、lendarcalendar=Calendar.getInstance();booleantrace_flag=false;//meantraceevents//InitializetheCloudSimlibraryCloudSim.init(num_user,calendar,trace_flag);//Secondstep:CreateDatacenters//Datacentersarethereso
此文档下载收益归作者所有