Package ons

Class BulkData

java.lang.Object
ons.BulkData

public class BulkData
extends java.lang.Object
The BulkData class defines an object that can be thought of as a data amount transfer request ,going from a source node to a destination node within a specific deadline.
  • Constructor Details

    • BulkData

      public BulkData​(long id, int src, int dst, int dataAmount, double deadline, int cos, double arrivalTime, double deadlineTime)
      Creates a new request.
      Parameters:
      id - unique identifier
      src - source node
      dst - destination node
      dataAmount - quantity of bulk data
      deadline - maximum tolerable transfer time (seconds)
      cos - classe of service
      arrivalTime - the arrivaTime of this bulk
      deadlineTime - the deadline time of this bulk
  • Method Details

    • getID

      public long getID()
      Retrieves the unique identifier for a given BulkDataUnicast request.
      Returns:
      the value of the request's id attribute
    • setID

      public void setID​(long id)
    • getSource

      public int getSource()
      Retrieves the source node for a given BulkDataUnicast request.
      Returns:
      the value of the request's src attribute
    • getDestination

      public int getDestination()
      Retrieves the destination node for a given BulkDataUnicast request.
      Returns:
      the value of the Flow's dst attribute
    • getDataAmount

      public int getDataAmount()
      Retrieves the data amount to be transferred for a given BulkDataUnicast request.
      Returns:
      the quantity of bulk data
    • setDataAmount

      public void setDataAmount​(int dataAmount)
      Assigns a new value to the required quantity of bulk data of a given BulkDataUnicast request.
      Parameters:
      dataAmount -
    • getDeadline

      public double getDeadline()
      Retrieves the duration time to make the transfer, in seconds, of a given BulkDataUnicast request.
      Returns:
      the value of the BulkDataUnicast's duration attribute
    • getCOS

      public int getCOS()
    • verifyRate

      public boolean verifyRate​(int rate)
      Verifies that the rate meets the bulk's requirements
      Parameters:
      rate - the rate in Mb
      Returns:
      if the rate meets the bulk's requirements, false otherwise
    • getDeadlineTime

      public double getDeadlineTime()
    • getArrivalTime

      public double getArrivalTime()
    • getServedTime

      public double getServedTime()
    • setServedTime

      protected void setServedTime​(double servedTime)
    • getDepartureTime

      public double getDepartureTime()
    • setDepartureTime

      protected void setDepartureTime​(double departureTime)
    • toString

      public java.lang.String toString()
      Prints all information related to the arriving BulkDataUnicast request.
      Overrides:
      toString in class java.lang.Object
      Returns:
      string containing all the values of the parameters of all requests
    • toTrace

      public java.lang.String toTrace()
      Creates a string with relevant information about the BulkDataUnicast request, to be printed on the Trace file.
      Returns:
      string with values of the parameters of BulkDataUnicast request
    • BulkAmountComparatorAscending

      public static BulkData BulkAmountComparatorAscending​(BulkData b1, BulkData b2)
    • BulkAmountComparatorDescending

      public static BulkData BulkAmountComparatorDescending​(BulkData b1, BulkData b2)
    • BulkDLComparatorAscending

      public static BulkData BulkDLComparatorAscending​(BulkData b1, BulkData b2)
    • BulkDLComparatorDescending

      public static BulkData BulkDLComparatorDescending​(BulkData b1, BulkData b2)