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 BulkData
BulkAmountComparatorAscending(BulkData b1, BulkData b2)
static BulkData
BulkAmountComparatorDescending(BulkData b1, BulkData b2)
static BulkData
BulkDLComparatorAscending(BulkData b1, BulkData b2)
static BulkData
BulkDLComparatorDescending(BulkData b1, BulkData b2)
double
getArrivalTime()
int
getCOS()
int
getDataAmount()
Retrieves the data amount to be transferred for a given BulkDataUnicast request.double
getDeadline()
Retrieves the duration time to make the transfer, in seconds, of a given BulkDataUnicast request.double
getDeadlineTime()
double
getDepartureTime()
int
getDestination()
Retrieves the destination node for a given BulkDataUnicast request.long
getID()
Retrieves the unique identifier for a given BulkDataUnicast request.double
getServedTime()
int
getSource()
Retrieves the source node for a given BulkDataUnicast request.void
setDataAmount(int dataAmount)
Assigns a new value to the required quantity of bulk data of a given BulkDataUnicast request.protected void
setDepartureTime(double departureTime)
void
setID(long id)
protected void
setServedTime(double servedTime)
java.lang.String
toString()
Prints all information related to the arriving BulkDataUnicast request.java.lang.String
toTrace()
Creates a string with relevant information about the BulkDataUnicast request, to be printed on the Trace file.boolean
verifyRate(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:
toString
in 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
-