Class StatisticalBatchingElement

  • All Implemented Interfaces:
    ObservableIfc, GetNameIfc, IdentityIfc

    public class StatisticalBatchingElement
    extends ModelElement
    When added to a Model, this class will cause batch statistics to be collected for ResponseVariables and TimeWeighted variables. It uses the TWBatchingElement and the ResponseVariableBatchingElement to perform this functionality. Time weighted variables are first discretized using a supplied batch interval. Then, observation based batching is applied to the discretized batches. Response variables are batched by observation number.
    • Constructor Detail

      • StatisticalBatchingElement

        public StatisticalBatchingElement​(Model model)
        Creates a StatisticalBatchingElement using the default discretizing interval defined in TWBatchingElement
        Parameters:
        model - the model for the batching
      • StatisticalBatchingElement

        public StatisticalBatchingElement​(Model model,
                                          double batchInterval)
        Creates a StatisticalBatchingElement
        Parameters:
        model - the model for the batching
        batchInterval - the discretizing interval for TimeWeighted variables
      • StatisticalBatchingElement

        public StatisticalBatchingElement​(Model model,
                                          double batchInterval,
                                          java.lang.String name)
        Creates a StatisticalBatchingElement
        Parameters:
        model - the model for the batching
        batchInterval - the discretizing interval for TimeWeighted variables
        name - the name of the model element
    • Method Detail

      • getAllResponseVariableBatchStatisticsAsMap

        public final java.util.Map<ResponseVariable,​BatchStatistic> getAllResponseVariableBatchStatisticsAsMap()
        Returns:
        a map of all batch statistics with the ResponseVariable variable as the key
      • getAllTimeWeightedBatchStatisticsAsMap

        public final java.util.Map<TimeWeighted,​BatchStatistic> getAllTimeWeightedBatchStatisticsAsMap()
        Returns:
        a map of all batch statistics with the TimeWeighted variable as the key
      • getBatchStatisticObserver

        public final BatchStatisticObserver getBatchStatisticObserver​(ResponseVariable key)
        Look up the BatchStatisticObserver for the ResponseVariable
        Parameters:
        key - the ResponseVariable to look up
        Returns:
        the BatchStatisticObserver
      • remove

        public final void remove​(ResponseVariable r)
        Removes the supplied ResponseVariable variable from the batching
        Parameters:
        r - the ResponseVariable to be removed
      • removeAll

        public final void removeAll()
        Removes all previously added ResponseVariable from the batching
      • getBatchStatistic

        public final BatchStatistic getBatchStatistic​(ResponseVariable r)
        Returns a statistical summary BatchStatistic on the ResponseVariable variable across the observed batches This returns a copy of the summary statistics.
        Parameters:
        r - the ResponseVariable to look up
        Returns:
        the returned BatchStatistic
      • getAllBatchStatistcs

        public final java.util.List<BatchStatistic> getAllBatchStatistcs()
        Returns a list of summary statistics on all ResponseVariable variables The list is a copy of originals.
        Returns:
        the filled up list
      • getAllStatistics

        public final java.util.List<StatisticAccessorIfc> getAllStatistics()
        Returns a list of the batch statistics in the form of StatisticAccessorIfc
        Returns:
        the list
      • getStatisticReporter

        public final StatisticReporter getStatisticReporter()
        Returns a StatisticReporter for reporting the statistics across the batches.
        Returns:
        the reporter
      • beforeExperiment

        protected void beforeExperiment()
        Description copied from class: ModelElement
        This method should be overridden by subclasses that need logic to be performed prior to an experiment. The beforeExperiment method allows model elements to be setup prior to the first replication within an experiment. It is called once before any replications occur.
        Overrides:
        beforeExperiment in class ModelElement
      • asString

        public java.lang.String asString()
        Description copied from class: ModelElement
        Allows sub-classes to provide more detail than toString() to represent the ModelElement as a String
        Overrides:
        asString in class ModelElement
        Returns:
        a detailed String representation