update distributions to use new instantiators

This commit is contained in:
Jonathan Shook
2023-01-26 22:57:22 -06:00
parent 53832ec027
commit 562bde5b76
76 changed files with 194 additions and 150 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@ package io.nosqlbench.cqlgen.transformers;
import io.nosqlbench.cqlgen.core.CGKeyspaceStats;
import io.nosqlbench.cqlgen.core.CGSchemaStats;
import io.nosqlbench.cqlgen.core.CGTableStats;
import org.apache.commons.math4.util.Pair;
import org.apache.commons.math4.legacy.core.Pair;
import java.io.BufferedReader;
import java.io.IOException;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +24,22 @@ import static org.assertj.core.api.Assertions.assertThat;
public class GraalJsEvaluatorTest {
// TODO:
/**
* This evaluator may benefit from being compiled. Presently it give a warning:
* <pre>{@code
* [To redirect Truffle log output to a file use one of the following options:
* * '--log.file=<path>' if the option is passed using a guest language launcher.
* * '-Dpolyglot.log.file=<path>' if the option is passed using the host Java launcher.
* * Configure logging using the polyglot embedding API.]
* [engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation.
* The guest application code will therefore be executed in interpreted mode only.
* Execution only in interpreted mode will strongly impact the guest application performance.
* For more information on using GraalVM see https://www.graalvm.org/java/quickstart/.
* To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property.
* }</pre>
*/
@Test
public void testBasicOperations() {
GraalJsEvaluator<Long> ne = new GraalJsEvaluator<>(Long.class);

View File

@@ -154,6 +154,11 @@
<artifactId>commons-math4-legacy-exception</artifactId>
<version>4.0-beta1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-statistics-distribution</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>

View File

@@ -60,6 +60,28 @@
<artifactId>javapoet</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math4-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math4-legacy</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math4-legacy-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math4-legacy-exception</artifactId>
<version>4.0-beta1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-statistics-distribution</artifactId>
</dependency>
</dependencies>
<build>
<plugins>

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,6 @@ import org.apache.commons.statistics.distribution.BetaDistribution;
@ThreadSafeMapper
public class Beta extends IntToDoubleContinuousCurve {
public Beta(double alpha, double beta, String... mods) {
super(new BetaDistribution(alpha, beta), mods);
super(BetaDistribution.of(alpha, beta), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,6 @@ import org.apache.commons.statistics.distribution.CauchyDistribution;
@Categories({Category.distributions})
public class Cauchy extends IntToDoubleContinuousCurve {
public Cauchy(double median, double scale, String... mods) {
super(new CauchyDistribution(median, scale), mods);
super(CauchyDistribution.of(median, scale), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,6 @@ import org.apache.commons.statistics.distribution.ChiSquaredDistribution;
@Categories({Category.distributions})
public class ChiSquared extends IntToDoubleContinuousCurve {
public ChiSquared(double degreesOfFreedom, String... mods) {
super(new ChiSquaredDistribution(degreesOfFreedom), mods);
super(ChiSquaredDistribution.of(degreesOfFreedom), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@ package io.nosqlbench.virtdata.library.curves4.continuous.int_double;
import io.nosqlbench.virtdata.api.annotations.Categories;
import io.nosqlbench.virtdata.api.annotations.Category;
import io.nosqlbench.virtdata.api.annotations.ThreadSafeMapper;
import org.apache.commons.statistics.distribution.ConstantContinuousDistribution;
import org.apache.commons.math4.legacy.distribution.EmpiricalDistribution;
/**
* Always yields the same value.
@@ -32,6 +32,6 @@ import org.apache.commons.statistics.distribution.ConstantContinuousDistribution
@Categories({Category.distributions})
public class ConstantContinuous extends IntToDoubleContinuousCurve {
public ConstantContinuous(double value, String... mods) {
super(new ConstantContinuousDistribution(value), mods);
super(EmpiricalDistribution.from(1, new double[]{value}), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@ import io.nosqlbench.virtdata.api.annotations.Categories;
import io.nosqlbench.virtdata.api.annotations.Category;
import io.nosqlbench.virtdata.api.annotations.Example;
import io.nosqlbench.virtdata.api.annotations.ThreadSafeMapper;
import org.apache.commons.math4.distribution.EnumeratedRealDistribution;
import org.apache.commons.math4.legacy.distribution.EnumeratedRealDistribution;
/**
* Creates a probability density given the values and optional weights provided, in "value:weight value:weight ..." form.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,6 @@ import org.apache.commons.statistics.distribution.ExponentialDistribution;
@Categories({Category.distributions})
public class Exponential extends IntToDoubleContinuousCurve {
public Exponential(double mean, String... mods) {
super(new ExponentialDistribution(mean), mods);
super(ExponentialDistribution.of(mean), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,6 +34,6 @@ import org.apache.commons.statistics.distribution.FDistribution;
@Categories({Category.distributions})
public class F extends IntToDoubleContinuousCurve {
public F(double numeratorDegreesOfFreedom, double denominatorDegreesOfFreedom, String... mods) {
super(new FDistribution(numeratorDegreesOfFreedom, denominatorDegreesOfFreedom), mods);
super(FDistribution.of(numeratorDegreesOfFreedom, denominatorDegreesOfFreedom), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,6 @@ import org.apache.commons.statistics.distribution.GammaDistribution;
@Categories({Category.distributions})
public class Gamma extends IntToDoubleContinuousCurve {
public Gamma(double shape, double scale, String... mods) {
super(new GammaDistribution(shape, scale), mods);
super(GammaDistribution.of(shape, scale), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,6 @@ import org.apache.commons.statistics.distribution.GumbelDistribution;
@Categories({Category.distributions})
public class Gumbel extends IntToDoubleContinuousCurve {
public Gumbel(double mu, double beta, String... mods) {
super(new GumbelDistribution(mu, beta), mods);
super(GumbelDistribution.of(mu, beta), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,6 @@ import org.apache.commons.statistics.distribution.LaplaceDistribution;
@Categories({Category.distributions})
public class Laplace extends IntToDoubleContinuousCurve {
public Laplace(double mu, double beta, String... mods) {
super(new LaplaceDistribution(mu, beta), mods);
super(LaplaceDistribution.of(mu, beta), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,6 +30,6 @@ import org.apache.commons.statistics.distribution.LevyDistribution;
*/
@ThreadSafeMapper
@Categories({Category.distributions})
public class Levy extends IntToDoubleContinuousCurve { public Levy(double mu, double c, String... mods) { super(new LevyDistribution(mu,c), mods);
public class Levy extends IntToDoubleContinuousCurve { public Levy(double mu, double c, String... mods) { super(LevyDistribution.of(mu,c), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,6 @@ import org.apache.commons.statistics.distribution.LogNormalDistribution;
@Categories({Category.distributions})
public class LogNormal extends IntToDoubleContinuousCurve {
public LogNormal(double scale, double shape, String... mods) {
super(new LogNormalDistribution(scale, shape), mods);
super(LogNormalDistribution.of(scale, shape), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,6 @@ import org.apache.commons.statistics.distribution.LogisticDistribution;
@Categories({Category.distributions})
public class Logistic extends IntToDoubleContinuousCurve {
public Logistic(double mu, double scale, String... mods) {
super(new LogisticDistribution(mu, scale), mods);
super(LogisticDistribution.of(mu, scale), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,6 @@ import org.apache.commons.statistics.distribution.NakagamiDistribution;
@Categories({Category.distributions})
public class Nakagami extends IntToDoubleContinuousCurve {
public Nakagami(double mu, double omega, String... mods) {
super(new NakagamiDistribution(mu, omega), mods);
super(NakagamiDistribution.of(mu, omega), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,6 @@ import org.apache.commons.statistics.distribution.NormalDistribution;
@Categories({Category.distributions})
public class Normal extends IntToDoubleContinuousCurve {
public Normal(double mean, double sd, String... mods) {
super(new NormalDistribution(mean, sd), mods);
super(NormalDistribution.of(mean, sd), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,6 @@ import org.apache.commons.statistics.distribution.ParetoDistribution;
@Categories({Category.distributions})
public class Pareto extends IntToDoubleContinuousCurve {
public Pareto(double scale, double shape, String... mods) {
super(new ParetoDistribution(scale, shape), mods);
super(ParetoDistribution.of(scale, shape), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,6 @@ import org.apache.commons.statistics.distribution.TDistribution;
@Categories({Category.distributions})
public class T extends IntToDoubleContinuousCurve {
public T(double degreesOfFreedom, String... mods) {
super(new TDistribution(degreesOfFreedom), mods);
super(TDistribution.of(degreesOfFreedom), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,6 @@ import org.apache.commons.statistics.distribution.TriangularDistribution;
@Categories({Category.distributions})
public class Triangular extends IntToDoubleContinuousCurve {
public Triangular(double a, double c, double b, String... mods) {
super(new TriangularDistribution(a,c,b), mods);
super(TriangularDistribution.of(a,c,b), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,6 @@ import org.apache.commons.statistics.distribution.UniformContinuousDistribution;
@Categories({Category.distributions})
public class Uniform extends IntToDoubleContinuousCurve {
public Uniform(double lower, double upper, String... mods) {
super(new UniformContinuousDistribution(lower, upper), mods);
super(UniformContinuousDistribution.of(lower, upper), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,6 +34,6 @@ import org.apache.commons.statistics.distribution.WeibullDistribution;
@Categories({Category.distributions})
public class Weibull extends IntToDoubleContinuousCurve {
public Weibull(double alpha, double beta, String... mods) {
super(new WeibullDistribution(alpha, beta), mods);
super(WeibullDistribution.of(alpha, beta), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.BetaDistribution;
@ThreadSafeMapper
public class Beta extends LongToDoubleContinuousCurve {
public Beta(double alpha, double beta, String... mods) {
super(new BetaDistribution(alpha, beta), mods);
super(BetaDistribution.of(alpha, beta), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.CauchyDistribution;
@Categories({Category.distributions})
public class Cauchy extends LongToDoubleContinuousCurve {
public Cauchy(double median, double scale, String... mods) {
super(new CauchyDistribution(median, scale), mods);
super(CauchyDistribution.of(median, scale), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.ChiSquaredDistribution;
@Categories({Category.distributions})
public class ChiSquared extends LongToDoubleContinuousCurve {
public ChiSquared(double degreesOfFreedom, String... mods) {
super(new ChiSquaredDistribution(degreesOfFreedom), mods);
super(ChiSquaredDistribution.of(degreesOfFreedom), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,12 +19,12 @@ package io.nosqlbench.virtdata.library.curves4.continuous.long_double;
import io.nosqlbench.virtdata.api.annotations.Categories;
import io.nosqlbench.virtdata.api.annotations.Category;
import io.nosqlbench.virtdata.api.annotations.ThreadSafeMapper;
import org.apache.commons.statistics.distribution.ConstantContinuousDistribution;
import org.apache.commons.math4.legacy.distribution.EmpiricalDistribution;
@ThreadSafeMapper
@Categories({Category.distributions})
public class ConstantContinuous extends LongToDoubleContinuousCurve {
public ConstantContinuous(double value, String... mods) {
super(new ConstantContinuousDistribution(value), mods);
super(EmpiricalDistribution.from(1,new double[]{value}), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@ import io.nosqlbench.virtdata.api.annotations.Categories;
import io.nosqlbench.virtdata.api.annotations.Category;
import io.nosqlbench.virtdata.api.annotations.Example;
import io.nosqlbench.virtdata.api.annotations.ThreadSafeMapper;
import org.apache.commons.math4.distribution.EnumeratedRealDistribution;
import org.apache.commons.math4.legacy.distribution.EnumeratedRealDistribution;
@ThreadSafeMapper
@Categories({Category.distributions})

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.ExponentialDistribution;
@Categories({Category.distributions})
public class Exponential extends LongToDoubleContinuousCurve {
public Exponential(double mean, String... mods) {
super(new ExponentialDistribution(mean), mods);
super(ExponentialDistribution.of(mean), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.FDistribution;
@Categories({Category.distributions})
public class F extends LongToDoubleContinuousCurve {
public F(double numeratorDegreesOfFreedom, double denominatorDegreesOfFreedom, String... mods) {
super(new FDistribution(numeratorDegreesOfFreedom, denominatorDegreesOfFreedom), mods);
super(FDistribution.of(numeratorDegreesOfFreedom, denominatorDegreesOfFreedom), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.GammaDistribution;
@Categories({Category.distributions})
public class Gamma extends LongToDoubleContinuousCurve {
public Gamma(double shape, double scale, String... mods) {
super(new GammaDistribution(shape, scale), mods);
super(GammaDistribution.of(shape, scale), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,10 +21,11 @@ import io.nosqlbench.virtdata.api.annotations.Category;
import io.nosqlbench.virtdata.api.annotations.ThreadSafeMapper;
import org.apache.commons.statistics.distribution.GumbelDistribution;
@ThreadSafeMapper
@Categories({Category.distributions})
public class Gumbel extends LongToDoubleContinuousCurve {
public Gumbel(double mu, double beta, String... mods) {
super(new GumbelDistribution(mu, beta), mods);
super(GumbelDistribution.of(mu, beta), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.LaplaceDistribution;
@Categories({Category.distributions})
public class Laplace extends LongToDoubleContinuousCurve {
public Laplace(double mu, double beta, String... mods) {
super(new LaplaceDistribution(mu, beta), mods);
super(LaplaceDistribution.of(mu, beta), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,6 +23,6 @@ import org.apache.commons.statistics.distribution.LevyDistribution;
@ThreadSafeMapper
@Categories({Category.distributions})
public class Levy extends LongToDoubleContinuousCurve { public Levy(double mu, double c, String... mods) { super(new LevyDistribution(mu,c), mods);
public class Levy extends LongToDoubleContinuousCurve { public Levy(double mu, double c, String... mods) { super(LevyDistribution.of(mu,c), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.LogNormalDistribution;
@Categories({Category.distributions})
public class LogNormal extends LongToDoubleContinuousCurve {
public LogNormal(double scale, double shape, String... mods) {
super(new LogNormalDistribution(scale, shape), mods);
super(LogNormalDistribution.of(scale, shape), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.LogisticDistribution;
@Categories({Category.distributions})
public class Logistic extends LongToDoubleContinuousCurve {
public Logistic(double mu, double scale, String... mods) {
super(new LogisticDistribution(mu, scale), mods);
super(LogisticDistribution.of(mu, scale), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.NakagamiDistribution;
@Categories({Category.distributions})
public class Nakagami extends LongToDoubleContinuousCurve {
public Nakagami(double mu, double omega, String... mods) {
super(new NakagamiDistribution(mu, omega), mods);
super(NakagamiDistribution.of(mu, omega), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.NormalDistribution;
@Categories({Category.distributions})
public class Normal extends LongToDoubleContinuousCurve {
public Normal(double mean, double sd, String... mods) {
super(new NormalDistribution(mean, sd), mods);
super(NormalDistribution.of(mean, sd), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.ParetoDistribution;
@Categories({Category.distributions})
public class Pareto extends LongToDoubleContinuousCurve {
public Pareto(double scale, double shape, String... mods) {
super(new ParetoDistribution(scale, shape), mods);
super(ParetoDistribution.of(scale, shape), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.TDistribution;
@Categories({Category.distributions})
public class T extends LongToDoubleContinuousCurve {
public T(double degreesOfFreedom, String... mods) {
super(new TDistribution(degreesOfFreedom), mods);
super(TDistribution.of(degreesOfFreedom), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.TriangularDistribution;
@Categories({Category.distributions})
public class Triangular extends LongToDoubleContinuousCurve {
public Triangular(double a, double c, double b, String... mods) {
super(new TriangularDistribution(a,c,b), mods);
super(TriangularDistribution.of(a,c,b), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.UniformContinuousDistribution;
@Categories({Category.distributions})
public class Uniform extends LongToDoubleContinuousCurve {
public Uniform(double lower, double upper, String... mods) {
super(new UniformContinuousDistribution(lower, upper), mods);
super(UniformContinuousDistribution.of(lower, upper), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.WeibullDistribution;
@Categories({Category.distributions})
public class Weibull extends LongToDoubleContinuousCurve {
public Weibull(double alpha, double beta, String... mods) {
super(new WeibullDistribution(alpha, beta), mods);
super(WeibullDistribution.of(alpha, beta), mods);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,6 @@ import org.apache.commons.statistics.distribution.BinomialDistribution;
@Categories({Category.distributions})
public class Binomial extends IntToIntDiscreteCurve {
public Binomial(int trials, double p, String... modslist) {
super(new BinomialDistribution(trials, p), modslist);
super(BinomialDistribution.of(trials, p), modslist);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,6 @@ import org.apache.commons.statistics.distribution.GeometricDistribution;
@Categories({Category.distributions})
public class Geometric extends IntToIntDiscreteCurve {
public Geometric(double p, String... modslist) {
super(new GeometricDistribution(p), modslist);
super(GeometricDistribution.of(p), modslist);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,6 @@ import org.apache.commons.statistics.distribution.HypergeometricDistribution;
@Categories({Category.distributions})
public class Hypergeometric extends IntToIntDiscreteCurve {
public Hypergeometric(int populationSize, int numberOfSuccesses, int sampleSize, String... modslist) {
super(new HypergeometricDistribution(populationSize, numberOfSuccesses, sampleSize), modslist);
super(HypergeometricDistribution.of(populationSize, numberOfSuccesses, sampleSize), modslist);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,6 @@ import org.apache.commons.statistics.distribution.PascalDistribution;
@Categories({Category.distributions})
public class Pascal extends IntToIntDiscreteCurve {
public Pascal(int r, double p, String... modslist) {
super(new PascalDistribution(r, p), modslist);
super(PascalDistribution.of(r, p), modslist);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,6 @@ import org.apache.commons.statistics.distribution.PoissonDistribution;
@Categories({Category.distributions})
public class Poisson extends IntToIntDiscreteCurve {
public Poisson(double p, String... modslist) {
super(new PoissonDistribution(p), modslist);
super(PoissonDistribution.of(p), modslist);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.UniformDiscreteDistribution;
@Categories({Category.distributions})
public class Uniform extends IntToIntDiscreteCurve {
public Uniform(int lower, int upper, String... modslist) {
super(new UniformDiscreteDistribution(lower, upper), modslist);
super(UniformDiscreteDistribution.of(lower, upper), modslist);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,6 @@ import org.apache.commons.statistics.distribution.ZipfDistribution;
@Categories({Category.distributions})
public class Zipf extends IntToIntDiscreteCurve {
public Zipf(int numberOfElements, double exponent, String... modslist) {
super(new ZipfDistribution(numberOfElements, exponent), modslist);
super(ZipfDistribution.of(numberOfElements, exponent), modslist);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.BinomialDistribution;
@ThreadSafeMapper
public class Binomial extends IntToLongDiscreteCurve {
public Binomial(int trials, double p, String... modslist) {
super(new BinomialDistribution(trials, p), modslist);
super(BinomialDistribution.of(trials, p), modslist);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.GeometricDistribution;
@Categories({Category.distributions})
public class Geometric extends IntToLongDiscreteCurve {
public Geometric(double p, String... modslist) {
super(new GeometricDistribution(p), modslist);
super(GeometricDistribution.of(p), modslist);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.HypergeometricDistribution;
@Categories({Category.distributions})
public class Hypergeometric extends IntToLongDiscreteCurve {
public Hypergeometric(int populationSize, int numberOfSuccesses, int sampleSize, String... modslist) {
super(new HypergeometricDistribution(populationSize, numberOfSuccesses, sampleSize), modslist);
super(HypergeometricDistribution.of(populationSize, numberOfSuccesses, sampleSize), modslist);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.PascalDistribution;
@Categories({Category.distributions})
public class Pascal extends IntToLongDiscreteCurve {
public Pascal(int r, double p, String... modslist) {
super(new PascalDistribution(r, p), modslist);
super(PascalDistribution.of(r, p), modslist);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.PoissonDistribution;
@Categories({Category.distributions})
public class Poisson extends IntToLongDiscreteCurve {
public Poisson(double p, String... modslist) {
super(new PoissonDistribution(p), modslist);
super(PoissonDistribution.of(p), modslist);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.UniformDiscreteDistribution;
@Categories({Category.distributions})
public class Uniform extends IntToLongDiscreteCurve {
public Uniform(int lower, int upper, String... modslist) {
super(new UniformDiscreteDistribution(lower, upper), modslist);
super(UniformDiscreteDistribution.of(lower, upper), modslist);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.ZipfDistribution;
@Categories({Category.distributions})
public class Zipf extends IntToLongDiscreteCurve {
public Zipf(int numberOfElements, double exponent, String... modslist) {
super(new ZipfDistribution(numberOfElements, exponent), modslist);
super(ZipfDistribution.of(numberOfElements, exponent), modslist);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.BinomialDistribution;
@Categories({Category.distributions})
public class Binomial extends LongToIntDiscreteCurve {
public Binomial(int trials, double p, String... modslist) {
super(new BinomialDistribution(trials, p), modslist);
super(BinomialDistribution.of(trials, p), modslist);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.GeometricDistribution;
@Categories({Category.distributions})
public class Geometric extends LongToIntDiscreteCurve {
public Geometric(double p, String... modslist) {
super(new GeometricDistribution(p), modslist);
super(GeometricDistribution.of(p), modslist);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.HypergeometricDistribution;
@Categories({Category.distributions})
public class Hypergeometric extends LongToIntDiscreteCurve {
public Hypergeometric(int populationSize, int numberOfSuccesses, int sampleSize, String... modslist) {
super(new HypergeometricDistribution(populationSize, numberOfSuccesses, sampleSize), modslist);
super(HypergeometricDistribution.of(populationSize, numberOfSuccesses, sampleSize), modslist);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.PascalDistribution;
@Categories({Category.distributions})
public class Pascal extends LongToIntDiscreteCurve {
public Pascal(int r, double p, String... modslist) {
super(new PascalDistribution(r, p), modslist);
super(PascalDistribution.of(r, p), modslist);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.PoissonDistribution;
@Categories({Category.distributions})
public class Poisson extends LongToIntDiscreteCurve {
public Poisson(double p, String... modslist) {
super(new PoissonDistribution(p), modslist);
super(PoissonDistribution.of(p), modslist);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.UniformDiscreteDistribution;
@Categories({Category.distributions})
public class Uniform extends LongToIntDiscreteCurve {
public Uniform(int lower, int upper, String... modslist) {
super(new UniformDiscreteDistribution(lower, upper), modslist);
super(UniformDiscreteDistribution.of(lower, upper), modslist);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.ZipfDistribution;
@Categories({Category.distributions})
public class Zipf extends LongToIntDiscreteCurve {
public Zipf(int numberOfElements, double exponent, String... modslist) {
super(new ZipfDistribution(numberOfElements, exponent), modslist);
super(ZipfDistribution.of(numberOfElements, exponent), modslist);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.BinomialDistribution;
@Categories({Category.distributions})
public class Binomial extends LongToLongDiscreteCurve {
public Binomial(int trials, double p, String... modslist) {
super(new BinomialDistribution(trials, p), modslist);
super(BinomialDistribution.of(trials, p), modslist);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.GeometricDistribution;
@Categories({Category.distributions})
public class Geometric extends LongToLongDiscreteCurve {
public Geometric(double p, String... modslist) {
super(new GeometricDistribution(p), modslist);
super(GeometricDistribution.of(p), modslist);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.HypergeometricDistribution;
@Categories({Category.distributions})
public class Hypergeometric extends LongToLongDiscreteCurve {
public Hypergeometric(int populationSize, int numberOfSuccesses, int sampleSize, String... modslist) {
super(new HypergeometricDistribution(populationSize, numberOfSuccesses, sampleSize), modslist);
super(HypergeometricDistribution.of(populationSize, numberOfSuccesses, sampleSize), modslist);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.PascalDistribution;
@Categories({Category.distributions})
public class Pascal extends LongToLongDiscreteCurve {
public Pascal(int r, double p, String... modslist) {
super(new PascalDistribution(r, p), modslist);
super(PascalDistribution.of(r, p), modslist);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.PoissonDistribution;
@Categories({Category.distributions})
public class Poisson extends LongToLongDiscreteCurve {
public Poisson(double p, String... modslist) {
super(new PoissonDistribution(p), modslist);
super(PoissonDistribution.of(p), modslist);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.UniformDiscreteDistribution;
@Categories({Category.distributions})
public class Uniform extends LongToLongDiscreteCurve {
public Uniform(int lower, int upper, String... modslist) {
super(new UniformDiscreteDistribution(lower, upper), modslist);
super(UniformDiscreteDistribution.of(lower, upper), modslist);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,6 @@ import org.apache.commons.statistics.distribution.ZipfDistribution;
@Categories({Category.distributions})
public class Zipf extends LongToLongDiscreteCurve {
public Zipf(int numberOfElements, double exponent, String... modslist) {
super(new ZipfDistribution(numberOfElements, exponent), modslist);
super(ZipfDistribution.of(numberOfElements, exponent), modslist);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@ package io.nosqlbench.virtdata.library.curves4.continuous;
import io.nosqlbench.virtdata.library.curves4.continuous.long_double.Normal;
import io.nosqlbench.virtdata.library.curves4.continuous.long_double.Uniform;
import org.apache.commons.math4.stat.descriptive.DescriptiveStatistics;
import org.apache.commons.math4.legacy.stat.descriptive.DescriptiveStatistics;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.assertj.core.data.Offset;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,7 +35,7 @@ public class IntegerDistributionsBinomialSanity {
@Test
public void testBinomialMappedDist() {
DiscreteLongLongSampler b85 = new DiscreteLongLongSampler(new IntegerDistributionICDSource(
new BinomialDistribution(8, 0.5D)
BinomialDistribution.of(8, 0.5D)
),false);
assertThat(b85.applyAsLong(0L)).isEqualTo(0);
assertThat(b85.applyAsLong(Long.MAX_VALUE)).isEqualTo(8);
@@ -76,7 +76,7 @@ public class IntegerDistributionsBinomialSanity {
@Test
public void showBinomialICDF() {
DiscreteLongLongSampler b85 = new DiscreteLongLongSampler(new IntegerDistributionICDSource(
new BinomialDistribution(8,0.5D)),false);
BinomialDistribution.of(8,0.5D)),false);
for (int i = 0; i < 1000; i++) {
double factor=((double) i / 1000D);
long v = b85.applyAsLong((long) (factor * (double) Long.MAX_VALUE));

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -40,7 +40,7 @@ public class IntegerDistributionsConcurrencyTest {
@Test
public void testBinomialICDR() {
Offset<Double> offset = Offset.offset(0.00001d);
BinomialDistribution distribution = new BinomialDistribution(8, 0.5);
BinomialDistribution distribution = BinomialDistribution.of(8, 0.5);
assertThat(distribution.probability(0)).isCloseTo(0.00390d, offset);
assertThat(distribution.probability(1)).isCloseTo(0.03125d, offset);
assertThat(distribution.probability(2)).isCloseTo(0.10937d, offset);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@ package io.nosqlbench.virtdata.library.curves4.discrete;
import io.nosqlbench.virtdata.library.curves4.continuous.long_double.Uniform;
import io.nosqlbench.virtdata.library.curves4.discrete.long_long.Zipf;
import org.apache.commons.math4.stat.descriptive.DescriptiveStatistics;
import org.apache.commons.math4.legacy.stat.descriptive.DescriptiveStatistics;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.assertj.core.data.Offset;