def isFinished(self):
        # Criterion for ending an episode.
        # "When the agent can balance for 1000 seconds, the task is considered
        # learned."
        if np.abs(self.env.getTilt()) > self.max_tilt:
            return True
        elapsed_time = self.env.time_step * self.t
        if elapsed_time > self.max_time:
            print 'hit max time.', self.t, elapsed_time
            return True
        return False
dataset/ETHPy150Open chrisdembia/agent-bicycle/randlov1998/tasks.py/BalanceTask.isFinished/original