Package jsl.utilities.statistic.welch
Class AbstractWelchDataCollector
- java.lang.Object
-
- jsl.utilities.statistic.welch.AbstractWelchDataCollector
-
- All Implemented Interfaces:
WelchDataCollectorIfc
- Direct Known Subclasses:
WelchDataArrayCollector,WelchDataFileCollector
public abstract class AbstractWelchDataCollector extends java.lang.Object implements WelchDataCollectorIfc
An abstract base class for building collectors of Welch data
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.ArrayList<java.lang.Double>myAveragesForRepsHolds the average of the observations for each replicationprotected java.util.ArrayList<java.lang.Double>myAvgTBOForRepsHolds the average time between observations for each replicationprotected doublemyBatchSizeThe size associated with batching the within replication observations.protected doublemyLastTimeThe time that the last observation occurred.protected doublemyLastValueThe observation at the last observed time.protected java.lang.StringmyNameprotected longmyObsCountCounts the observations when processing a replicationprotected java.util.ArrayList<java.lang.Long>myObsCountsForRepsHolds the number of observations for each of the replications, zero is the first replicationprotected StatisticmyRepStatUsed to collect the overall sample average across observationsprotected StatisticTypemyStatTypeprotected WeightedStatisticmyTBOStatsUsed to collect the time between observations when processing a replicationprotected java.util.ArrayList<java.lang.Double>myTimeOfLastObsForRepsHolds the time of the last observation for each replicationprotected WeightedStatisticmyWithinRepStatsUsed to collect the average when processing a replication
-
Constructor Summary
Constructors Constructor Description AbstractWelchDataCollector(StatisticType statisticType, java.lang.String name, double batchSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeginReplication()Should be executed prior to each replicationvoidendReplication()Should be executed after each replicationdouble[]getAvgTimeBtwObservationsForEachReplication()The average time between observations in each replication returned as an array.doublegetBatchSize()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 batchdoublegetLastTime()The time of the observation recordeddoublegetLastValue()The value of the observation recordedlong[]getNumberOfObservationsForEachReplication()The number of observations in each replication returned as an array.intgetNumberOfReplications()The number of full replications observeddouble[]getReplicationAverages()double[]getTimeOfLastObservationForReps()voidsetUpCollector()Should be executed once prior to any collection and should be used to clear any statistical collection and prepare the collector for collecting data.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jsl.utilities.statistic.welch.WelchDataCollectorIfc
cleanUpCollector, collect, getMinNumberOfObservationsAcrossReplications
-
-
-
-
Field Detail
-
myObsCount
protected long myObsCount
Counts the observations when processing a replication
-
myObsCountsForReps
protected final java.util.ArrayList<java.lang.Long> myObsCountsForReps
Holds the number of observations for each of the replications, zero is the first replication
-
myAvgTBOForReps
protected final java.util.ArrayList<java.lang.Double> myAvgTBOForReps
Holds the average time between observations for each replication
-
myTimeOfLastObsForReps
protected final java.util.ArrayList<java.lang.Double> myTimeOfLastObsForReps
Holds the time of the last observation for each replication
-
myWithinRepStats
protected final WeightedStatistic myWithinRepStats
Used to collect the average when processing a replication
-
myRepStat
protected final Statistic myRepStat
Used to collect the overall sample average across observations
-
myTBOStats
protected final WeightedStatistic myTBOStats
Used to collect the time between observations when processing a replication
-
myAveragesForReps
protected final java.util.ArrayList<java.lang.Double> myAveragesForReps
Holds the average of the observations for each replication
-
myLastTime
protected double myLastTime
The time that the last observation occurred. The last observed time.
-
myLastValue
protected double myLastValue
The observation at the last observed time.
-
myBatchSize
protected final double myBatchSize
The size associated with batching the within replication observations. If the data is tally based, then it is the number of observations per batch. If the data is observation-based, then it is the time period over which the time average is computed.
-
myStatType
protected final StatisticType myStatType
-
myName
protected final java.lang.String myName
-
-
Constructor Detail
-
AbstractWelchDataCollector
public AbstractWelchDataCollector(StatisticType statisticType, java.lang.String name, double batchSize)
- Parameters:
statisticType- the type of statistic TALLY or TIME_PERSISTENTname- the name of the observations being collectedbatchSize- the amount of batching to perform on the observations within a replication
-
-
Method Detail
-
getBatchSize
public final double getBatchSize()
Description copied from interface:WelchDataCollectorIfcThe 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- Specified by:
getBatchSizein interfaceWelchDataCollectorIfc- Returns:
- the size of a batch
-
getLastTime
public final double getLastTime()
Description copied from interface:WelchDataCollectorIfcThe time of the observation recorded- Specified by:
getLastTimein interfaceWelchDataCollectorIfc- Returns:
- Returns the time of the last collected value.
-
getLastValue
public final double getLastValue()
Description copied from interface:WelchDataCollectorIfcThe value of the observation recorded- Specified by:
getLastValuein interfaceWelchDataCollectorIfc- Returns:
- Returns the previously collected value.
-
getNumberOfObservationsForEachReplication
public final long[] getNumberOfObservationsForEachReplication()
Description copied from interface:WelchDataCollectorIfcThe 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.- Specified by:
getNumberOfObservationsForEachReplicationin interfaceWelchDataCollectorIfc- Returns:
- the number of observations for each replication
-
getAvgTimeBtwObservationsForEachReplication
public final double[] getAvgTimeBtwObservationsForEachReplication()
Description copied from interface:WelchDataCollectorIfcThe 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.- Specified by:
getAvgTimeBtwObservationsForEachReplicationin interfaceWelchDataCollectorIfc- Returns:
- the average time between observations
-
getReplicationAverages
public final double[] getReplicationAverages()
-
getTimeOfLastObservationForReps
public final double[] getTimeOfLastObservationForReps()
-
getNumberOfReplications
public final int getNumberOfReplications()
Description copied from interface:WelchDataCollectorIfcThe number of full replications observed- Specified by:
getNumberOfReplicationsin interfaceWelchDataCollectorIfc- Returns:
- the number of replications observed
-
setUpCollector
public void setUpCollector()
Description copied from interface:WelchDataCollectorIfcShould be executed once prior to any collection and should be used to clear any statistical collection and prepare the collector for collecting data.- Specified by:
setUpCollectorin interfaceWelchDataCollectorIfc
-
beginReplication
public void beginReplication()
Description copied from interface:WelchDataCollectorIfcShould be executed prior to each replication- Specified by:
beginReplicationin interfaceWelchDataCollectorIfc
-
endReplication
public void endReplication()
Description copied from interface:WelchDataCollectorIfcShould be executed after each replication- Specified by:
endReplicationin interfaceWelchDataCollectorIfc
-
-