Class ExponentialGenerator

    • Constructor Detail

      • ExponentialGenerator

        public ExponentialGenerator​(NumberGenerator<Double> rate,
                                    Random rng)
        Creates a generator of exponentially-distributed values from a distribution with a rate controlled by the specified generator parameter. The mean of this distribution is 1 / rate and the variance is 1 / rate^2.
        Parameters:
        rate - A number generator that provides values to use as the rate for the exponential distribution. This generator must only return non-zero, positive values.
        rng - The source of randomness used to generate the exponential values.
      • ExponentialGenerator

        public ExponentialGenerator​(double rate,
                                    Random rng)
        Creates a generator of exponentially-distributed values from a distribution with the specified rate. The mean of this distribution is 1 / rate and the variance is 1 / rate^2.
        Parameters:
        rate - The rate (lamda) of the exponential distribution.
        rng - The source of randomness used to generate the exponential values.
    • Method Detail

      • nextValue

        public Double nextValue()
        Generate the next exponential value from the current value of rate.
        Specified by:
        nextValue in interface NumberGenerator<Double>
        Returns:
        The next exponentially-distributed value.