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
Since:
CloudSim Toolkit 1.0
Author:
Saurabh Kumar Garg, Manoel Campos da Silva Filho
  • Constructor Details

    • CloudletSendTask

      public CloudletSendTask​(int id)
      Creates a new task.
      Parameters:
      id - task id
  • Method Details

    • addPacket

      public VmPacket addPacket​(Cloudlet destinationCloudlet, long bytes)
      Creates and adds a packet to the list of packets to be sent to a Cloudlet that is inside a specific VM.
      Parameters:
      destinationCloudlet - destination cloudlet to send packets to
      bytes - the number of data bytes of the packet to create
      Returns:
      the created packet
      Throws:
      RuntimeException - when a NetworkCloudlet was not assigned to the Task
      IllegalArgumentException - when the source or destination Cloudlet doesn't have an assigned VM
    • getPacketsToSend

      public List<VmPacket> getPacketsToSend()
      Returns:
      a read-only list of packets to send
    • getPacketsToSend

      public 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.
      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