some+code+as+of+071412_1500

public ItemData findEverythingSimilarToItemI(int i) { ArrayList items_similar_to_I = new ArrayList;

ArrayList scores_similar_to_I = new ArrayList;

ArrayList list_of_other_items_to_findEverythingSimilarToItemI = new ArrayList; int item_with_best_similarity_score = 0; double best_average_similarity_score = 0;

//Here the program will "pretend" that it is moving through the modifiable list in the form of a matrix to go acrossed the row for i and determine which things are similar. In order to accomplish this, values from the modifiable list have to be retrieved in a special wayl. int row_number = i; for(int column_count=0; column_countthreshold) { items_similar_to_I.add(column_count); scores_similar_to_I.add(current_score); items_already_in_groups.add(column_count);// now delete the score from the modifiable list ((ArrayList)modifiable_list.get(column_count)).set(row_number-2-column_count+1,-1); } } else if(column_count>row_number) { double current_score = Double.valueOf(((ArrayList)modifiable_list.get(row_number)).get(column_count-row_number-1).toString).doubleValue; if(current_score>threshold) { items_similar_to_I.add(column_count); scores_similar_to_I.add(current_score); items_already_in_groups.add(column_count); //now delete the score from the modifiable list ((ArrayList)modifiable_list.get(row_number)).set(column_count-row_number-1,-1); } } }

double average_similarity = 0; if(scores_similar_to_I.size>0) { for(int j=0; j<scores_similar_to_I.size; j++) { average_similarity+=Double.valueOf(scores_similar_to_I.get(j).toString).doubleValue; } average_similarity = average_similarity/scores_similar_to_I.size; } best_average_similarity_score = average_similarity; item_with_best_similarity_score = i;//

now go through and find the items similar to all of the items that were similar to i for(int j=0; javerage_similarity) { best_average_similarity_score = comparison_average; item_with_best_similarity_score = item_data.getItemWithBestScore; } items_similar_to_I.add(item_data.getList); items_similar_to_I = useful_tools.flattenList(items_similar_to_I); items_similar_to_I = useful_tools.removeDuplicates(items_similar_to_I); }

items_similar_to_I.add(i); //now summarize and package all of the information so that it can be returned as some item data ItemData return_item_data = new ItemData(best_average_similarity_score, items_similar_to_I, item_with_best_similarity_score); return return_item_data; }