org.apache.commons.math3.random.RandomDataGenerator.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(91)

本文整理了Java中org.apache.commons.math3.random.RandomDataGenerator.<init>方法的一些代码示例,展示了RandomDataGenerator.<init>的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RandomDataGenerator.<init>方法的具体详情如下:
包路径:org.apache.commons.math3.random.RandomDataGenerator
类名称:RandomDataGenerator
方法名:<init>

RandomDataGenerator.<init>介绍

[英]Construct a RandomDataGenerator, using a default random generator as the source of randomness.

The default generator is a Well19937c seeded with System.currentTimeMillis() + System.identityHashCode(this)). The generator is initialized and seeded on first use.
[中]使用默认的随机生成器作为随机性源,构造一个RandomDataGenerator。
默认的生成器是一个Well19937c种子系统。currentTimeMillis()+系统。identityHashCode(这个)。生成器在首次使用时进行初始化和种子设定。

代码示例

代码示例来源:origin: org.apache.commons/commons-math3

/**
 * Create a NaturalRanking with TiesStrategy.RANDOM and the given
 * RandomGenerator as the source of random data.
 *
 * @param randomGenerator source of random data
 */
public NaturalRanking(RandomGenerator randomGenerator) {
  super();
  this.tiesStrategy = TiesStrategy.RANDOM;
  nanStrategy = DEFAULT_NAN_STRATEGY;
  randomData = new RandomDataGenerator(randomGenerator);
}

代码示例来源:origin: org.apache.commons/commons-math3

/**
 * Creates a new EmpiricalDistribution with the specified bin count.
 *
 * @param binCount number of bins. Must be strictly positive.
 * @throws NotStrictlyPositiveException if {@code binCount <= 0}.
 */
public EmpiricalDistribution(int binCount) {
  this(binCount, new RandomDataGenerator());
}

代码示例来源:origin: org.apache.commons/commons-math3

/**
 * Construct a ValueServer instance using a RandomGenerator as its source
 * of random data.
 *
 * @since 3.1
 * @param generator source of random data
 */
public ValueServer(RandomGenerator generator) {
  this.randomData = new RandomDataGenerator(generator);
}

代码示例来源:origin: org.apache.commons/commons-math3

/**
 * Construct a RandomDataImpl, using a default random generator as the source
 * of randomness.
 *
 * <p>The default generator is a {@link Well19937c} seeded
 * with {@code System.currentTimeMillis() + System.identityHashCode(this))}.
 * The generator is initialized and seeded on first use.</p>
 */
public RandomDataImpl() {
  delegate = new RandomDataGenerator();
}

代码示例来源:origin: org.apache.commons/commons-math3

/**
 * Construct a RandomDataImpl using the supplied {@link RandomGenerator} as
 * the source of (non-secure) random data.
 *
 * @param rand the source of (non-secure) random data
 * (may be null, resulting in the default generator)
 * @since 1.1
 */
public RandomDataImpl(RandomGenerator rand) {
  delegate = new RandomDataGenerator(rand);
}

代码示例来源:origin: org.apache.commons/commons-math3

/**
 * Create a NaturalRanking with the given TiesStrategy.
 *
 * @param tiesStrategy the TiesStrategy to use
 */
public NaturalRanking(TiesStrategy tiesStrategy) {
  super();
  this.tiesStrategy = tiesStrategy;
  nanStrategy = DEFAULT_NAN_STRATEGY;
  randomData = new RandomDataGenerator();
}

代码示例来源:origin: org.apache.commons/commons-math3

/**
 * Create a NaturalRanking with the given NaNStrategy and TiesStrategy.
 *
 * @param nanStrategy NaNStrategy to use
 * @param tiesStrategy TiesStrategy to use
 */
public NaturalRanking(NaNStrategy nanStrategy, TiesStrategy tiesStrategy) {
  super();
  this.nanStrategy = nanStrategy;
  this.tiesStrategy = tiesStrategy;
  randomData = new RandomDataGenerator();
}

代码示例来源:origin: org.apache.commons/commons-math3

/**
 * Creates a new EmpiricalDistribution with the specified bin count using the
 * provided {@link RandomGenerator} as the source of random data.
 *
 * @param binCount number of bins. Must be strictly positive.
 * @param generator random data generator (may be null, resulting in default JDK generator)
 * @throws NotStrictlyPositiveException if {@code binCount <= 0}.
 * @since 3.0
 */
public EmpiricalDistribution(int binCount, RandomGenerator generator) {
  this(binCount, new RandomDataGenerator(generator));
}

代码示例来源:origin: org.apache.commons/commons-math3

/** Creates new ValueServer */
public ValueServer() {
  randomData = new RandomDataGenerator();
}

代码示例来源:origin: org.apache.commons/commons-math3

/**
 * Create a NaturalRanking with the given NaNStrategy, TiesStrategy.RANDOM
 * and the given source of random data.
 *
 * @param nanStrategy NaNStrategy to use
 * @param randomGenerator source of random data
 */
