How to allocate a task group to a single VM

  • ** Get the Cloudlets created list
    int csize=getCloudletList().size();
    for (int i=0;i<csize;++i) {
    **with total number of created cloudlets, group the tasks with length similarity or with any other idea, add them in a list and add in this array.
    taskList[i]=each group/list of tasks/cloudlet
    }
    ** Let “vi” be the single VM in which the task group is going to be assigned.
    for(int k=0;k<taskList[i].size();k++){
    Cloudlet cl=(Cloudlet)taskList[i].get(k);
    Log.printLine(CloudSim.clock()+": "+getName()+": Sending cloudlet "
    +cl.getCloudletId()+" to VM #"+vi.getId());
    cl.setVmId(vi.getId());
    sendNow(getVmsToDatacentersMap().get(vi.getId()), CloudSimTags.CLOUDLET_SUBMIT,cl);
    cloudletsSubmitted++;
    getCloudletSubmittedList().add(cl);
    }