All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.nosqlbench.virtdata.library.curves4.discrete.common.IntegerDistributionICDSource Maven / Gradle / Ivy

There is a newer version: 4.15.102
Show newest version
package io.nosqlbench.virtdata.library.curves4.discrete.common;

import org.apache.commons.statistics.distribution.DiscreteDistribution;

import java.util.function.DoubleToIntFunction;

public class IntegerDistributionICDSource implements DoubleToIntFunction {

    private DiscreteDistribution integerDistribution;

    public IntegerDistributionICDSource(DiscreteDistribution integerDistribution) {
        this.integerDistribution = integerDistribution;
    }

    @Override
    public int applyAsInt(double value) {
        return integerDistribution.inverseCumulativeProbability(value);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy