Class DiscreteUniformSampler.LargeRangeDiscreteUniformSampler

    • Field Detail

      • lower

        private final int lower
        Lower bound.
      • upper

        private final int upper
        Upper bound.
    • Constructor Detail

      • LargeRangeDiscreteUniformSampler

        LargeRangeDiscreteUniformSampler​(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.
    • Method Detail

      • sample

        public int sample()
        Description copied from interface: DiscreteSampler
        Creates an int sample.
        Returns:
        a sample.
      • withUniformRandomProvider

        public SharedStateDiscreteSampler withUniformRandomProvider​(UniformRandomProvider rng)
        Description copied from interface: SharedStateSampler
        Create a new instance of the sampler with the same underlying state using the given uniform random provider as the source of randomness.
        Parameters:
        rng - Generator of uniformly distributed random numbers.
        Returns:
        the sampler