BicepBuddyApp/src/main/java/Matching/MatchAlgorithm.java
@SuppressWarnings("deprecation")
	public static Integer calculateRatios(User other) {
		List<List<Integer>> ratios = new ArrayList<>(5);
		for (int i = 0; i < PRIORITYCOUNT; i++) {
			ratios.add(new ArrayList<Integer>());
		}
		//Pref Gender ratio
		ratios.get(prefGenderPriority.ordinal()).add(new Integer(calculateRatio(
				GENDERS.length,
				Arrays.asList(GENDERS).indexOf(UserController.getUser().getPrefGender()),
				Arrays.asList(GENDERS).indexOf(other.getPrefGender()))));
		//Weight ratio
		ratios.get(weightPriority.ordinal()).add(new Integer(calculateRatio(
				WEIGHTCLASS.length,
				Arrays.asList(WEIGHTCLASS).indexOf(UserController.getUser().getWeight()),
				Arrays.asList(WEIGHTCLASS).indexOf(other.getWeight()))));
		//Style ratio
		ratios.get(stylePriority.ordinal()).add(new Integer(calculateRatio(
				STYLES.length,
				Arrays.asList(STYLES).indexOf(UserController.getUser().getStyle()),
				Arrays.asList(STYLES).indexOf(other.getStyle()))));
		//Times ratio
		ratios.get(timePriority.ordinal()).add(new Integer(calculateRatio(
				TIMES.length,
				Arrays.asList(TIMES).indexOf(UserController.getUser().getTimeOfDay()),
				Arrays.asList(TIMES).indexOf(other.getTimeOfDay()))));
		//Frequency ratio
		ratios.get(freqPriority.ordinal()).add(new Integer(calculateRatio(
				FREQUENCIES.length,
				Arrays.asList(FREQUENCIES).indexOf(UserController.getUser().getFrequency()),
				Arrays.asList(FREQUENCIES).indexOf(other.getFrequency()))));
		//Goals ratio
		ratios.get(goalPriority.ordinal()).add(new Integer(calculateRatio(
				GOALS.length,
				Arrays.asList(GOALS).indexOf(UserController.getUser().getGoals()),
				Arrays.asList(GOALS).indexOf(other.getGoals()))));
		//Experience ratio
		ratios.get(expPriority.ordinal()).add(new Integer(calculateRatio(
				EXPERIENCE.length,
				Arrays.asList(EXPERIENCE).indexOf(UserController.getUser().getExperience()),
				Arrays.asList(EXPERIENCE).indexOf(other.getExperience()))));

		List<Integer> finals = new ArrayList<>();
		for (int i = 0; i < PRIORITYCOUNT; i++) {
			int sum = 0;
			for (Integer c : ratios.get(i)) {
				sum += c;
			}
			finals.add(sum / ratios.get(i).size());
		}

		Integer result = 0;
		for (Integer i : finals) {
			result += i;
		}

		result /= PRIORITYCOUNT;
		return result;
	}
/**
	 * Calculate ratios all matches.
	 *
	 * @param other the other
	 * @return the integer
	 */
Calculate ratios all matches.
@param other the other
@return the integer
Calculate ratios all matches . @param other the other @return the integer
@SuppressWarnings("deprecation")
	public static Integer calculateRatios(User other) {
		List<List<Integer>> ratios = new ArrayList<>(5);
		for (int i = 0; i < PRIORITYCOUNT; i++) {
			ratios.add(new ArrayList<Integer>());
		}
		ratios.get(prefGenderPriority.ordinal()).add(new Integer(calculateRatio(
				GENDERS.length,
				Arrays.asList(GENDERS).indexOf(UserController.getUser().getPrefGender()),
				Arrays.asList(GENDERS).indexOf(other.getPrefGender()))));
		ratios.get(weightPriority.ordinal()).add(new Integer(calculateRatio(
				WEIGHTCLASS.length,
				Arrays.asList(WEIGHTCLASS).indexOf(UserController.getUser().getWeight()),
				Arrays.asList(WEIGHTCLASS).indexOf(other.getWeight()))));
		ratios.get(stylePriority.ordinal()).add(new Integer(calculateRatio(
				STYLES.length,
				Arrays.asList(STYLES).indexOf(UserController.getUser().getStyle()),
				Arrays.asList(STYLES).indexOf(other.getStyle()))));
		ratios.get(timePriority.ordinal()).add(new Integer(calculateRatio(
				TIMES.length,
				Arrays.asList(TIMES).indexOf(UserController.getUser().getTimeOfDay()),
				Arrays.asList(TIMES).indexOf(other.getTimeOfDay()))));
		ratios.get(freqPriority.ordinal()).add(new Integer(calculateRatio(
				FREQUENCIES.length,
				Arrays.asList(FREQUENCIES).indexOf(UserController.getUser().getFrequency()),
				Arrays.asList(FREQUENCIES).indexOf(other.getFrequency()))));
		ratios.get(goalPriority.ordinal()).add(new Integer(calculateRatio(
				GOALS.length,
				Arrays.asList(GOALS).indexOf(UserController.getUser().getGoals()),
				Arrays.asList(GOALS).indexOf(other.getGoals()))));
		ratios.get(expPriority.ordinal()).add(new Integer(calculateRatio(
				EXPERIENCE.length,
				Arrays.asList(EXPERIENCE).indexOf(UserController.getUser().getExperience()),
				Arrays.asList(EXPERIENCE).indexOf(other.getExperience()))));
		List<Integer> finals = new ArrayList<>();
		for (int i = 0; i < PRIORITYCOUNT; i++) {
			int sum = 0;
			for (Integer c : ratios.get(i)) {
				sum += c;
			}
			finals.add(sum / ratios.get(i).size());
		}
		Integer result = 0;
		for (Integer i : finals) {
			result += i;
		}
		result /= PRIORITYCOUNT;
		return result;
	}
