Package com.puppetlabs.geppetto.common.stats

Examples of com.puppetlabs.geppetto.common.stats.IntegerCluster


  }

  @Test
  public void test_Cluster3() {
    IntegerCluster cluster = new IntegerCluster(20);
    int[] values = new int[] { 1, 2, 3, 4, 5, 14, 27, 28, 50, 51, 52 };
    int[] expectedClusterMax = new int[] { 14, 14, 14, 14, 14, 14, 28, 28, 52, 52, 52 };
    for(int i = 0; i < values.length; i++)
      cluster.add(values[i]);

    assertEquals("Expected number of clusters", 3, cluster.getClusterCount());
    for(int i = 0; i < values.length; i++)
      assertEquals(
        "Expecte max of cluster is not correct for: " + i, expectedClusterMax[i], cluster.clusterMax(values[i]));

  }
View Full Code Here

TOP

Related Classes of com.puppetlabs.geppetto.common.stats.IntegerCluster

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.