Interface WelchDataCollectorIfc

  • All Known Implementing Classes:
    AbstractWelchDataCollector, WelchDataArrayCollector, WelchDataFileCollector

    public interface WelchDataCollectorIfc
    The purpose of this interface is to define the behavior of implementations that collect data for the making of Welch plots. The collection should work for either observation or time-persistent data and should not depend upon whether or not the data is produced directly from a running JSL model. This is to facilitate the reuse of code for data that is generated from other sources such as files or other simulation models. The collection model assumes the following behavior: 1) There is a setup phase to prepare the collector. 2) There is a need to indicate the beginning of a replication. 3) There is a requirement to collect/record the individual observations during a replication. 4) There is a requirement that the collected observations be stored for processing. The frequency of storage may be different than the frequency of collected observations. For example, the raw observations may be batched in order to facilitate analysis and plotting. 5) There is a need to indicate the ending of a replication. 6) There is a cleanup phase to close up the collector.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      void beginReplication()
      Should be executed prior to each replication
      void cleanUpCollector()
      Should be executed once after all replications have been observed
      void collect​(double time, double value)  
      void endReplication()
      Should be executed after each replication
      double[] getAvgTimeBtwObservationsForEachReplication()
      The average time between observations in each replication returned as an array.
      double getBatchSize()
      The size of a batch can be considered either in terms of the number of observations in each batch or as the amount of time covered with each batch
      double getLastTime()
      The time of the observation recorded
      double getLastValue()
      The value of the observation recorded
      default long getMinNumberOfObservationsAcrossReplications()
      If the have been no replications, then this returns 0
      static double getNegativeBiasTestStatistic​(double[] data)
      Computes initialization bias (negative) test statistic based on algorithm on page 2580 Chapter 102 Nelson Handbook of Industrial Engineering, Quantitative Methods in Simulation
      static double getNegativeBiasTestStatistic​(BatchStatistic bm)
      Uses the batch means array from the BatchStatistic to compute the positive bias test statistic
      long[] getNumberOfObservationsForEachReplication()
      The number of observations in each replication returned as an array.
      int getNumberOfReplications()
      The number of full replications observed
      static double[] getPartialSums​(double avg, double[] data)
      Gets an array of the partial sum process for the provided data Based on page 2575 Chapter 102 Nelson Handbook of Industrial Engineering, Quantitative Methods in Simulation for producing a partial sum plot
      static double[] getPartialSums​(BatchStatistic bm)
      Gets an array of the partial sum process for the provided data Based on page 2575 Chapter 102 Nelson Handbook of Industrial Engineering, Quantitative Methods in Simulation for producing a partial sum plot The batch means array is used as the data
      static double getPositiveBiasTestStatistic​(double[] data)
      Computes initialization bias (positive) test statistic based on algorithm on page 2580 Chapter 102 Nelson Handbook of Industrial Engineering, Quantitative Methods in Simulation
      static double getPositiveBiasTestStatistic​(BatchStatistic bm)
      Uses the batch means array from the BatchStatistic to compute the positive bias test statistic
      void setUpCollector()
      Should be executed once prior to any collection and should be used to clear any statistical collection and prepare the collector for collecting data.
    • Method Detail

      • getPartialSums

        static double[] getPartialSums​(BatchStatistic bm)
        Gets an array of the partial sum process for the provided data Based on page 2575 Chapter 102 Nelson Handbook of Industrial Engineering, Quantitative Methods in Simulation for producing a partial sum plot The batch means array is used as the data
        Parameters:
        bm - The BatchStatistic
        Returns:
        n array of the partial sums
      • getPartialSums

        static double[] getPartialSums​(double avg,
                                       double[] data)
        Gets an array of the partial sum process for the provided data Based on page 2575 Chapter 102 Nelson Handbook of Industrial Engineering, Quantitative Methods in Simulation for producing a partial sum plot
        Parameters:
        avg - the average of the supplied data array
        data - the data
        Returns:
        the array of partial sums
      • getPositiveBiasTestStatistic

        static double getPositiveBiasTestStatistic​(BatchStatistic bm)
        Uses the batch means array from the BatchStatistic to compute the positive bias test statistic
        Parameters:
        bm - the BatchStatistic
        Returns:
        the positive bias test statistic
      • getPositiveBiasTestStatistic

        static double getPositiveBiasTestStatistic​(double[] data)
        Computes initialization bias (positive) test statistic based on algorithm on page 2580 Chapter 102 Nelson Handbook of Industrial Engineering, Quantitative Methods in Simulation
        Parameters:
        data - the data
        Returns:
        test statistic to be compared with F distribution
      • getNegativeBiasTestStatistic

        static double getNegativeBiasTestStatistic​(BatchStatistic bm)
        Uses the batch means array from the BatchStatistic to compute the positive bias test statistic
        Parameters:
        bm - the BatchStatistic
        Returns:
        the computed test statistic
      • getNegativeBiasTestStatistic

        static double getNegativeBiasTestStatistic​(double[] data)
        Computes initialization bias (negative) test statistic based on algorithm on page 2580 Chapter 102 Nelson Handbook of Industrial Engineering, Quantitative Methods in Simulation
        Parameters:
        data - the data to test
        Returns:
        test statistic to be compared with F distribution
      • getNumberOfReplications

        int getNumberOfReplications()
        The number of full replications observed
        Returns:
        the number of replications observed
      • getAvgTimeBtwObservationsForEachReplication

        double[] getAvgTimeBtwObservationsForEachReplication()
        The average time between observations in each replication returned as an array. 0 element is the first replication observed. If no replications have been observed then the array will be empty.
        Returns:
        the average time between observations
      • getNumberOfObservationsForEachReplication

        long[] getNumberOfObservationsForEachReplication()
        The number of observations in each replication returned as an array. 0 element is the first replication count. If no replications have been observed then the array will be empty.
        Returns:
        the number of observations for each replication
      • getMinNumberOfObservationsAcrossReplications

        default long getMinNumberOfObservationsAcrossReplications()
        If the have been no replications, then this returns 0
        Returns:
        the minimum number of observations across the replications
      • getBatchSize

        double getBatchSize()
        The size of a batch can be considered either in terms of the number of observations in each batch or as the amount of time covered with each batch
        Returns:
        the size of a batch
      • setUpCollector

        void setUpCollector()
        Should be executed once prior to any collection and should be used to clear any statistical collection and prepare the collector for collecting data.
      • beginReplication

        void beginReplication()
        Should be executed prior to each replication
      • collect

        void collect​(double time,
                     double value)
        Parameters:
        time - the time that the observation occurred
        value - the value of the observation at the observed time
      • getLastTime

        double getLastTime()
        The time of the observation recorded
        Returns:
        Returns the time of the last collected value.
      • getLastValue

        double getLastValue()
        The value of the observation recorded
        Returns:
        Returns the previously collected value.
      • endReplication

        void endReplication()
        Should be executed after each replication
      • cleanUpCollector

        void cleanUpCollector()
        Should be executed once after all replications have been observed