Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Tally

Class that collects observations and provides summary statistics and histograms.

The Tally class is used by Queue objects to provide statistics about queue populations and dwell times.

Hierarchy

  • Tally

Index

Constructors

constructor

  • new Tally(options?: any): Tally
  • Initializes a new instance of the Tally class.

    Parameters

    • Optional options: any

      Optional object uses to initialize the Tally properties.

    Returns Tally

Accessors

avg

  • get avg(): number
  • Gets the average of the observed values.

    Returns number

cnt

  • get cnt(): number
  • Gets the number of observed values.

    Returns number

max

  • get max(): number
  • Gets the maximum observed value.

    Returns number

min

  • get min(): number
  • Gets the minimum observed value.

    Returns number

stdev

  • get stdev(): number
  • Gets the standard deviation of the observed values.

    Returns number

var

  • get var(): number
  • Gets the variance of the observed values.

    Returns number

Methods

add

  • add(value: number, weight?: number): void
  • Adds a value to the Tally.

    Parameters

    • value: number

      Value to add to the tally.

    • weight: number = 1

      Weight of the observed value.

    Returns void

getHistogram

getHistogramChart

  • getHistogramChart(title?: string, scale?: number): string
  • Gets an HTML string showing the Tally as a histogram.

    Before using this method, call the setHistogramParameters to specify the desired histogram's bin size and limits.

    Parameters

    • title: string = ''

      The title for the histogram.

    • scale: number = 1

      Factor applied to scale all values. For example, if the simulation uses seconds and you want to show the values in minutes, set scale to 1/60.

    Returns string

    An HTML string showing the Tally as a histogram.

reset

  • reset(): void
  • Resets the Tally by clearing all values, statistics, and histogram data.

    Returns void

setHistogramParameters

  • setHistogramParameters(binSize: number, min?: number, max?: number): void
  • Sets the parameters used to build histograms for this Tally.

    Use the getHistogram and {@link getHistogramTable} methods to create tally histograms that can be added to reports.

    The default value for this property is null, which prevents the creation of any histograms.

    Parameters

    • binSize: number
    • min: number = null
    • max: number = null

    Returns void

Generated using TypeDoc