Interface CloudletTaskScheduler
- All Known Implementing Classes:
CloudletTaskSchedulerSimple
public interface CloudletTaskScheduler
Provides the features to enable a
CloudletScheduler
to
process internal CloudletTask
s such as:
- processing of
CloudletExecutionTask
s; - sending
VmPacket
s from theVm
of the scheduler to other ones; - or receiving
VmPacket
s sent from other VMs to thatVm
.
CloudletTask
s
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.
- Since:
- CloudSim Plus 1.0
- Author:
- Saurabh Kumar Garg, Manoel Campos da Silva Filho
-
Field Summary
Modifier and TypeFieldDescriptionstatic final CloudletTaskScheduler
An attribute that implements the Null Object Design Pattern forCloudletTaskScheduler
objects. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Adds a packet to the list of packets sent by a given VM, targeting the VM of this scheduler.void
Clears the list ofVmPacket
's to send from the Vm of this scheduler to other VMs.getVm()
Gets the Vm that the CloudletTaskScheduler will sent packets from or receive packets to.Gets a read-only list ofVmPacket
's to send from the Vm of this scheduler to other VMs.boolean
isTimeToUpdateCloudletProcessing
(Cloudlet cloudlet) Checks if it's time to update the execution of a given Cloudlet.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.void
Sets the Vm that the CloudletTaskScheduler will send packets from or receive packets to.
-
Field Details
-
NULL
An attribute that implements the Null Object Design Pattern forCloudletTaskScheduler
objects.
-
-
Method Details
-
getVm
Vm getVm()Gets the Vm that the CloudletTaskScheduler will sent packets from or receive packets to.- Returns:
-
setVm
Sets the Vm that the CloudletTaskScheduler will send packets from or receive packets to. It is not required to manually set a Vm for the CloudletTaskScheduler, since theNetworkHost
does it when it creates a Vm.- Parameters:
vm
- the Vm to set
-
clearVmPacketsToSend
void clearVmPacketsToSend()Clears the list ofVmPacket
's to send from the Vm of this scheduler to other VMs. -
getVmPacketsToSend
Gets a read-only list ofVmPacket
's to send from the Vm of this scheduler to other VMs.- Returns:
- a read-only
VmPacket
list
-
addPacketToListOfPacketsSentFromVm
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
-
processCloudletTasks
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 packetspartialFinishedMI
- the partial executed length of this Cloudlet (in MI)
-
isTimeToUpdateCloudletProcessing
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 it's time to update Cloudlet execution, false otherwise.
-