/** * 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); }
/** * 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()); }
/** * 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); }
/** * 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(); }
/** * 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); }
/** * 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(); }
/** * 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(); }
/** * 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)); }
/** Creates new ValueServer */ public ValueServer() { randomData = new RandomDataGenerator(); }
/** * 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); }
/** * @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; }
return allCombinations; RandomDataGenerator rdg = new RandomDataGenerator(RandomManager.getRandom()); int[] indices = rdg.nextPermutation(howManyCombos, howMany); List<List<?>> result = new ArrayList<>(indices.length);
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(); }
/** * 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(); }
/** * 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); }
/** * 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)); }
/** * 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(); }
/** * 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); }
@Override public Date getRandomValue() { long minDateTime = minDate.getTime(); long maxDateTime = maxDate.getTime(); long randomDateTime = new RandomDataGenerator().nextLong(minDateTime, maxDateTime); return new Date(randomDateTime); }
@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); }