Class DistTriangular

    • Constructor Detail

      • DistTriangular

        public DistTriangular​(StreamInterface stream,
                              double min,
                              double mode,
                              double max)
        constructs a new triangular distribution with a minimum, mode, and maximum.
        Parameters:
        stream - StreamInterface; the random number stream
        min - double; the minimum
        mode - double; the mode
        max - double; the maximum
        Throws:
        IllegalArgumentException - when mode < min or mode > max or min == max
    • Method Detail

      • draw

        public double draw()
        draws the next stream value according to the probability of this this distribution.
        Specified by:
        draw in class DistContinuous
        Returns:
        the next double value drawn.
      • getProbabilityDensity

        public double getProbabilityDensity​(double x)
        returns the probability density value of a value x.
        Specified by:
        getProbabilityDensity in class DistContinuous
        Parameters:
        x - double; the value for which the density function needs to be calculated
        Returns:
        double; the probability density for value x
      • getMin

        public double getMin()
        Return the minimum value of the distribution.
        Returns:
        double; the minimum value of the distribution
      • getMode

        public double getMode()
        Return the mode of the distribution.
        Returns:
        double; the mode of the distribution
      • getMax

        public double getMax()
        Return the maximum value of the distribution.
        Returns:
        double; the maximum value of the distribution.