Class DiscreteUniformSampler

    • Method Summary

      Modifier and Type Method Description
      int sample()
      Creates a sample.
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DiscreteUniformSampler

        public DiscreteUniformSampler​(UniformRandomProvider rng,
                                      int lower,
                                      int upper)
        Parameters:
        rng - Generator of uniformly distributed random numbers.
        lower - Lower bound (inclusive) of the distribution.
        upper - Upper bound (inclusive) of the distribution.
        Throws:
        java.lang.IllegalArgumentException - if lower > upper.
    • Method Detail

      • sample

        public int sample()
        Creates a sample.
        Specified by:
        sample in interface DiscreteSampler
        Returns:
        a sample.