def executeNIterations(self, grades, moduleDict,
                           solutionDict, n, checkPolicy):
        testPass = True
        valuesPretty, qValuesPretty, actions, policyPretty = self.runAgent(
            moduleDict, n)
        stdOutString = ''
        fileOutString = ''
        valuesKey = "values_k_%d" % n
        if self.comparePrettyValues(valuesPretty, solutionDict[valuesKey]):
            fileOutString += "Values at iteration %d are correct.\n" % n
            fileOutString += "   Student/correct solution:\n %s\n" % self.prettyValueSolutionString(
                valuesKey,
                valuesPretty)
        else:
            testPass = False
            outString = "Values at iteration %d are NOT correct.\n" % n
            outString += "   Student solution:\n %s\n" % self.prettyValueSolutionString(
                valuesKey,
                valuesPretty)
            outString += "   Correct solution:\n %s\n" % self.prettyValueSolutionString(
                valuesKey,
                solutionDict[valuesKey])
            stdOutString += outString
            fileOutString += outString
        for action in actions:
            qValuesKey = 'q_values_k_%d_action_%s' % (n, action)
            qValues = qValuesPretty[action]
            if self.comparePrettyValues(qValues, solutionDict[qValuesKey]):
                fileOutString += "Q-Values at iteration %d for action %s are correct.\n" % (
                    n,
                    action)
                fileOutString += "   Student/correct solution:\n %s\n" % self.prettyValueSolutionString(
                    qValuesKey,
                    qValues)
            else:
                testPass = False
                outString = "Q-Values at iteration %d for action %s are NOT correct.\n" % (
                    n,
                    action)
                outString += "   Student solution:\n %s\n" % self.prettyValueSolutionString(
                    qValuesKey,
                    qValues)
                outString += "   Correct solution:\n %s\n" % self.prettyValueSolutionString(
                    qValuesKey,
                    solutionDict[qValuesKey])
                stdOutString += outString
                fileOutString += outString
        if checkPolicy:
            if not self.comparePrettyValues(policyPretty, solutionDict['policy']):
                testPass = False
                outString = "Policy is NOT correct.\n"
                outString += "   Student solution:\n %s\n" % self.prettyValueSolutionString(
                    'policy',
                    policyPretty)
                outString += "   Correct solution:\n %s\n" % self.prettyValueSolutionString(
                    'policy',
                    solutionDict['policy'])
                stdOutString += outString
                fileOutString += outString
        return testPass, stdOutString, fileOutString
dataset/ETHPy150Open rlpy/rlpy/rlpy/Domains/PacmanPackage/reinforcementTestClasses.py/ValueIterationTest.executeNIterations/original