public NaturalRanking(NaNStrategy nanStrategy,
    RandomGenerator randomGenerator) {
  super();
  this.nanStrategy = nanStrategy;
  this.tiesStrategy = TiesStrategy.RANDOM;
  randomData = new RandomDataGenerator(randomGenerator);
}

代码示例来源:origin: OryxProject/oryx

/**
 * @param ranges ranges of hyperparameters to try, one per hyperparameters
 * @param howMany how many combinations of hyperparameters to return
 * @return combinations of concrete hyperparameter values
 */
static List<List<?>> chooseHyperParameterCombos(Collection<? extends HyperParamValues<?>> ranges, int howMany) {
 Preconditions.checkArgument(howMany > 0);
 int numParams = ranges.size();
 if (numParams == 0) {
  return Collections.singletonList(Collections.emptyList());
 }
 
 RandomDataGenerator rdg = new RandomDataGenerator(RandomManager.getRandom());
 List<List<?>> allCombinations = new ArrayList<>(howMany);
 for (int i = 0; i < howMany; i++) {
  List<Object> combination = new ArrayList<>(numParams);
  for (HyperParamValues<?> range : ranges) {
   combination.add(range.getRandomValue(rdg));
  }
  allCombinations.add(combination);
 }
 return allCombinations;
}

代码示例来源:origin: OryxProject/oryx

return allCombinations;
RandomDataGenerator rdg = new RandomDataGenerator(RandomManager.getRandom());
int[] indices = rdg.nextPermutation(howManyCombos, howMany);
List<List<?>> result = new ArrayList<>(indices.length);

代码示例来源:origin: apache/phoenix

public RulesApplier(XMLConfigParser parser, long seed) {
  this.parser = parser;
  this.modelList = new ArrayList<Map>();
  this.columnMap = new HashMap<String, Column>();
  this.rndNull = new Random(seed);
  this.rndVal = new Random(seed);
  this.randomDataGenerator = new RandomDataGenerator();
  this.cachedScenarioOverrideName = null;
  populateModelList();
}

代码示例来源:origin: geogebra/geogebra

/**
 * Create a NaturalRanking with the given TiesStrategy.
 *
 * @param tiesStrategy the TiesStrategy to use
 */
public NaturalRanking(TiesStrategy tiesStrategy) {
  super();
  this.tiesStrategy = tiesStrategy;
  nanStrategy = DEFAULT_NAN_STRATEGY;
  randomData = new RandomDataGenerator();
}

代码示例来源:origin: geogebra/geogebra

/**
 * Create a NaturalRanking with TiesStrategy.RANDOM and the given
 * RandomGenerator as the source of random data.
 *
 * @param randomGenerator source of random data
 */
public NaturalRanking(RandomGenerator randomGenerator) {
  super();
  this.tiesStrategy = TiesStrategy.RANDOM;
  nanStrategy = DEFAULT_NAN_STRATEGY;
  randomData = new RandomDataGenerator(randomGenerator);
}

代码示例来源:origin: geogebra/geogebra

/**
 * Creates a new EmpiricalDistribution with the specified bin count using the
 * provided {@link RandomGenerator} as the source of random data.
 *
 * @param binCount number of bins. Must be strictly positive.
 * @param generator random data generator (may be null, resulting in default JDK generator)
 * @throws NotStrictlyPositiveException if {@code binCount <= 0}.
 * @since 3.0
 */
public EmpiricalDistribution(int binCount, RandomGenerator generator) {
  this(binCount, new RandomDataGenerator(generator));
}

代码示例来源:origin: geogebra/geogebra

/**
 * Create a NaturalRanking with the given NaNStrategy and TiesStrategy.
 *
 * @param nanStrategy NaNStrategy to use
 * @param tiesStrategy TiesStrategy to use
 */
public NaturalRanking(NaNStrategy nanStrategy, TiesStrategy tiesStrategy) {
  super();
  this.nanStrategy = nanStrategy;
  this.tiesStrategy = tiesStrategy;
  randomData = new RandomDataGenerator();
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

/**
 * Create a NaturalRanking with TiesStrategy.RANDOM and the given
 * RandomGenerator as the source of random data.
 *
 * @param randomGenerator source of random data
 */
public NaturalRanking(RandomGenerator randomGenerator) {
  super();
  this.tiesStrategy = TiesStrategy.RANDOM;
  nanStrategy = DEFAULT_NAN_STRATEGY;
  randomData = new RandomDataGenerator(randomGenerator);
}

代码示例来源:origin: io.github.benas/jpopulator

@Override
public Date getRandomValue() {
  long minDateTime = minDate.getTime();
  long maxDateTime = maxDate.getTime();
  long randomDateTime = new RandomDataGenerator().nextLong(minDateTime, maxDateTime);
  return new Date(randomDateTime);
}

代码示例来源:origin: io.github.benas/jpopulator

@Override
public <T> List<T> populateBeans(final Class<T> type, final String... excludedFields) {
  int size = new RandomDataGenerator().nextInt(1, Short.MAX_VALUE);
  return populateBeans(type, size, excludedFields);
}

相关文章

微信公众号

最新文章

更多