sleepTime = sleepTime + (long) (sleepTime * secureRandom.nextDouble());
/** Returns the next pseudorandom, uniformly distributed double value between 0.0 and 1.0 from this random number generator's sequence. */ public static double nextDouble() { return psuedoRng.nextDouble(); } /** Returns the next pseudorandom, uniformly distributed long value from
/** Returns the next pseudorandom, uniformly distributed double value between 0.0 and 1.0 from this random number generator's sequence. */ public static double nextDouble() { return psuedoRng.nextDouble(); } /** Returns the next pseudorandom, uniformly distributed long value from
@Override public double nextDouble( ) { return internalRand.nextDouble(); }
private static double createRandom(){ return randomGenerator.nextDouble(); //return Math.random(); //return new java.util.Random().nextDouble(); } /*private static int createRandom(int bound){
public double nextDouble() { return random.nextDouble(); } }
@Override public double nextDouble() { return random_.nextDouble(); }
public void stopDuration() { double sleepDuration = new SecureRandom().nextDouble() * 1000; try { Thread.sleep((long) sleepDuration); } catch (InterruptedException e) { // NO OP } }
static String generateRandomString(int length) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < length; i++) { int index = (int) (RANDOM.nextDouble() * CHARS.length()); builder.append(CHARS.substring(index, index + 1)); } return builder.toString(); }
static String generateRandomString(int length) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < length; i++) { int index = (int) (RANDOM.nextDouble() * CHARS.length()); builder.append(CHARS.substring(index, index + 1)); } return builder.toString(); }
public synchronized double nextDouble() { checkActive(); return secureRandom.nextDouble(); }
/** * {@inheritDoc} */ @Override public SecretKey engineGenerateKey() { if ( _randomSource == null ) _randomSource = new SecureRandom(); double x0 = _randomSource.nextDouble(); double a = NumericalUtility.toScaled( _randomSource.nextDouble(), 3.57, 4 ); double s = _randomSource.nextLong(); return new ChaosKeyImpl( x0, a, s ); }
private static RubyFixnum randomFixnum(final ThreadContext context, final long lower, final long upper) { double rnd = getSecureRandom(context).nextDouble(); rnd = rnd * upper + (1.0 - rnd) * lower + rnd; return context.runtime.newFixnum((long) Math.floor(rnd)); }
private static RubyFixnum randomFixnum(final ThreadContext context, final long lower, final long upper) { double rnd = getSecureRandom(context).nextDouble(); rnd = rnd * upper + (1.0 - rnd) * lower + rnd; return context.runtime.newFixnum((long) Math.floor(rnd)); }
private static RubyFloat randomDouble(final ThreadContext context, final double lower, final double upper) { double rnd = getSecureRandom(context).nextDouble(); return context.runtime.newFloat( rnd * upper + (1.0 - rnd) * lower ); }
/*package private*/ RandomizedTimeBasedFNATP( final SecureRandomProvider secureRandomProvider, final HostProvider hostProvider) { SecureRandom random; try { final String seed = hostProvider.get(); random = secureRandomProvider.get(seed.getBytes(StandardCharsets.UTF_8)); } catch (final UnknownHostException uhe) { random = secureRandomProvider.get(); } _randomNumber = random.nextDouble(); }
public RandomSelectionStrategy(Graph graph, double probability) { bitSet = new SimpleBitSet(Math.toIntExact(graph.nodeCount())); final SecureRandom random = new SecureRandom(); for (int i = 0; i < graph.nodeCount(); i++) { if (random.nextDouble() <= probability) { bitSet.put(i); } } size = bitSet.size(); }
public RandomSelectionStrategy(Graph graph, double probability) { bitSet = new SimpleBitSet(Math.toIntExact(graph.nodeCount())); final SecureRandom random = new SecureRandom(); for (int i = 0; i < graph.nodeCount(); i++) { if (random.nextDouble() <= probability) { bitSet.put(i); } } size = bitSet.size(); }
public void nextDouble(IPointable resultPointable) throws HyracksDataException { aDouble.setValue(random.nextDouble()); resultStorage.reset(); doubleSerde.serialize(aDouble, dataOutput); resultPointable.set(resultStorage); } }
@Override public void schedule(ActiveCheck<?,?> check) { // randomly distribute the initial delay long initialDelay = (long) (this.initialDelay.nextDouble() * ((double) check.getCurrentInterval())); logger.info("Scheduling " + check + " with interval " + check.getCurrentInterval() + " and initial delay " + initialDelay); this.scheduleJob(check.getId(), check.getSiteId(), check.getPool(), check.getCurrentInterval(), initialDelay, check.getTimePeriod(), new CheckRunner(check)); }