public ArrayList<FrameSet> partition(String partitionType, int partitionOption){
		//System.out.println("Partitioning.");
		
		// Generate set number of partitions.
		
		int itemsPerPartition = 0;
		int numberOfPartitions = 0;
		
		if (partitionType.equalsIgnoreCase("numberPartitions")){
			
			itemsPerPartition = this.size / partitionOption;
			if(itemsPerPartition == 0) {
				numberOfPartitions = this.size;
				itemsPerPartition = 1;
			}else{
				numberOfPartitions = partitionOption;
			}
			
		}else if(partitionType.equalsIgnoreCase("partitionSize")){
			
			if (partitionOption > this.size){
				itemsPerPartition = this.size;
				numberOfPartitions = 1;
			}else{
				numberOfPartitions = (int) Math.ceil((double) this.size / partitionOption);
				itemsPerPartition = partitionOption;
			}
			
		}else{
			throw new IllegalArgumentException("partitionType can only equal 'numberPartitions' or 'partitionSize'.");
		}
		//System.out.println(itemsPerPartition);
		//System.out.println(numberOfPartitions);
			
		ArrayList<FrameSet> partitions = new ArrayList<FrameSet>(numberOfPartitions);
		List<ArrayRealVector> source = permuteList(frameSet);
		
		for(int i = 0; i < numberOfPartitions; i++){
			ArrayList<ArrayRealVector> subset = new ArrayList<ArrayRealVector>();
			int addUntil = Math.min(i+itemsPerPartition, this.size);
			for(int j = i; j < addUntil; j++){
				subset.add(source.get(j));
			}
			partitions.add(new FrameSet(subset));
		}
		
		return partitions;
	}