All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.venky.clustering.MaxClustersCreated Maven / Gradle / Ivy

There is a newer version: 1.18
Show newest version
package com.venky.clustering;

import java.util.List;

public class MaxClustersCreated implements StopCriteria{

	int maxClusters = 1;
	public MaxClustersCreated(){
		this(2);
	}
	public MaxClustersCreated(int maxClusters){
		this.maxClusters = maxClusters;
		if (maxClusters < 1) {
			throw new IllegalArgumentException("MaxClusters must be a positive number");
		}
	}
	@Override
	public  boolean canStop(List> currentClusters) {
		return currentClusters.size() <= maxClusters ;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy