public KMeans(int clusterNumber, int maxIter, String path) 
		throws ClusterException {
		
		if(clusterNumber <= 0)
			throw new ClusterException("The number of clusters can't be negative!");
		
		if(maxIter < 1)
			throw new ClusterException("Must iterate at least once!");
		
		if(path == null || path.equals(""))
			throw new ClusterException("The pathname can't be null or empty");
		
		try {
			this.log= KmeansLogger.getInstance().getLog();
		} catch (LogException e) {
			throw new ClusterException("LogException "+e.getMessage(), e);
		}
		
		this.clusterNumber= clusterNumber;
		this.maxIter= maxIter;
		this.songList= new ArrayList<Song>();
				
		// loads the songs list and returns the number of dimensions
		int dimensions= this.loadSongs(path);
		
		if (this.songList.size() < this.clusterNumber)
			throw new ClusterException("The number of files can't be less than the number of clusters!");

		this.clusterList= new ArrayList<Cluster>();
		
		for(int i= 0; i< this.clusterNumber; ++i) {
			Cluster c= new Cluster(i, dimensions);
			this.clusterList.add(c);
		}
		
		
		this.init();
	
	}