CavityTools.AccumulatorType

Accumulator(v) objects acts as a live cumsum(v) that gets updated when the vector does. julia> a = Accumulator([1:10;]) Accumulator{Int64, +, zero}([[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [3, 7, 11, 15, 19], [10, 26, 19], [36, 19], [55]])

julia> a[end] 55

julia> a[1]=0 0

julia> a[end] 54

CavityTools.ExponentialQueueType

ExponentialQueue(N)keeps an updatable queue of up toNevents with ids1...N` and contant rates Q[1] ... Q[N]. This is intended for sampling in continuous time.

julia> Q = ExponentialQueue(100) ExponentialQueue(Accumulator{Float64, +, zero}([Float64[]]), [0, 0, 0, 0, 0, 0, 0, 0, 0, 0 … 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], Int64[])

julia> Q[1] = 1.2 #updates rate of event 1 1.2

julia> Q[55] = 2.3 #updates rate of event 55 2.3

julia> i,t = pop!(Q) # gets time and id of next event and remove it from the queue (55, 0.37869716808319576)