Interface CloudletTaskScheduler
-
- All Known Implementing Classes:
CloudletTaskSchedulerSimple
public interface CloudletTaskScheduler
Provides the features to enable aCloudletScheduler
to process internalCloudletTask
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 aNetworkCloudlet
.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
andNetworkCloudlet
, theNetworkHost
will automatically create instances of the current interface and attach each one to theCloudletScheduler
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
Fields Modifier and Type Field Description static CloudletTaskScheduler
NULL
An attribute that implements the Null Object Design Pattern forCloudletTaskScheduler
objects.
-
Method Summary
Modifier and Type Method Description boolean
addPacketToListOfPacketsSentFromVm(VmPacket pkt)
Adds a packet to the list of packets sent by a given VM, targeting the VM of this scheduler.void
clearVmPacketsToSend()
Clears the list ofVmPacket
's to send from the Vm of this scheduler to other VMs.Vm
getVm()
Gets the Vm that the CloudletTaskScheduler will sent packets from or receive packets to.java.util.List<VmPacket>
getVmPacketsToSend()
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
setVm(Vm vm)
Sets the Vm that the CloudletTaskScheduler will sent packets from or receive packets to.
-
-
-
Field Detail
-
NULL
static final CloudletTaskScheduler NULL
An attribute that implements the Null Object Design Pattern forCloudletTaskScheduler
objects.
-
-
Method Detail
-
getVm
Vm getVm()
Gets the Vm that the CloudletTaskScheduler will sent packets from or receive packets to.- Returns:
-
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 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
java.util.List<VmPacket> 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
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
-
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 packetspartialFinishedMI
- the partial executed length of this Cloudlet (in MI)
-
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.
-
-