Class MultipleComparisonDataCollector

  • All Implemented Interfaces:
    ObserverIfc, GetNameIfc, IdentityIfc

    public class MultipleComparisonDataCollector
    extends ModelElementObserver
    Collects multiple comparison data for a particular ResponseVariable (each across replication average for each system configuration) This class assumes that each Experiment is given a unique name in order to uniquely determine the configuration for which the across replication data is collected for the observed response variable. This observer must be attached prior to running the simulation.
    • Constructor Detail

      • MultipleComparisonDataCollector

        public MultipleComparisonDataCollector​(ResponseVariable response)
      • MultipleComparisonDataCollector

        public MultipleComparisonDataCollector​(ResponseVariable response,
                                               java.lang.String name)
    • Method Detail

      • clearData

        public final void clearData()
        Sets all the data to zero
      • getExperimentNames

        public java.lang.String[] getExperimentNames()
        Returns the names of the experiments as an array of strings
        Returns:
        the names of the experiments as an array of strings
      • getMultipleComparisonAnalyzer

        public final MultipleComparisonAnalyzer getMultipleComparisonAnalyzer()
        Returns a MultipleComparisonAnalyzer based on the data of the collector
        Returns:
        a MultipleComparisonAnalyzer based on the data of the collector
      • getDataAsMap

        public final java.util.LinkedHashMap<java.lang.String,​double[]> getDataAsMap()
        The key is the name of the experiment The double[] is a array of the across replication averages for the response variable
        Returns:
        a copy of the data
      • getMinimumNumberReplicationsAcrossExperiments

        public final int getMinimumNumberReplicationsAcrossExperiments()
        Returns the number of replications in the experiment that had the smallest number of replications
        Returns:
        the number of replications in the experiment that had the smallest number of replications
      • getDataAsArray

        public final double[][] getDataAsArray()
        A 2-Dim array of the data each row represents the across replication average for each configuration (column). The number of rows is based on the configuration that has the smallest number of replications. Thus, this produces a rectangular array and may not include all replication data for every configuration.
        Returns:
        the data as an array
      • writeDataAsCSVFile

        public void writeDataAsCSVFile​(java.io.PrintWriter out,
                                       boolean header)
        Writes the data out to the PrintWriter Each row represents a different replication the columns start with ResponseName, Rep_Num and then each configuration in a new column The header has "ResponseName", "Rep_Num", Experiment Name, ...
        Parameters:
        out - the PrintWriter
        header - if true write the header, false don't write the header
      • writeDataAsCSVFile

        public java.io.PrintWriter writeDataAsCSVFile()
        Write the data to a default file with name Response.getName() + "_MCBData".csv within the simulation's output directory
        Returns:
        the PrintWriter
      • getAcrossReplicationData

        public final double[] getAcrossReplicationData​(java.lang.String name)
        Across replication averages for the experiment with the given name
        Parameters:
        name - the name
        Returns:
        the replication averages