cs195z.cluster
Class CStudentKMeans<T extends Number,E extends Serializable>

java.lang.Object
  extended by cs195z.support.CAbstractAlgorithm<T,E>
      extended by cs195z.cluster.CStudentKMeans<T,E>
All Implemented Interfaces:
CAlgorithm<T,E>, Runnable

public class CStudentKMeans<T extends Number,E extends Serializable>
extends CAbstractAlgorithm<T,E>

Comments

Author:
[your login]

Constructor Summary
CStudentKMeans(List<CElement<T,E>> items, int k)
          Please do not modify this constructor.
 
Method Summary
 Iterable<Iterable<CElement<T,E>>> getResult()
          The standard issue method is probably ok, assuming you assign an Iterable>> to _result.
 void init()
          Does all of the work of the algorithm before the main loop.
 boolean step()
          Performs the main iteration of the algorithm.
 
Methods inherited from class cs195z.support.CAbstractAlgorithm
clickStepped, complete, run
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CStudentKMeans

public CStudentKMeans(List<CElement<T,E>> items,
                      int k)
Please do not modify this constructor. It retains your parameters.

Parameters:
items - - set of elements to cluster
k - - parameter k from algorithm
Method Detail

init

public void init()
Description copied from interface: CAlgorithm
Does all of the work of the algorithm before the main loop. Predominantly preprocessing.


step

public boolean step()
Description copied from interface: CAlgorithm
Performs the main iteration of the algorithm. Exactly once.

Returns:
true if the algorithm is not complete, false if you have hit a termination condition

getResult

public Iterable<Iterable<CElement<T,E>>> getResult()
The standard issue method is probably ok, assuming you assign an Iterable>> to _result. This could be a LinkedList of LinkedLists for example.

Returns:
an iterable of clusters that has an iterable collection of elements