public Vector<Case> getNearestNeighbors(Case NewCase, String type, double []Attributesweights)
	{
		Vector<Case> neighbors = new Vector<Case>();
		Vector<Double> distances = new Vector<Double>();
		Vector<DistanceCase> sortingCases = new Vector<DistanceCase>();
		
		
		if (type=="Euclidean Distance")
		{
			
			for (int i=0; i< LibraryClosestCases.size(); i++)
			{
				Case instance = LibraryClosestCases.get(i);
				double distance = getDistanceEuclidean(instance,NewCase);
				sortingCases.add(new DistanceCase(instance,distance));		
			}
		}	
		else if (type=="Euclidean Distance with attribute weights")
		{
			
			for (int i=0; i< LibraryClosestCases.size(); i++)
			{
				Case instance = LibraryClosestCases.get(i);
				double distance = getDistanceEuclideanW(instance,NewCase,Attributesweights);
				sortingCases.add(new DistanceCase(instance,distance));		
			}
		}
		
		
		
		Collections.sort(sortingCases);
		
		for (int i=0; i<k; i++)
		{
            neighbors.add(sortingCases.get(i).getCase());
		}

        //return the k nearest neighbors
        return neighbors;
			
	}