欢迎来到天天文库
浏览记录
ID:1534992
大小:93.00 KB
页数:11页
时间:2017-11-12
《cloudsim源代码学习之vm》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、packageorg.cloudbus.cloudsim;importjava.util.ArrayList;//Thisclassprovidesmethodstomanipulatethesizeofthearraythatisusedinternallytostorethelist.importjava.util.List;/**【虚拟机】*VmrepresentsaVM:【itrunsinsideaHost,sharinghostList*withotherVMs.Itprocessescloudlets.】Thisprocessingh
2、appensaccording*toapolicy,definedbytheCloudletScheduler.EachVMhasaowner(每个虚拟机有一个所有者),whichcan*submitcloudletstotheVMtobeexecuted**@authorRodrigoN.Calheiros*@authorAntonBeloglazov*@sinceCloudSimToolkit1.0*/publicclassVm{/**Theid.ID号*/privateintid;/**Theuserid.用户编号*/privateintu
3、serId;privateStringuid;/**Thesize.大小*/privatelongsize;/**TheMIPS.处理速度MIPS*/privatedoublemips;/**ThePEsnumber.PE数*/privateintpesNumber;/**Theram.内存*/privateintram;/**Thebw.带宽*/privatelongbw;/**Thevmm.虚拟机管理程序*/privateStringvmm;/**TheCloudletscheduler.云任务调度程序*/privateCloudletSch
4、edulercloudletScheduler;/**Thehost.主机*/privateHosthost;/**Inmigrationflag.迁移标志*/privatebooleaninMigration;/**Thecurrentallocatedsize.当前分配大小*/privatelongcurrentAllocatedSize;/**Thecurrentallocatedram.当前分配内存*/privateintcurrentAllocatedRam;/**Thecurrentallocatedbw.当前分配带宽*/privat
5、elongcurrentAllocatedBw;/**Thecurrentallocatedmips.当前分配mips*/privateListcurrentAllocatedMips;/**Therecentlycreated.最近创建*/privatebooleanrecentlyCreated;/**【虚拟机特征对象】*CreatesanewVMCharacteristicsobject.**@paramiduniqueIDoftheVM*@paramuserIdIDoftheVM'sowner*@paramsizeamou
6、ntofstorage*@paramramamountofram*@parambwamountofbandwidth*@parampesNumberamountofCPUsCPU总和*@paramvmmvirtualmachinemonitor虚拟机监控器*@paramcloudletSchedulercloudletSchedulerpolicyforcloudlets云任务调度协议*@paramprioritythepriority优先权*@parammipsthemips**@preid>=0*@preuserId>=0*@presize>
7、0*@preram>0*@prebw>0*@precpus>0*@prepriority>=0*@precloudletScheduler!=null*@post$none*/publicVm(intid,intuserId,doublemips,intpesNumber,intram,longbw,longsize,Stringvmm,CloudletSchedulercloudletScheduler){setId(id);setUserId(userId);setUid(getUid(userId,id));setMips(mips);se
8、tPesNumber(pesNumber);setRam(ram);setBw(bw);setSize(size);setVmm(vmm
此文档下载收益归作者所有