def discounted_value(rollout: StepSequence, gamma: float):
    '\n    Compute the discounted state values for one rollout.\n\n    :param rollout: input data\n    :param gamma: temporal discount factor\n    :return: state values for every time step in the rollout\n    '
    rewards = [step.reward for step in rollout]
    return discounted_reverse_cumsum(rewards, gamma)
Compute the discounted state values for one rollout.

:param rollout: input data
:param gamma: temporal discount factor
:return: state values for every time step in the rollout
def discounted_value(rollout: StepSequence, gamma: float):
    '\n    Compute the discounted state values for one rollout.\n\n    :param rollout: input data\n    :param gamma: temporal discount factor\n    :return: state values for every time step in the rollout\n    '
    rewards = [step.reward for step in rollout]
    return discounted_reverse_cumsum(rewards, gamma)