DynamicIterators.BindOnce
— TypeBindOnce(state, control)
DynamicIterators.Controlled
— TypeControlled(C, P)
"Controlled" iterator P
with the state t
of C
calling
(t => x) = evolve(P, t=>x, tᵒ)
Example
# Apply collatz twice each step using the default for Evolve
collatz(n) = n % 2 == 0 ? n÷2 : 3n + 1
collectfrom(Controlled(1:2:20, Evolve(collatz)), (1,14))
DynamicIterators.DynamicIterator
— TypeDynamicIterator
DynamicIterator
s which extend the iterator protocol by keywords for the iterate
function.
DynamicIterators.Evolution
— TypeEvolution
Evolutions define
evolve(iter, value::T)::T
and possibly
evolve(iter, key=>value)
They guarantee HasEltype()
and eltype(iter) == T
.
DynamicIterators.Evolve
— Typeevolve(f)
Create the DynamicIterator corresponding to the evolution
x = f(x)
Integer keys default to increments. Integer control default to keys (and repetitions).
julia> collect(take(from(Evolve(x->x + 1), 10), 5))
5-element Array{Any,1}:
10
11
12
13
14
DynamicIterators.From
— Typefrom(P, x)
Attach a starting value to a DynamicIterator
.
Example
collect(from(1:14, 10)) == [11, 12, 13, 14]
DynamicIterators.Mix
— Typemix(f, P, Q)
Mix two dynamic iterators by applying the mixing function f
to their states:
x, y = f(x, y)
Example
collectfrom(Mix((x,y) -> (x+y, y), 1:0, 1:100), (1,1)))
# last value 100*101/2 + 100
DynamicIterators.Mixture
— Typemixture(I, Ps)
evolve(M::Mixture, (i, x))
Choose evolution in Ps[i]
for x
using iterate i
of I
.
DynamicIterators.Start
— TypeStart(value) <: Message
Transient message to start to iterate from the state corresponding to value
.
DynamicIterators.State
— TypeState(state) <: Message
Persistent message to iterate from the state
.
DynamicIterators.Value
— TypeValue(value, state) <: Message
Transient message to continue to iterate from state
reacting to a forced change in the iterate value
.
DynamicIterators.dyniterate
— Methoddyniterate(iter, state, (steps,)::Steps)
Advance the iterator steps
times, and for negative numbers, if implemented, rewind the iterator -steps
times.
DynamicIterators.synchronize
— Methodsynchronize
DynamicIterators.trace
— Functiontrace(P, u::Pair, stop; register = x->true)
Trace the trajectoy of a keyed Dynamic iterator as Trajectory
.