def getReward(self):
        if self.isFinished():
            win = (self.env.winner != self.opponent.color)
            moves = self.env.movesDone
            res = self.winnerReward - self.numMovesCoeff * (moves -self.minmoves)/(self.maxmoves-self.minmoves)
            if not win:
                res *= -1
            if self.alternateStarting and self.switched:
                # opponent color has been inverted after the game!
                res *= -1
            return res
        else:
            return 0
Verifies that the query index gets updated
dataset/ETHPy150Open pybrain/pybrain/pybrain/rl/environments/twoplayergames/tasks/capturetask.py/CaptureGameTask.getReward--crossover with--dataset/ETHPy150Open ambitioninc/django-query-builder/querybuilder/tests/logger_tests.py/LoggerTest.test_start_logging