if (args.length > 2) {
totalItems = Integer.parseInt(args[2]);
}
BanditFactory bf = new BetaBayesFactory();
if (args.length > 3) {
if (args[3].startsWith("beta")) {
bf = new BetaBayesFactory();
} else if (args[3].startsWith("gamma")) {
bf = new GammaNormalBayesFactory();
} else {
throw new IllegalArgumentException("Wanted beta or gamma to specify distribution");
}
}
List<BayesianBandit> bandit = Lists.newArrayList();
for (int m = 0; m < 50; m++) {
bandit.add(bf.createBandit(totalItems, gen));
}
double[] prob = new double[totalItems];
Uniform u = new Uniform(gen);
for (int j = 0; j < totalItems; j++) {