iterations = args.iterations if realRounds <= 0: print "Number of real rounds must be > 0 but was {0}".format(realRounds) sys.exit(1) if randomSeed: random.seed(randomSeed) playerAgentStrings = args.playerAgents playerAgents = [] for playerAgentString in playerAgentStrings: if playerAgentString == "QLearningAgent": playerAgents.append(QLearningAgent(args.alpha, args.discount, args.epsilon)) elif playerAgentString == "CountLearningAgent": playerAgents.append(CountLearningAgent()) elif playerAgentString == "AceCountLearningAgent": playerAgents.append(AceCountLearningAgent()) elif playerAgentString == "ReflexAgent": playerAgents.append(ReflexAgent()) elif playerAgentString == "StandingAgent": playerAgents.append(StandingAgent()) elif playerAgentString == "NoBustAgent": playerAgents.append(NoBustAgent()) elif playerAgentString == "HumanAgent": playerAgents.append(HumanAgent()) elif playerAgentString == "ValueIterationAgent": if not iterations: print "Number of iterations must be specified with ValueIterationAgent" sys.exit(1) playerAgents.append(ValueIterationAgent(iterations))
def setUp(self): # An agent every test can use self.agent = CountLearningAgent()