Package tools.descartes.dlim.generator
Class ArrivalRateTuple
java.lang.Object
tools.descartes.dlim.generator.ArrivalRateTuple
- All Implemented Interfaces:
Comparable<ArrivalRateTuple>
A container class containing an arrival rate and its time-stamp. Also offers
some utilities.
-
Constructor Summary
ConstructorsConstructorDescriptionArrivalRateTuple
(double timeStamp, double arrivalRate) Create a new tuple of arrival rate and its time-stamp. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Clones the current arrival rate tuple.int
Compares two arrival rate tuples within one another.boolean
double
Gets the arrival rate.double
Get the time-difference between two arrival rate tuples.double
Gets the time stamp.int
hashCode()
static boolean
Checks if arrival rate tuples are sorted by time or arrival rate.void
setArrivalRate
(double arrivalRate) Sets the arrival rate.static void
setSortByTime
(boolean sortByTime) Set whether arrival rate tuples are to be sortet by time or arrival rate.void
setTimeStamp
(double timeStamp) Sets the time stamp.toString()
Returns a simple output String for the arrival rate tuple.
-
Constructor Details
-
ArrivalRateTuple
public ArrivalRateTuple(double timeStamp, double arrivalRate) Create a new tuple of arrival rate and its time-stamp.- Parameters:
timeStamp
- the time stamparrivalRate
- the arrival rate
-
-
Method Details
-
getStep
Get the time-difference between two arrival rate tuples. Returns time-stamp/2 if null is passed.- Parameters:
t
- the t- Returns:
- the step
-
hashCode
public int hashCode() -
equals
-
getTimeStamp
public double getTimeStamp()Gets the time stamp.- Returns:
- the time stamp
-
setTimeStamp
public void setTimeStamp(double timeStamp) Sets the time stamp.- Parameters:
timeStamp
- the new time stamp
-
getArrivalRate
public double getArrivalRate()Gets the arrival rate.- Returns:
- the arrival rate
-
setArrivalRate
public void setArrivalRate(double arrivalRate) Sets the arrival rate.- Parameters:
arrivalRate
- the new arrival rate
-
isSortByTime
public static boolean isSortByTime()Checks if arrival rate tuples are sorted by time or arrival rate. This is a static global setting!- Returns:
- true, if is sort by time
-
setSortByTime
public static void setSortByTime(boolean sortByTime) Set whether arrival rate tuples are to be sortet by time or arrival rate. This is a static global setting!- Parameters:
sortByTime
- the new sort by time
-
compareTo
Compares two arrival rate tuples within one another. Uses either time-stamp or arrival rate based on isSortByTime().- Specified by:
compareTo
in interfaceComparable<ArrivalRateTuple>
- Parameters:
o
- the o- Returns:
- the int
- See Also:
-
toString
Returns a simple output String for the arrival rate tuple. -
clone
Clones the current arrival rate tuple.
-