Class CloudletSendTask
java.lang.Object
org.cloudbus.cloudsim.cloudlets.network.CloudletTask
org.cloudbus.cloudsim.cloudlets.network.CloudletSendTask
- All Implemented Interfaces:
Identifiable
public class CloudletSendTask extends CloudletTask
Represents a task executed by a
NetworkCloudlet
that sends data to a
CloudletReceiveTask
.
Please refer to following publication for more details:
- Since:
- CloudSim Toolkit 1.0
- Author:
- Saurabh Kumar Garg, Manoel Campos da Silva Filho
-
Constructor Summary
Constructors Constructor Description CloudletSendTask(int id)
Creates a new task. -
Method Summary
Modifier and Type Method Description VmPacket
addPacket(Cloudlet destinationCloudlet, long bytes)
Creates and adds a packet to the list of packets to be sent to aCloudlet
that is inside a specific VM.List<VmPacket>
getPacketsToSend()
List<VmPacket>
getPacketsToSend(double sendTime)
Gets the list of packets to send, updating the send time to the given time and clearing the list of packets, marking the task as finished.Methods inherited from class org.cloudbus.cloudsim.cloudlets.network.CloudletTask
getCloudlet, getExecutionTime, getFinishTime, getId, getMemory, getStartTime, isActive, isExecutionTask, isFinished, isReceiveTask, isSendTask, setCloudlet, setFinished, setId, setMemory, setStartTime
-
Constructor Details
-
CloudletSendTask
public CloudletSendTask(int id)Creates a new task.- Parameters:
id
- task id
-
-
Method Details
-
addPacket
Creates and adds a packet to the list of packets to be sent to aCloudlet
that is inside a specific VM.- Parameters:
destinationCloudlet
- destination cloudlet to send packets tobytes
- the number of data bytes of the packet to create- Returns:
- the created packet
- Throws:
RuntimeException
- when a NetworkCloudlet was not assigned to the TaskIllegalArgumentException
- when the source or destination Cloudlet doesn't have an assigned VM
-
getPacketsToSend
- Returns:
- a read-only list of packets to send
-
getPacketsToSend
Gets the list of packets to send, updating the send time to the given time and clearing the list of packets, marking the task as finished.- Parameters:
sendTime
- the send time to update all packets in the list- Returns:
- the packet list with the send time updated to the given time
-