def cumulative_sum(v, cumulative):
    """
    Parameters
    ----------
    v : number
       The next element of the input stream of the
       agent.
    cumulative: number
       The state of the agent. The state is the sum
       of all the values received on the agent's
       input stream.

    Returns
    -------
    (cumulative, cumulative)
    cumulative : number
       The state after the transition, i.e., the
       sum of values received on the agent's input
       stream including the value received in this
       transition.

    """
    cumulative += v
    return (cumulative, cumulative)