Class CloudletSendTask
java.lang.Object
org.cloudbus.cloudsim.cloudlets.network.CloudletTask
org.cloudbus.cloudsim.cloudlets.network.CloudletSendTask
- All Implemented Interfaces:
Identifiable
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
-
Method Summary
Modifier and TypeMethodDescriptionaddPacket
(NetworkCloudlet destinationCloudlet, long bytes) Creates and adds a packet to the list of packets to be sent to aCloudlet
that is inside a specific VM.getPacketsToSend
(double sendTime) Gets the list of packets to send, updating packets' 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
- id to assign to the task
-
-
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 packets' send time to the given time and clearing the list of packets, marking the task as finished.- Parameters:
sendTime
- packets' send time to set (in seconds)- Returns:
- the packet list with their send time updated to the given time
-