@ SuppressWarnings ( "deprecation" ) public static Integer calculateRatios ( User other ) { List < List < Integer > > ratios = new ArrayList < > ( 5 ) ; for ( int i = 0 ; i < PRIORITYCOUNT ; i ++ ) { ratios . add ( new ArrayList < Integer > ( ) ) ; } ratios . get ( prefGenderPriority . ordinal ( ) ) . add ( new Integer ( calculateRatio ( GENDERS . length , Arrays . asList ( GENDERS ) . indexOf ( UserController . getUser ( ) . getPrefGender ( ) ) , Arrays . asList ( GENDERS ) . indexOf ( other . getPrefGender ( ) ) ) ) ) ; ratios . get ( weightPriority . ordinal ( ) ) . add ( new Integer ( calculateRatio ( WEIGHTCLASS . length , Arrays . asList ( WEIGHTCLASS ) . indexOf ( UserController . getUser ( ) . getWeight ( ) ) , Arrays . asList ( WEIGHTCLASS ) . indexOf ( other . getWeight ( ) ) ) ) ) ; ratios . get ( stylePriority . ordinal ( ) ) . add ( new Integer ( calculateRatio ( STYLES . length , Arrays . asList ( STYLES ) . indexOf ( UserController . getUser ( ) . getStyle ( ) ) , Arrays . asList ( STYLES ) . indexOf ( other . getStyle ( ) ) ) ) ) ; ratios . get ( timePriority . ordinal ( ) ) . add ( new Integer ( calculateRatio ( TIMES . length , Arrays . asList ( TIMES ) . indexOf ( UserController . getUser ( ) . getTimeOfDay ( ) ) , Arrays . asList ( TIMES ) . indexOf ( other . getTimeOfDay ( ) ) ) ) ) ; ratios . get ( freqPriority . ordinal ( ) ) . add ( new Integer ( calculateRatio ( FREQUENCIES . length , Arrays . asList ( FREQUENCIES ) . indexOf ( UserController . getUser ( ) . getFrequency ( ) ) , Arrays . asList ( FREQUENCIES ) . indexOf ( other . getFrequency ( ) ) ) ) ) ; ratios . get ( goalPriority . ordinal ( ) ) . add ( new Integer ( calculateRatio ( GOALS . length , Arrays . asList ( GOALS ) . indexOf ( UserController . getUser ( ) . getGoals ( ) ) , Arrays . asList ( GOALS ) . indexOf ( other . getGoals ( ) ) ) ) ) ; ratios . get ( expPriority . ordinal ( ) ) . add ( new Integer ( calculateRatio ( EXPERIENCE . length , Arrays . asList ( EXPERIENCE ) . indexOf ( UserController . getUser ( ) . getExperience ( ) ) , Arrays . asList ( EXPERIENCE ) . indexOf ( other . getExperience ( ) ) ) ) ) ; List < Integer > finals = new ArrayList < > ( ) ; for ( int i = 0 ; i < PRIORITYCOUNT ; i ++ ) { int sum = 0 ; for ( Integer c : ratios . get ( i ) ) { sum += c ; } finals . add ( sum / ratios . get ( i ) . size ( ) ) ; } Integer result = 0 ; for ( Integer i : finals ) { result += i ; } result /= PRIORITYCOUNT ; return result ; }
Calculate ratios all matches.
Calculate ratios all matches .
//Pref Gender ratio //Weight ratio //Style ratio //Times ratio //Frequency ratio //Goals ratio //Experience ratio