Package tools.descartes.dlim.reader
Class ArrivalRateReader
java.lang.Object
tools.descartes.dlim.reader.ArrivalRateReader
Provides utility to get arrival rates from a file.
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
getArrivalRateAtTimeFromFile
(double time, String filePath) Reads a file and gets the arrival rate at the given point in time.static List<ArrivalRateTuple>
readFileToList
(String filePath, double offset) Reads an arrival rate file and stores its arrival rate and time-stamp tuples into memory.
-
Method Details
-
getArrivalRateAtTimeFromFile
Reads a file and gets the arrival rate at the given point in time. Uses linear interpolation if the exact point in time is not defined in the file. Use only for single arrival rates.- Parameters:
time
- the timefilePath
- the file path- Returns:
- the arrival rate at time from file
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
readFileToList
public static List<ArrivalRateTuple> readFileToList(String filePath, double offset) throws IOException Reads an arrival rate file and stores its arrival rate and time-stamp tuples into memory.- Parameters:
filePath
- the file pathoffset
- the offset- Returns:
- the list
- Throws:
IOException
- Signals that an I/O exception has occurred.
-