Class DistConstant

    • Constructor Detail

      • DistConstant

        public DistConstant​(StreamInterface stream,
                            double constant)
        constructs a new constant distribution.
        Parameters:
        stream - StreamInterface; the random number stream
        constant - double; the value
    • 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
      • getConstant

        public double getConstant()
        Return the constant.
        Returns:
        double; the constant