Examples of addOccurrence()


Examples of edu.brown.mappings.RatioMapping.addOccurrence()

        }
        assertEquals(1.0d, roundToDecimals(p.calculate(), 1));
       
        p.clear();
        for (int i = 0; i < num_samples; i++) {
            p.addOccurrence(Double.MIN_VALUE, Double.MIN_VALUE);
        }
        assertEquals(1.0d, roundToDecimals(p.calculate(), 1));
    }

    /**
 
View Full Code Here

Examples of edu.brown.mappings.RatioMapping.addOccurrence()

     * testRandomCorrelation
     */
    public void testRandomCorrelation() {
        RatioMapping p = new RatioMapping();
        for (int i = 0; i < num_samples; i++) {
            p.addOccurrence(i, (this.rand.nextDouble() - 0.5) * i);
        }
        assertTrue(Math.abs(p.calculate()) < 0.1);
    }

    /**
 
View Full Code Here

Examples of edu.brown.mappings.RatioMapping.addOccurrence()

     * testHalf
     */
    public void testHalf() {
        RatioMapping p = new RatioMapping();
        for (int i = 0; i < num_samples; i++) {
            p.addOccurrence(-1, (this.rand.nextDouble()) * i);
        }
        for (int i = 0; i < num_samples; i++) {
            p.addOccurrence(i, i);
        }
        assertEquals(0.5, roundToDecimals(p.calculate(), 1));
View Full Code Here

Examples of edu.brown.mappings.RatioMapping.addOccurrence()

        RatioMapping p = new RatioMapping();
        for (int i = 0; i < num_samples; i++) {
            p.addOccurrence(-1, (this.rand.nextDouble()) * i);
        }
        for (int i = 0; i < num_samples; i++) {
            p.addOccurrence(i, i);
        }
        assertEquals(0.5, roundToDecimals(p.calculate(), 1));
    }
}
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.