Package ai.promoted.delivery.client
Class SamplerImpl
java.lang.Object
ai.promoted.delivery.client.SamplerImpl
- All Implemented Interfaces:
Sampler
Basic implementation of the Sampler interface.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleansampleRandom(float threshold) Simple random sampling that selects below the given threshold.
-
Constructor Details
-
SamplerImpl
public SamplerImpl() -
SamplerImpl
-
-
Method Details
-
sampleRandom
public boolean sampleRandom(float threshold) Description copied from interface:SamplerSimple random sampling that selects below the given threshold.- Specified by:
sampleRandomin interfaceSampler- Parameters:
threshold- the sampling percentage in the range [0, 1].- Returns:
- true if we should sample in, false if we should sample out.
-