Skip to content
Permalink
Browse files
Add TSampler to continuous sampler performance JMH example
  • Loading branch information
aherbert committed Mar 2, 2022
1 parent 7019a2f commit de8c604c59fff097a1e14a9b925e30bf63ec81fb
Showing 1 changed file with 5 additions and 1 deletion.
@@ -30,6 +30,7 @@
import org.apache.commons.rng.sampling.distribution.LogNormalSampler;
import org.apache.commons.rng.sampling.distribution.MarsagliaNormalizedGaussianSampler;
import org.apache.commons.rng.sampling.distribution.StableSampler;
import org.apache.commons.rng.sampling.distribution.TSampler;
import org.apache.commons.rng.sampling.distribution.ZigguratSampler;
import org.apache.commons.rng.sampling.distribution.ZigguratNormalizedGaussianSampler;

@@ -91,7 +92,8 @@ public static class Sources extends RandomSources {
"ChengBetaSampler",
"ContinuousUniformSampler",
"InverseTransformParetoSampler",
"StableSampler"})
"StableSampler",
"TSampler"})
private String samplerType;

/** The sampler. */
@@ -146,6 +148,8 @@ public void setup() {
sampler = InverseTransformParetoSampler.of(rng, 23.45, 0.1234);
} else if ("StableSampler".equals(samplerType)) {
sampler = StableSampler.of(rng, 1.3, 0.2);
} else if ("TSampler".equals(samplerType)) {
sampler = TSampler.of(rng, 1.23);
}
}
}

0 comments on commit de8c604

Please sign in to comment.