- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.commons.math3.distribution.ZipfDistribution.sample()
方法的一些代码示例,展示了ZipfDistribution.sample()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipfDistribution.sample()
方法的具体详情如下:
包路径:org.apache.commons.math3.distribution.ZipfDistribution
类名称:ZipfDistribution
方法名:sample
暂无
代码示例来源:origin: org.apache.commons/commons-math3
/**
* Generates a random value from the {@link ZipfDistribution Zipf Distribution}.
*
* @param numberOfElements the number of elements of the ZipfDistribution
* @param exponent the exponent of the ZipfDistribution
* @return random value sampled from the Zipf(numberOfElements, exponent) distribution
* @exception NotStrictlyPositiveException if {@code numberOfElements <= 0}
* or {@code exponent <= 0}.
*/
public int nextZipf(int numberOfElements, double exponent) throws NotStrictlyPositiveException {
return new ZipfDistribution(getRandomGenerator(), numberOfElements, exponent).sample();
}
代码示例来源:origin: apache/kylin
protected String prepareTestDate() throws IOException {
String[] allKeys = new String[KEY_SPACE];
for (int i = 0; i < KEY_SPACE; i++) {
allKeys[i] = RandomStringUtils.randomAlphabetic(10);
}
outputMsg("Start to create test random data...");
long startTime = System.currentTimeMillis();
ZipfDistribution zipf = new ZipfDistribution(KEY_SPACE, 0.5);
int keyIndex;
File tempFile = File.createTempFile("ZipfDistribution", ".txt");
if (tempFile.exists())
FileUtils.forceDelete(tempFile);
Writer fw = new OutputStreamWriter(new FileOutputStream(tempFile), StandardCharsets.UTF_8);
try {
for (int i = 0; i < TOTAL_RECORDS; i++) {
keyIndex = zipf.sample() - 1;
fw.write(allKeys[keyIndex]);
fw.write('\n');
}
} finally {
if (fw != null)
fw.close();
}
outputMsg("Create test data takes : " + (System.currentTimeMillis() - startTime) / 1000 + " seconds.");
outputMsg("Test data in : " + tempFile.getAbsolutePath());
return tempFile.getAbsolutePath();
}
代码示例来源:origin: johnlpage/POCDriver
private int getNextVal(int mult) {
int rval;
if (zipfian) {
rval = zipf.sample();
} else {
rval = (int) Math.abs(Math.floor(rng.nextDouble() * mult));
}
return rval;
}
代码示例来源:origin: Netflix/ndbench
@Override
public String getNextKey() {
int keyIndex = zipf.sample();
if (isPreLoadKeys()) {
return keys.get(keyIndex);
} else {
return "T" + keyIndex;
}
}
}
代码示例来源:origin: com.netflix.ndbench/ndbench-core
@Override
public String getNextKey() {
int keyIndex = zipf.sample();
if (isPreLoadKeys()) {
return keys.get(keyIndex);
} else {
return "T" + keyIndex;
}
}
}
代码示例来源:origin: geogebra/geogebra
/**
* Generates a random value from the {@link ZipfDistribution Zipf Distribution}.
*
* @param numberOfElements the number of elements of the ZipfDistribution
* @param exponent the exponent of the ZipfDistribution
* @return random value sampled from the Zipf(numberOfElements, exponent) distribution
* @exception NotStrictlyPositiveException if {@code numberOfElements <= 0}
* or {@code exponent <= 0}.
*/
public int nextZipf(int numberOfElements, double exponent) throws NotStrictlyPositiveException {
return new ZipfDistribution(getRandomGenerator(), numberOfElements, exponent).sample();
}
代码示例来源:origin: io.virtdata/virtdata-lib-realer
/**
* Generates a random value from the {@link ZipfDistribution Zipf Distribution}.
*
* @param numberOfElements the number of elements of the ZipfDistribution
* @param exponent the exponent of the ZipfDistribution
* @return random value sampled from the Zipf(numberOfElements, exponent) distribution
* @exception NotStrictlyPositiveException if {@code numberOfElements <= 0}
* or {@code exponent <= 0}.
*/
public int nextZipf(int numberOfElements, double exponent) throws NotStrictlyPositiveException {
return new ZipfDistribution(getRandomGenerator(), numberOfElements, exponent).sample();
}
本文整理了Java中org.apache.commons.math3.distribution.ZipfDistribution.inverseCumulativeProbability()方法的一些
本文整理了Java中org.apache.commons.math3.distribution.ZipfDistribution.generalizedHarmonic()方法的一些代码示例,展示了Z
本文整理了Java中org.apache.commons.math3.distribution.ZipfDistribution.probability()方法的一些代码示例,展示了ZipfDistr
本文整理了Java中org.apache.commons.math3.distribution.ZipfDistribution.()方法的一些代码示例,展示了ZipfDistribution.()的
本文整理了Java中org.apache.commons.math3.distribution.ZipfDistribution.calculateNumericalVariance()方法的一些代码
本文整理了Java中org.apache.commons.math3.distribution.ZipfDistribution.getNumberOfElements()方法的一些代码示例,展示了Z
本文整理了Java中org.apache.commons.math3.distribution.ZipfDistribution.calculateNumericalMean()方法的一些代码示例,展
本文整理了Java中org.apache.commons.math3.distribution.ZipfDistribution.sample()方法的一些代码示例,展示了ZipfDistributi
我想基于遵循 Zipf 分布的单词(来自字典)创建一个数据源(在 Java 中)。所以我来ZipfDistribution和 NormalDistribution Apache 公共(public)库
我是一名优秀的程序员,十分优秀!