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>
myAveragesForReps
Holds the average of the observations for each replicationprotected java.util.ArrayList<java.lang.Double>
myAvgTBOForReps
Holds the average time between observations for each replicationprotected double
myBatchSize
The size associated with batching the within replication observations.protected double
myLastTime
The time that the last observation occurred.protected double
myLastValue
The observation at the last observed time.protected java.lang.String
myName
protected long
myObsCount
Counts the observations when processing a replicationprotected java.util.ArrayList<java.lang.Long>
myObsCountsForReps
Holds the number of observations for each of the replications, zero is the first replicationprotected Statistic
myRepStat
Used to collect the overall sample average across observationsprotected StatisticType
myStatType
protected WeightedStatistic
myTBOStats
Used to collect the time between observations when processing a replicationprotected java.util.ArrayList<java.lang.Double>
myTimeOfLastObsForReps
Holds the time of the last observation for each replicationprotected WeightedStatistic
myWithinRepStats
Used 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 void
beginReplication()
Should be executed prior to each replicationvoid
endReplication()
Should be executed after each replicationdouble[]
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 batchdouble
getLastTime()
The time of the observation recordeddouble
getLastValue()
The value of the observation recordedlong[]
getNumberOfObservationsForEachReplication()
The number of observations in each replication returned as an array.int
getNumberOfReplications()
The number of full replications observeddouble[]
getReplicationAverages()
double[]
getTimeOfLastObservationForReps()
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.-
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:WelchDataCollectorIfc
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- Specified by:
getBatchSize
in interfaceWelchDataCollectorIfc
- Returns:
- the size of a batch
-
getLastTime
public final double getLastTime()
Description copied from interface:WelchDataCollectorIfc
The time of the observation recorded- Specified by:
getLastTime
in interfaceWelchDataCollectorIfc
- Returns:
- Returns the time of the last collected value.
-
getLastValue
public final double getLastValue()
Description copied from interface:WelchDataCollectorIfc
The value of the observation recorded- Specified by:
getLastValue
in interfaceWelchDataCollectorIfc
- Returns:
- Returns the previously collected value.
-
getNumberOfObservationsForEachReplication
public final long[] getNumberOfObservationsForEachReplication()
Description copied from interface:WelchDataCollectorIfc
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.- Specified by:
getNumberOfObservationsForEachReplication
in interfaceWelchDataCollectorIfc
- Returns:
- the number of observations for each replication
-
getAvgTimeBtwObservationsForEachReplication
public final double[] getAvgTimeBtwObservationsForEachReplication()
Description copied from interface:WelchDataCollectorIfc
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.- Specified by:
getAvgTimeBtwObservationsForEachReplication
in 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:WelchDataCollectorIfc
The number of full replications observed- Specified by:
getNumberOfReplications
in interfaceWelchDataCollectorIfc
- Returns:
- the number of replications observed
-
setUpCollector
public void setUpCollector()
Description copied from interface:WelchDataCollectorIfc
Should 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:
setUpCollector
in interfaceWelchDataCollectorIfc
-
beginReplication
public void beginReplication()
Description copied from interface:WelchDataCollectorIfc
Should be executed prior to each replication- Specified by:
beginReplication
in interfaceWelchDataCollectorIfc
-
endReplication
public void endReplication()
Description copied from interface:WelchDataCollectorIfc
Should be executed after each replication- Specified by:
endReplication
in interfaceWelchDataCollectorIfc
-
-