def sample_w_next(self, batch_size: int) -> tuple:
    '\n        Sample a random batch of steps from a together with the associated next steps.\n        Similar to `split_shuffled_batches` with `complete_rollouts=False`\n\n        :param batch_size: number of steps to sample\n        :return: randomly sampled batch of steps\n        '
    if (not (self.length >= 2)):
        raise pyrado.ValueErr(given=self.length, ge_constraint='2')
    shuffled_idcs = random.sample(range((self.length - 2)), batch_size)
    shuffled_next_idcs = [(i + 1) for i in shuffled_idcs]
    steps = deepcopy(self[shuffled_idcs])
    next_steps = deepcopy(self[shuffled_next_idcs])
    return (steps, next_steps)
Sample a random batch of steps from a together with the associated next steps.
Similar to `split_shuffled_batches` with `complete_rollouts=False`

:param batch_size: number of steps to sample
:return: randomly sampled batch of steps
def sample_w_next(self, batch_size: int) -> tuple:
    '\n        Sample a random batch of steps from a together with the associated next steps.\n        Similar to `split_shuffled_batches` with `complete_rollouts=False`\n\n        :param batch_size: number of steps to sample\n        :return: randomly sampled batch of steps\n        '
    if (not (self.length >= 2)):
        raise pyrado.ValueErr(given=self.length, ge_constraint='2')
    shuffled_idcs = random.sample(range((self.length - 2)), batch_size)
    shuffled_next_idcs = [(i + 1) for i in shuffled_idcs]
    steps = deepcopy(self[shuffled_idcs])
    next_steps = deepcopy(self[shuffled_next_idcs])
    return (steps, next_steps)