Class UniformDistributionTimestampWriter
java.lang.Object
tools.descartes.dlim.exporter.utils.TimeStampWriter
tools.descartes.dlim.exporter.utils.UniformDistributionTimestampWriter
Creates a time-stamp file from an arrival rate list. Timestamps are sampled
using a uniform distribution
-
Constructor Summary
ConstructorsConstructorDescriptionUniformDistributionTimestampWriter
(String endOfLineCharacter, org.apache.commons.math3.random.JDKRandomGenerator rndGenerator) UniformDistributionTimestampWriter
(org.apache.commons.math3.random.JDKRandomGenerator rndGenerator) -
Method Summary
Modifier and TypeMethodDescriptionvoid
generateTimeStampsFromArrivalRates
(File file, List<ArrivalRateTuple> arrRates, int decimalPlaces, double stretch, double arDevisor, double duration) protected void
writeTimestampsForArrivalRate
(PrintWriter writer, double step, double arrRate, double tmpStep, double tmpTime) Write the arrival rate using the provided writer in the specific chosen format.Methods inherited from class tools.descartes.dlim.exporter.utils.TimeStampWriter
formatDoubleForDecimalPlaces, generateTimeStampsFromArrivalRates, getDecimalplaces, getEndOfLineCharacter, getStretch
-
Constructor Details
-
UniformDistributionTimestampWriter
public UniformDistributionTimestampWriter(org.apache.commons.math3.random.JDKRandomGenerator rndGenerator) - Parameters:
rndGenerator
- Random generator used for sampling
-
UniformDistributionTimestampWriter
public UniformDistributionTimestampWriter(String endOfLineCharacter, org.apache.commons.math3.random.JDKRandomGenerator rndGenerator) - Parameters:
endOfLineCharacter
- The character before the end of a line in the output file. Note: the "\n" is always printed after this character. It does not have to be included here.rndGenerator
- Random generator used for sampling
-
-
Method Details
-
generateTimeStampsFromArrivalRates
public void generateTimeStampsFromArrivalRates(File file, List<ArrivalRateTuple> arrRates, int decimalPlaces, double stretch, double arDevisor, double duration) - Parameters:
file
- The filename of the produced output filearrRates
- The list of arrival rates as provided by the ArrivalRateGenerator.decimalPlaces
- The amount of decimal places a time-stamp is allowed to have.stretch
- The factor by which to stretch the times of the arrival rate tuples. Using a value < 1 compresses the time.arDevisor
- Divide the arrival rates from the arrival rate tuples by this to produce less time-stamps. Using a value < 1 produces more time stampsduration
- Duration of root sequence
-
writeTimestampsForArrivalRate
protected void writeTimestampsForArrivalRate(PrintWriter writer, double step, double arrRate, double tmpStep, double tmpTime) Description copied from class:TimeStampWriter
Write the arrival rate using the provided writer in the specific chosen format.- Specified by:
writeTimestampsForArrivalRate
in classTimeStampWriter
- Parameters:
writer
- PrintWriter, is already initialized and writing.step
- step between two time stampsarrRate
- current arrival ratetmpStep
- the temporary steptmpTime
- the temporary time
-