Class SamplerImpl

  • All Implemented Interfaces:
    Sampler

    public class SamplerImpl
    extends Object
    implements Sampler
    Basic implementation of the Sampler interface.
    • Constructor Detail

      • SamplerImpl

        public SamplerImpl()
      • SamplerImpl

        public SamplerImpl​(Random rand)
    • Method Detail

      • sampleRandom

        public boolean sampleRandom​(float threshold)
        Description copied from interface: Sampler
        Simple random sampling that selects below the given threshold.
        Specified by:
        sampleRandom in interface Sampler
        Parameters:
        threshold - the sampling percentage in the range [0, 1].
        Returns:
        true if we should sample in, false if we should sample out.