def runAgent(self, moduleDict, numIterations):
        agent = moduleDict['valueIterationAgents'].ValueIterationAgent(
            self.grid,
            discount=self.discount,
            iterations=numIterations)
        states = self.grid.getStates()
        actions = list(
            reduce(lambda a,
                   b: set(a).union(b),
                   [self.grid.getPossibleActions(state) for state in states]))
        values = {}
        qValues = {}
        policy = {}
        for state in states:
            values[state] = agent.getValue(state)
            policy[state] = agent.computeActionFromValues(state)
            possibleActions = self.grid.getPossibleActions(state)
            for action in actions:
                if qValues not in action:
                    qValues[action] = {}
                if action in possibleActions:
                    qValues[
                        action][
                        state] = agent.computeQValueFromValues(
                        state,
                        action)
                else:
                    qValues[action][state] = None
        valuesPretty = self.prettyValues(values)
        policyPretty = self.prettyPolicy(policy)
        qValuesPretty = {}
        for action in actions:
            qValuesPretty[action] = self.prettyValues(qValues[action])
        return (valuesPretty, qValuesPretty, actions, policyPretty)
dataset/ETHPy150Open rlpy/rlpy/rlpy/Domains/PacmanPackage/reinforcementTestClasses.py/ValueIterationTest.runAgent/swapped operands of `not in`