Package randomevents.generator

Examples of randomevents.generator.UniformRandomGenerator


            reliability = reliabilityComboBox.getValue();
        } catch (Exception ex) {
            print(ex.getMessage());
            return;
        }
        UniformRandomGenerator randomGenerator = new UniformRandomGenerator(r);
        Tourney tourney = new Tourney();
        tourney.go(archers, randomGenerator, n);
        System.out.println(tourney.getConfidenceInterval(reliability));
        pHitLabel.setText(Double.toString(tourney.getPHit()));
        confidenceIntervalLabel.setText(tourney.getConfidenceInterval(reliability));
View Full Code Here


        } catch (Exception ex) {
            print(ex.getMessage());
            return;
        }

        RandomGenerator randomGenerator = new UniformRandomGenerator(r);
        if (UsersRandomRadioButton.isSelected()) {
            randomGenerator = new UsersRandomGenerator(a, b);
            maxYlabel.setText(String.format("%6.2f", ((UsersRandomGenerator) randomGenerator).maxY));
        } else if (NormalCLTRadioButton.isSelected()) {
            randomGenerator = new NormalCLTRandomGenerator(m, d);
        } else if (NormalBoxMullerRadioButton.isSelected()) {
            randomGenerator = new NormalBoxMullerRandomGenerator(m, d, 0, 1);
        } else if (BeeInHiveRadioButton.isSelected()) {
            randomGenerator = new Hive(steps);
        }
        randoms = randomGenerator.randNumbers(count);

        updateHistograms();

        statistical.compute(randoms);
View Full Code Here

     * Test of rand method, of class UniformRandomGenerator.
     */
    @Test
    public void testRand() {
        System.out.println("rand");
        UniformRandomGenerator randomGenerator = new UniformRandomGenerator(0.11, 0.22, 0.15, 0.15, 0.27, 0.31);
        // Test 1
        double expectedResult = 0.21;
        double result = randomGenerator.rand();
        System.out.println(result);
        assertEquals(expectedResult, result, 0.0001);
        // Test 2
        expectedResult = 0.31;
        result = randomGenerator.rand();
        System.out.println(result);
        assertEquals(expectedResult, result, 0.001);
        // Test 3
        expectedResult = 0.4;
        result = randomGenerator.rand();
        System.out.println(result);
        assertEquals(expectedResult, result, 0.001);
        //fail("The test case is a prototype.");
    }
View Full Code Here

    @Test
    public void testMove() {
        System.out.println("bee move");
        int n = 5;
        Hive hive = new Hive(n);
        hive.setRandomGenerator(new UniformRandomGenerator(0.11, 0.22, 0.15, 0.15, 0.27, 0.31));
        double expResult = 3.0;
        double distance = hive.rand();
        System.out.println(distance);
        //assertEquals(expResult, distance);
        System.out.println("bee move 2");
        hive.setRandomGenerator(new UniformRandomGenerator(6));
         System.out.println(hive.rand());
    }
View Full Code Here

TOP

Related Classes of randomevents.generator.UniformRandomGenerator

Copyright © 2018 www.massapicom. 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.