def runAgent(self, moduleDict):
        agent = moduleDict['qlearningAgents'].QLearningAgent(**self.opts)
        states = sorted(
            filter(lambda state: len(self.grid.getPossibleActions(state)) > 0,
                   self.grid.getStates()))
        randObj = FixedRandom().random
        # choose a random start state and a random possible action from that state
        # get the next state and reward from the transition function
        for i in range(self.numExperiences):
            startState = randObj.choice(states)
            action = randObj.choice(self.grid.getPossibleActions(startState))
            (endState, reward) = self.env.getRandomNextState(
                startState, action, randObj=randObj)
            agent.update(startState, action, endState, reward)
        return agent
dataset/ETHPy150Open rlpy/rlpy/rlpy/Domains/PacmanPackage/reinforcementTestClasses.py/EpsilonGreedyTest.runAgent/original