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 Summary
Constructors Constructor Description BulkData(long id, int src, int dst, int dataAmount, double deadline, int cos, double arrivalTime, double deadlineTime)Creates a new request. -
Method Summary
Modifier and Type Method Description static BulkDataBulkAmountComparatorAscending(BulkData b1, BulkData b2)static BulkDataBulkAmountComparatorDescending(BulkData b1, BulkData b2)static BulkDataBulkDLComparatorAscending(BulkData b1, BulkData b2)static BulkDataBulkDLComparatorDescending(BulkData b1, BulkData b2)doublegetArrivalTime()intgetCOS()intgetDataAmount()Retrieves the data amount to be transferred for a given BulkDataUnicast request.doublegetDeadline()Retrieves the duration time to make the transfer, in seconds, of a given BulkDataUnicast request.doublegetDeadlineTime()doublegetDepartureTime()intgetDestination()Retrieves the destination node for a given BulkDataUnicast request.longgetID()Retrieves the unique identifier for a given BulkDataUnicast request.doublegetServedTime()intgetSource()Retrieves the source node for a given BulkDataUnicast request.voidsetDataAmount(int dataAmount)Assigns a new value to the required quantity of bulk data of a given BulkDataUnicast request.protected voidsetDepartureTime(double departureTime)voidsetID(long id)protected voidsetServedTime(double servedTime)java.lang.StringtoString()Prints all information related to the arriving BulkDataUnicast request.java.lang.StringtoTrace()Creates a string with relevant information about the BulkDataUnicast request, to be printed on the Trace file.booleanverifyRate(int rate)Verifies that the rate meets the bulk's requirements
-
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 identifiersrc- source nodedst- destination nodedataAmount- quantity of bulk datadeadline- maximum tolerable transfer time (seconds)cos- classe of servicearrivalTime- the arrivaTime of this bulkdeadlineTime- 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:
toStringin classjava.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
-
BulkAmountComparatorDescending
-
BulkDLComparatorAscending
-
BulkDLComparatorDescending
-