Class SamplerImpl

java.lang.Object
ai.promoted.delivery.client.SamplerImpl
All Implemented Interfaces:
Sampler

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

    • SamplerImpl

      public SamplerImpl()
    • SamplerImpl

      public SamplerImpl(Random rand)
  • Method Details

    • 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.