Welch Data File Analyzer
This class knows how to process data collected by the WelchDataFileCollector class and produce "Welch Data". That is for every observation, this file will average across the replications and compute the average across the replications and compute the cumulative sum over the averages.
It can make "wpdf" files which are binary DataOutputStream files holding the Welch average and the cumulative average for each of the observations.
wpdf = Welch Plot Data File
It can make a csv file that holds the Welch average and cumulative average
An Observer can be attached. It will be notified when a call to get() occurs. getLastDataPoint(), getLastObservationIndex(), and getLastReplicationIndex() can be used by the observer to determine the value, observation number, and replication of the observation after notification.
Unless specifically redirected, files produced by the operation of this class are stored in the same directory (getBaseDirectory()) that the wdf is stored as specified by the supplied WelchFileMetaDataBean information.
Author
rossetti
Properties
The average time between observations in the simulation across all the replications. This can be used to determine a warmup period in terms of time.
Returns the last data point read or Double.NaN if none read. Can be used by Observers when data is read.
The number of observations across the replications
The number of observations in each replication
Returns the average within each replication. That is, the average of the observations within each replication. zero is the first replication
Returns the average amount of time taken per observation in each of the replications
Functions
Computes and returns the across replication average for ith row of observations
Fills the supplied array with a row of observations across the replications
Allows the adding (attaching) of an observer to the observable
Creates a BatchStatistic that batches the Welch averages according to the batching parameters. Uses the number of observations via getMinNumObservationsInReplications() to determine the number of batches based on MIN_BATCH_SIZE. No data is deleted.
Creates a BatchStatistic that batches the Welch averages according to the batching parameters. Uses the number of observations via getMinNumObservationsInReplications() to determine the number of batches based on MIN_BATCH_SIZE.
Creates a BatchStatistic that batches the Welch averages according to the batching parameters. Uses the number of observations via getMinNumObservationsInReplications() to determine the number of batches based on the supplied batch size.
Creates a BatchStatistic that batches the Welch averages according to the batching parameters. If the minNumBatches x minBatchSize = number of observations then the maxNBMultiple does not matter. Uses a batch multiple of 2.
Creates a BatchStatistic that batches the Welch averages according to the batching parameters. If the minNumBatches x minBatchSize = number of observations then the maxNBMultiple does not matter.
Returns how many observers are currently attached to the observable
This results in a comma separated value file that has each rows containing each observation for each replication and each replication as columns. The last two columns are avg is the average across the replications and cumAvg. The file is flushed and closed. The file is stored in the base directory holding the Welch data files and has the name of the data with _WelchData.csv appended.
Creates and writes out the Welch plot data. Squelches inconvenient IOExceptions The file is stored in the base directory holding the Welch data files and has the name of the data with _WelchPlotData.csv appended.
Creates a file and writes out the Welch data to the DataOutputStream. This produces a file with the "wpdf" extension. wpdf = Welch Plot Data File Squelches inconvenient IOExceptions
Returns an array of the cumulative Welch averages. Since the number of observations in the file may be very large, this may have memory implications.
Detaches all the observers from the observable
Allows the deletion (removing) of an observer from the observable
Returns true if the observer is already attached
Returns the last observation index asked for. Can be used by observers Returns Integer.MIN_VALUE if no observations have been read
Returns the last replication index asked for. Can be used by observers Returns Integer.MIN_VALUE if no observations have been read
The number of replications
Returns an array of the Welch averages. Since the number of observations in the file may be very large, this may have memory implications.
Returns an array of the Welch averages. Since the number of observations in the file may be very large, this may have memory implications.
Writes out the number of observations to the supplied PrintWriter This results in a comma separated value file that has each rows containing each observation for each replication and each replication as columns. The last two columns are avg is the average across the replications and cumAvg. The file is flushed and closed.
Writes out the number of observations to the supplied PrintWriter This results in a comma separated value file that has x_bar and cum_x_bar where x_bar is the average across the replications. The file is flushed and closed.
This produces a file with the "wpdf" extension. wpdf = Welch Plot Data File