package model;

import java.util.List;
import java.util.Random;

public class BetAdvisor {

	public static Bet calculateBetterBet(Player player, List<Bet> unavailableBets, int sumOfAvailableChopsticks,
			List<Round> roundHistory) {
		Bet bet;
		int betValue = 0;
		do {
			if (roundHistory.size() < 3) {
				betValue = generateRandomBetValue(sumOfAvailableChopsticks);
			} else {
				betValue = generateProbabilisticBetValue(roundHistory);
			}
			bet = new Bet(player, betValue);
		} while (unavailableBets.contains(bet));
		return bet;
	}

	private static int generateRandomBetValue(int sumOfAvailableChopsticks) {
		return new Random().nextInt(sumOfAvailableChopsticks);
	}

	private static int generateProbabilisticBetValue(List<Round> roundHistory) {
		return 0;
	}
}

@@ -26,20 +26,68 @@
 va.util.
-List
+HashMap;%0Aimport java.util.List;%0Aimport java.util.Map
 ;%0Aimport
@@ -811,13 +811,1153 @@
 turn 0;%0A
-
 %09%7D%0A
+%0A%09private static Map%3CInteger, Integer%3E findFrequencies(List%3CRound%3E roundHistory) %7B%0A%09%09int listOfSums%5B%5D = new int%5BroundHistory.size()%5D;%0A%09%09int minimumValue = Integer.MAX_VALUE, maximumValue = 0, squareRoot = 0;%0A%0A%09%09squareRoot = (int) Math.sqrt(roundHistory.size());%0A%0A%09%09/* Transform list of sums of chop-sticks to array%0A%09%09   Get minimum value and maximum value. */%0A%09%09for (int i = 0; i %3C roundHistory.size(); i++) %7B%0A%09%09%09listOfSums%5Bi%5D = roundHistory.get(i).getChopsticks();%0A%09%09%09minimumValue = Math.min(minimumValue, listOfSums%5Bi%5D);%0A%09%09%09maximumValue = Math.max(maximumValue, listOfSums%5Bi%5D);%0A%09%09%7D%0A%0A%09%09int difference = maximumValue - minimumValue;%0A%09%09int classInterval = difference / squareRoot;%0A%0A%09%09return groupAndMapFrequencies(listOfSums);%0A%09%7D%0A%0A%09private static Map%3CInteger, Integer%3E groupAndMapFrequencies(int%5B%5D listOfSums) %7B%0A%09%09Map%3CInteger, Integer%3E frequencies = new HashMap%3CInteger, Integer%3E();%0A%0A%09%09for (int i = 0; i %3C listOfSums.length; i++) %7B%0A%09%09%09if (!frequencies.containsKey(listOfSums%5Bi%5D)) %7B%0A%09%09%09%09frequencies.put(listOfSums%5Bi%5D, 1);%0A%09%09%09%7D else %7B%0A%09%09%09%09frequencies.put(listOfSums%5Bi%5D, frequencies.get(listOfSums%5Bi%5D) + 1);%0A%09%09%09%7D%0A%09%09%7D%0A%0A%09%09return frequencies;%0A%09%7D%0A%0A
 %7D%0A

Add statistics methods