code: def isFinished(self):
          
          finished = (self.env._step == len(self.env.profile))
          if finished:
              logger.info("Finished episode.")
          return finished
docs: Is the current episode over?