CloudletTaskScheduler

public interface CloudletTaskScheduler

Provides the features to enable a CloudletScheduler to process internal CloudletTasks such as:

The packet dispatching is performed by processing CloudletTasks inside a NetworkCloudlet.

A researcher creating its own simulations using CloudSim Plus usually doesn’t have to care about this class, since even creating network-enabled simulations using objects such as NetworkDatacenter, NetworkHost, NetworkVm and NetworkCloudlet, the NetworkHost will automatically create instances of the current interface and attach each one to the CloudletScheduler that every Vm is using, doesn’t matter what kind of scheduler it is.

Author:Saurabh Kumar Garg, Manoel Campos da Silva Filho

Fields

NULL

CloudletTaskScheduler NULL

An attribute that implements the Null Object Design Pattern for CloudletTaskScheduler objects.

Methods

addPacketToListOfPacketsSentFromVm

boolean addPacketToListOfPacketsSentFromVm(VmPacket pkt)

Adds a packet to the list of packets sent by a given VM, targeting the VM of this scheduler. The source VM is got from the packet.

Parameters:
  • pkt – packet to be added to the list
Returns:

true if the packet was added, false otherwise

clearVmPacketsToSend

void clearVmPacketsToSend()

Clears the list of VmPacket’s to send from the Vm of this scheduler to other VMs.

getVm

Vm getVm()

Gets the Vm that the CloudletTaskScheduler will sent packets from or receive packets to.

getVmPacketsToSend

List<VmPacket> getVmPacketsToSend()

Gets a read-only list of VmPacket’s to send from the Vm of this scheduler to other VMs.

Returns:a read-only VmPacket list

isTimeToUpdateCloudletProcessing

boolean isTimeToUpdateCloudletProcessing(Cloudlet cloudlet)

Checks if it’s time to update the execution of a given Cloudlet. If the Cloudlet is waiting for packets to be sent or received, then it isn’t time to update its processing.

Parameters:
  • cloudlet – the Cloudlet to check if it is time to update its execution
Returns:

true if its timie to update Cloudlet execution, false otherwise.

processCloudletTasks

void processCloudletTasks(Cloudlet cloudlet, long partialFinishedMI)

Process Cloudlet’s tasks, such as tasks to send packets from or received by a Cloudlet inside a VM.

Parameters:
  • cloudlet – the Cloudlet to process packets
  • partialFinishedMI – the partial executed length of this Cloudlet (in MI)

setVm

void setVm(Vm vm)

Sets the Vm that the CloudletTaskScheduler will sent packets from or receive packets to. It is not required to manually set a Vm for the CloudletTaskScheduler, since the NetworkHost does it when it creates a Vm.

Parameters:
  • vm – the Vm to set