Package views

Examples of views.Cluster


  }
 
  @Override
  public void run() {
    for(int i = 0; i< clusters.length ; ++i){
      clusters[i] = new Cluster(randomPick());
    }
    for(Star s : stars){
      double min = d.get(s, clusters[0].getCentroid());
      int index = 0;
      for(int i = 1; i< clusters.length ; ++i){
View Full Code Here


  @Override
  public void run() {
    LinkedList<Cluster> clusterList = new LinkedList<>();
    int size;
    for(Star s : stars){
      clusterList.addFirst(new Cluster(s));
   
    size = clusterList.size();
    Cluster current, toBeMerged = null;
    while(size > k){
      int index = (int) (Math.random() * size);
      current = clusterList.remove(index);
      double min = Double.MAX_VALUE;
      for(Cluster c : clusterList){
        double currentDist = d.get(current.getCentroid(), c.getCentroid());
        if(currentDist < min){
          min = currentDist;
          toBeMerged = c;
        }
      }
View Full Code Here

TOP

Related Classes of views.Cluster

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.