Examples of RandomDataGenerator


Examples of org.apache.commons.math3.random.RandomDataGenerator

    public NaturalRanking(NaNStrategy nanStrategy,
            RandomGenerator randomGenerator) {
        super();
        this.nanStrategy = nanStrategy;
        this.tiesStrategy = TiesStrategy.RANDOM;
        randomData = new RandomDataGenerator(randomGenerator);
    }
View Full Code Here

Examples of org.apache.commons.math3.random.RandomDataGenerator

    if (howMany >= howManyCombos) {
      Collections.shuffle(allCombinations);
      return allCombinations;
    }
    RandomDataGenerator rdg = new RandomDataGenerator(RandomManager.getRandom());
    int[] indices = rdg.nextPermutation(howManyCombos, howMany);
    List<List<Number>> result = new ArrayList<>(indices.length);
    for (int i = 0; i < indices.length; i++) {
      result.add(allCombinations.get(i));
    }
    Collections.shuffle(result);
View Full Code Here

Examples of org.apache.commons.math3.random.RandomDataGenerator

        System.out.println(generatedLong);
    }

    @Test
    public void givenUsingApacheCommons_whenGeneratingRandomLongUnbounded_thenCorrect() {
        final long generatedLong = new RandomDataGenerator().getRandomGenerator().nextLong();

        System.out.println(generatedLong);
    }
View Full Code Here

Examples of org.apache.commons.math3.random.RandomDataGenerator

    @Test
    public void givenUsingApacheCommons_whenGeneratingRandomLongBounded_thenCorrect() {
        final long leftLimit = 10L;
        final long rightLimit = 100L;
        final long generatedLong = new RandomDataGenerator().nextLong(leftLimit, rightLimit);

        System.out.println(generatedLong);
    }
View Full Code Here

Examples of org.apache.commons.math3.random.RandomDataGenerator

        System.out.println(generatedInteger);
    }

    @Test
    public void givenUsingApache_whenGeneratingRandomIntegerUnbounded_thenCorrect() {
        final Integer generatedInteger = new RandomDataGenerator().getRandomGenerator().nextInt();

        System.out.println(generatedInteger);
    }
View Full Code Here

Examples of org.apache.commons.math3.random.RandomDataGenerator

    @Test
    public void givenUsingApache_whenGeneratingRandomIntegerBounded_thenCorrect() {
        final int leftLimit = 1;
        final int rightLimit = 10;
        final int generatedInteger = new RandomDataGenerator().nextInt(leftLimit, rightLimit);

        System.out.println(generatedInteger);
    }
View Full Code Here

Examples of org.apache.commons.math3.random.RandomDataGenerator

        System.out.println(generatedFloat);
    }

    @Test
    public void givenUsingApache_whenGeneratingRandomFloatUnbounded_thenCorrect() {
        final float generatedFloat = new RandomDataGenerator().getRandomGenerator().nextFloat();

        System.out.println(generatedFloat);
    }
View Full Code Here

Examples of org.apache.commons.math3.random.RandomDataGenerator

    @Test
    public void givenUsingApache_whenGeneratingRandomFloatBounded_thenCorrect() {
        final float leftLimit = 1F;
        final float rightLimit = 10F;
        final float randomFloat = new RandomDataGenerator().getRandomGenerator().nextFloat();
        final float generatedFloat = leftLimit + randomFloat * (rightLimit - leftLimit);

        System.out.println(generatedFloat);
    }
View Full Code Here

Examples of org.apache.commons.math3.random.RandomDataGenerator

        System.out.println(generatedDouble);
    }

    @Test
    public void givenUsingApache_whenGeneratingRandomDoubleUnbounded_thenCorrect() {
        final double generatedDouble = new RandomDataGenerator().getRandomGenerator().nextDouble();

        System.out.println(generatedDouble);
    }
View Full Code Here

Examples of org.apache.commons.math3.random.RandomDataGenerator

    @Test
    public void givenUsingApache_whenGeneratingRandomDoubleBounded_thenCorrect() {
        final double leftLimit = 1D;
        final double rightLimit = 100D;
        final double generatedDouble = new RandomDataGenerator().nextUniform(leftLimit, rightLimit);

        System.out.println(generatedDouble);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.