可以设计什么样的标准来优先考虑cloudim中的cloudlet? [英] What kind of Criteria can be design to give priorties to cloudlet in cloudsim?

查看:97
本文介绍了可以设计什么样的标准来优先考虑cloudim中的cloudlet?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在cloudlet属性之间随机添加了布尔参数以提供优先选择,下面是该代码还能做什么?
可以在cloudlet属性中添加更多参数以赋予它们优先级。

I added randomly Boolean parameter among cloudlet attributes for giving preference below is the code what else can do? What parameters can be added more to cloudlet attributes for giving them priority.

    for(int i=0;i<cloudlets;i++){
        Random r= new Random(); // for creating random length
        Random priortyObj =new Random(); // for creating booleon priorty
        cloudlet[i] = new Cloudlet(priorty_cloudlet.priortyObj.nextInt(2),           
                      i, length +r.nextInt(2000),pesNumber,
                      fileSize, outputSize, utilizationModel,                                  
                      utilizationModel,  utilizationModel);
        // setting the owner of these Cloudlets
         cloudlet[i].setUserId(userId);`
         list.add(cloudlet[i]);
     }


推荐答案

优先级可以一分为二不同的方式:(i)我们可以优先考虑将Cloudlets提交给代理,以便将高优先级Cloudlets首先映射到VM,或者(ii)我们可以优先考虑在VM中执行Cloudlets。

Priority can be dealt in two different ways: (i) we could prioritize the submission of Cloudlets to a broker, so that high-priority Cloudlets will be mapped to a VM first, or (ii) we could prioritize the execution of Cloudlets inside a VM.

尽管CloudSim中的Cloudlet类具有 classType 属性,该属性旨在定义优先级,但此类属性并未在任何地方使用,因此您没有实现任何优先级。

Despite the Cloudlet class in CloudSim has a classType attribute that is intended to define priority, such an attribute is not used anywhere, so you don't have any kind of priority implemented.

如果需要定义Cloudlets的执行优先级,则可以检查 CloudSim Plus ,它是功能齐全,技术先进,经过全面重新设计并积极维护的CloudSim fork。它的 CloudletSimple 类具有一个 priority 属性,该属性实际上由 CloudletSchedulerCompletelyFair 。这样的调度程序是完全公平的Linux调度程序的实现,它考虑了运行Cloudlets的时间片/量子和Cloudlet的优先级。

If you need to define Cloudlets' execution priority, you can check CloudSim Plus, it's a full-featured, state-of-the-art, completely re-engineered and actively maintained CloudSim fork. Its CloudletSimple class has a priority attribute that is actually used by the CloudletSchedulerCompletelyFair. Such a scheduler is an implementation of the Completely Fair Linux Scheduler that considers a time slice/quantum to run Cloudlets and Cloudlet's priority.

以下是有关如何使用上述调度程序以及为Cloudlets设置优先级的示例代码:

Below is an sample snippet on how to use the mentioned scheduler and set priorities for Cloudlets:

vm.setCloudletScheduler(new CloudletSchedulerCompletelyFair());
for(int i=0; i < 10; i++){
    Cloudlet c = new CloudletSimple(CLOUDLET_LEN, CLOUDLET_PES);
    c.setPriority(i);  //you must define the priority in your own way
    cloudletList.add(c);
}

检查完整的 LinuxCompletelyFairSchedulerExample

这篇关于可以设计什么样的标准来优先考虑cloudim中的cloudlet?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