Class UniformDistributionTimestampWriter

java.lang.Object
tools.descartes.dlim.exporter.utils.TimeStampWriter
tools.descartes.dlim.exporter.utils.UniformDistributionTimestampWriter

public class UniformDistributionTimestampWriter extends TimeStampWriter
Creates a time-stamp file from an arrival rate list. Timestamps are sampled using a uniform distribution
  • 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 file
      arrRates - 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 stamps
      duration - 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 class TimeStampWriter
      Parameters:
      writer - PrintWriter, is already initialized and writing.
      step - step between two time stamps
      arrRate - current arrival rate
      tmpStep - the temporary step
      tmpTime - the temporary time