def done(self):
    """Returns whether the trajectory is finished."""
    if not self._timesteps:
      return False
    return self._timesteps[-1].done
Returns whether the trajectory is finished.
trax/rl/task.py