Class Chart


  • public class Chart
    extends java.lang.Object
    Author:
    Tomas Perez Segovia, Bruno Dillenseger
    • Method Detail

      • generateGraphics

        public org.jfree.chart.JFreeChart generateGraphics()
      • quantiles

        public double[] quantiles​(int n,
                                  double[] values)
        Get quantiles
        Parameters:
        n -
        values -
        Returns:
        array that contains the quantiles
      • getMovingMinimum

        public double[][] getMovingMinimum​(double initialTime,
                                           double[] values,
                                           int[] splitTime,
                                           int timeWindow,
                                           int step)
        Computes the moving minimum of values, according to a given time window and progression step.
        Parameters:
        initialTime - starting time (in ms) of the first time step
        values - array of all values on which moving statistics are computed
        splitTime - indexes of starting/ending values for each step. For example, the first value in step i is located at index splitTime[2*i] in the values parameter, and the last one is located at index splitTime[2*i+1].
        timeWindow - the width (in ms) of the time window over which moving statistics are computed
        step - the progression step (in ms) for moving statistics
        Returns:
        moving minimum of the given values, as an array of two series of numbers: [0] contains the array of dates (of type int, in ms), defined for each step by the middle date between i*step and i*step + time window [1] contains the array of values minimum over the time window through all steps
      • getMovingMaximum

        public double[][] getMovingMaximum​(double initialTime,
                                           double[] values,
                                           int[] splitTime,
                                           int timeWindow,
                                           int step)
        Computes the moving maximum of values, according to a given time window and progression step.
        Parameters:
        initialTime - starting time (in ms) of the first time step
        values - array of all values on which moving statistics are computed
        splitTime - indexes of starting/ending values for each step. For example, the first value in step i is located at index splitTime[2*i] in the values parameter, and the last one is located at index splitTime[2*i+1].
        timeWindow - the width (in ms) of the time window over which moving statistics are computed
        step - the progression step (in ms) for moving statistics
        Returns:
        moving maximum of the given values, as an array of two series of numbers: [0] contains the array of dates (of type int, in ms), defined for each step by the middle date between i*step and i*step + time window [1] contains the array of values maximum over the time window through all steps
      • getMovingAverages

        public double[][] getMovingAverages​(double initialTime,
                                            double[] values,
                                            int[] splitTime,
                                            int timeWindow,
                                            int step)
        Computes the moving average of values, according to a given time window and progression step.
        Parameters:
        initialTime - starting time (in ms) of the first time step
        values - array of all values on which moving statistics are computed
        splitTime - indexes of starting/ending values for each step. For example, the first value in step i is located at index splitTime[2*i] in the values parameter, and the last one is located at index splitTime[2*i+1].
        timeWindow - the width (in ms) of the time window over which moving statistics are computed
        step - the progression step (in ms) for moving statistics
        Returns:
        moving average of the given values, as an array of two series of numbers: [0] contains the array of dates (of type int, in ms), defined for each step by the middle date between i*step and i*step + time window [1] contains the array of values average over the time window through all steps
      • getMovingMedians

        public double[][] getMovingMedians​(double initialTime,
                                           double[] values,
                                           int[] splitTime,
                                           int timeWindow,
                                           int step)
        Computes the moving median of values, according to a given time window and progression step.
        Parameters:
        initialTime - starting time (in ms) of the first time step
        values - array of all values on which moving statistics are computed
        splitTime - indexes of starting/ending values for each step. For example, the first value in step i is located at index splitTime[2*i] in the values parameter, and the last one is located at index splitTime[2*i+1].
        timeWindow - the width (in ms) of the time window over which moving statistics are computed
        step - the progression step (in ms) for moving statistics
        Returns:
        moving median of the given values, as an array of two series of numbers: [0] contains the array of dates (of type int, in ms), defined for each step by the middle date between i*step and i*step + time window [1] contains the array of values median over the time window through all steps
      • getMovingStandardDeviations

        public double[][] getMovingStandardDeviations​(double initialTime,
                                                      double[] values,
                                                      int[] splitTime,
                                                      int timeWindow,
                                                      int step)
        Computes the moving standard deviation of values, according to a given time window and progression step.
        Parameters:
        initialTime - starting time (in ms) of the first time step
        values - array of all values on which moving statistics are computed
        splitTime - indexes of starting/ending values for each step. For example, the first value in step i is located at index splitTime[2*i] in the values parameter, and the last one is located at index splitTime[2*i+1].
        timeWindow - the width (in ms) of the time window over which moving statistics are computed
        step - the progression step (in ms) for moving statistics
        Returns:
        moving standard deviation of the given values, as an array of two series of numbers: [0] contains the array of dates (of type int, in ms), defined for each step by the middle date between i*step and i*step + time window [1] contains the array of values standard deviation over the time window through all steps
      • getMovingThroughput

        public double[][] getMovingThroughput​(double initialTime,
                                              int[] splitTime,
                                              int timeWindow,
                                              int step)
        Computes the moving throughput of event occurrences, according to a given time window and progression step.
        Parameters:
        initialTime - starting time (in ms) of the first time step
        splitTime - indexes of starting/ending event occurrences for each step. For example, the first occurrence in step i is occurrence number splitTime[2*i], and the last one is occurrence number splitTime[2*i+1].
        timeWindow - the width (in milliseconds) of the time window over which moving statistics are computed
        step - the progression step (in milliseconds) for moving statistics
        Returns:
        moving throughput of the given measurements, as an array of two series of numbers: [0] contains the array of dates (of type int, in milliseconds), defined by the middle dates between i*step and i*step + time window [1] contains the array of event throughput over the time window through all steps
      • getJfChart

        public org.jfree.chart.JFreeChart getJfChart()
      • setJfChart

        public void setJfChart​(org.jfree.chart.JFreeChart jfChart)
      • addChartDataValues

        public void addChartDataValues​(java.util.List<ChartDataValues> values)
      • clearChartDataValues

        public void clearChartDataValues()
      • getTitle

        public java.lang.String getTitle()
      • setTitle

        public void setTitle​(java.lang.String title)
      • getStartTime

        public long getStartTime()
        Gets the forced chart starting time.
        Returns:
        -1 if there is no forced starting time, or the forced chart starting time in ms.
      • setStartTime

        public void setStartTime​(long startTime)
        Forces the chart starting time, or leaves it to its default
        Parameters:
        startTime - a positive chart starting time in ms for all datasets, or -1 to use the default starting time.
      • getEndTime

        public long getEndTime()
        Gets the forced chart ending time.
        Returns:
        -1 if there is no forced ending time, or the forced chart ending time in ms.
      • setEndTime

        public void setEndTime​(long endTime)
        Forces the chart ending time, or leaves it to its default
        Parameters:
        endTime - a positive chart ending time in ms for all datasets, or -1 to use the default ending time.
      • getDefaultStartTime

        public long getDefaultStartTime()
        Gets the default chart starting time, i.e. the minimum time through all values of all datasets with a time-based chart enabled (scatter plot and/or moving statistics).
        Returns:
        the default chart starting time, or -1 if there is no time-based chart at all.
      • getDefaultEndTime

        public long getDefaultEndTime()
        Gets the default chart ending time, i.e. the maximum time through all values of all datasets with a time-based chart enabled (scatter plot and/or moving statistics).
        Returns:
        the default chart ending time, or -1 if there is no time-based chart at all.
      • getInitialTime

        public long getInitialTime()
      • getFinalTime

        public long getFinalTime()
      • getNumberOfSlices

        public int getNumberOfSlices()
      • setNumberOfSlices

        public void setNumberOfSlices​(int numberOfSlices)
      • getNumberOfQuantils

        public int getNumberOfQuantils()
      • setNumberOfQuantils

        public void setNumberOfQuantils​(int i)
      • exportToTxt

        public java.lang.String exportToTxt​(int nbTabs,
                                            java.io.File directory,
                                            java.lang.String sectionName,
                                            Report.imageFormats imageFormat)
      • exportToHtml

        public java.lang.String exportToHtml​(int tabsMem,
                                             java.io.File directory,
                                             java.lang.String sectionName,
                                             Report.imageFormats imageFormat)
      • exportToXML

        public void exportToXML​(int tabsMem,
                                java.io.File directory,
                                java.lang.String sectionName,
                                Report.imageFormats imageFormat)
      • toText

        public java.lang.String toText​(double[] vect)
      • getSection

        public Section getSection()
      • dump

        public java.lang.String dump()