import java.util.Random;


/**
 * NArmedBanditDummyPlayer - a dummy random player for the n-Armed Bandit problem.
 * @author Todd W. Neller
 *
 */
public class NArmedBanditDummyPlayer {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Random random = new Random(0);
		int numArms = 10;
		int numPulls = 100;
		int numGames = 1000000;
		NArmedBandit nab = null;
		double cumulativeRegret = 0;
		for (int seed = 0; seed < numGames; seed++) {
			NArmedBandit.setSeed(seed);
			nab = new NArmedBandit(numArms);
			for (int pull = 0; pull < numPulls; pull++) {
				double reward = nab.pull(random.nextInt(numArms));
			}
			cumulativeRegret += nab.getCumulativeRegret();
		}
		cumulativeRegret /= numGames;
		System.out.println("Average Cumulative Regret: " + cumulativeRegret);
	}

}
