Interface CloudletTaskScheduler
- All Known Implementing Classes:
CloudletTaskSchedulerSimple
public interface CloudletTaskScheduler
Provides the features to enable a CloudletScheduler to
process internal CloudletTasks such as:
- processing of
CloudletExecutionTasks; - sending
VmPackets from theVmof the scheduler to other ones; - or receiving
VmPackets sent from other VMs to thatVm.
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. 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, no matter what kind of scheduler it is.
- Since:
- CloudSim Plus 1.0
- Author:
- Saurabh Kumar Garg, Manoel Campos da Silva Filho
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CloudletTaskSchedulerAn attribute that implements the Null Object Design Pattern forCloudletTaskSchedulerobjects. -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds a packet to the list of packets sent by a given VM, targeting the VM of this scheduler.voidClears the list ofVmPacket's to send from the Vm of this scheduler to other VMs.getVm()booleanisTimeToUpdateCloudletProcessing(Cloudlet cloudlet) Checks if it's time to update the execution of a given Cloudlet.voidprocessCloudletTasks(Cloudlet cloudlet, long partialFinishedMI) Process Cloudlet's tasks, such as tasks to send packets from or received by a Cloudlet inside a VM.Sets the Vm that the CloudletTaskScheduler will receive packets from or send packets to.
-
Field Details
-
NULL
An attribute that implements the Null Object Design Pattern forCloudletTaskSchedulerobjects.
-
-
Method Details
-
getVm
Vm getVm()- Returns:
- the Vm that the CloudletTaskScheduler will receive packets from or send packets to.
-
setVm
Sets the Vm that the CloudletTaskScheduler will receive packets from or send packets to. It is not required to manually set a Vm for the CloudletTaskScheduler, since theNetworkHostdoes 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
-
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.
-