def execute(self, grades, moduleDict, solutionDict):
        self.addMessage(
            'Grading agent using command:  python pacman.py %s' %
            (self.pacmanParams,))

        startTime = time.time()
        games = pacman.runGames(
            ** pacman.readCommand(self.pacmanParams.split(' ')))
        totalTime = time.time() - startTime
        numGames = len(games)

        stats = {
            'time': totalTime, 'wins':
            [g.state.isWin() for g in games].count(True),
            'games': games, 'scores': [g.state.getScore() for g in games],
            'timeouts': [g.agentTimeout for g in games].count(True), 'crashes': [g.agentCrashed for g in games].count(True)}

        averageScore = sum(stats['scores']) / float(len(stats['scores']))
        nonTimeouts = numGames - stats['timeouts']
        wins = stats['wins']

        def gradeThreshold(value, minimum, thresholds, name):
            points = 0
            passed = (minimum is None) or (minimum >= value)
            if passed:
                for t in thresholds:
                    if value >= t:
                        points += 1
            return (passed, points, value, minimum, thresholds, name)

        results = [gradeThreshold(
            averageScore, self.scoreMinimum, self.scoreThresholds, "average score"),
            gradeThreshold(
                nonTimeouts,
                self.nonTimeoutMinimum,
                self.nonTimeoutThresholds,
                "games not timed out"),
            gradeThreshold(wins, self.winsMinimum, self.winsThresholds, "wins")]

        totalPoints = 0
        for passed, points, value, minimum, thresholds, name in results:
            if minimum is None and len(thresholds) == 0:
                continue

            # print passed, points, value, minimum, thresholds, name
            totalPoints += points
            if not passed:
                assert points == 0
                self.addMessage(
                    "%s %s (fail: below minimum value %s)" %
                    (value, name, minimum))
            else:
                self.addMessage(
                    "%s %s (%s of %s points)" %
                    (value, name, points, len(thresholds)))

            if minimum is not None:
                self.addMessage("    Grading scheme:")
                self.addMessage("     < %s:  fail" % (minimum,))
                if len(thresholds) == 0 or minimum != thresholds[0]:
                    self.addMessage("    >= %s:  0 points" % (minimum,))
                for idx, threshold in enumerate(thresholds):
                    self.addMessage(
                        "    >= %s:  %s points" %
                        (threshold, idx + 1))
            elif len(thresholds) > 0:
                self.addMessage("    Grading scheme:")
                self.addMessage("     < %s:  0 points" % (thresholds[0],))
                for idx, threshold in enumerate(thresholds):
                    self.addMessage(
                        "    >= %s:  %s points" %
                        (threshold, idx + 1))

        if any([not passed for passed, _, _, _, _, _ in results]):
            totalPoints = 0

        return self.testPartial(grades, totalPoints, self.maxPoints)
dataset/ETHPy150Open rlpy/rlpy/rlpy/Domains/PacmanPackage/reinforcementTestClasses.py/EvalAgentTest.execute/swapped operands of `>=`