Exact RNG
NumPy-exact random streams.
Duckietown.NumpyMT19937 — Type
NumpyMT19937(seed) <: Random.AbstractRNGnp.random.RandomState(seed) for integer seeds in [0, 2^32-1] (the legacy init_genrand path; larger seeds use init_by_array, which no reference config needs). rand(rng) produces the same Float64 stream as RandomState.random_sample().
Duckietown.NumpyPCG64 — Type
NumpyPCG64(seed) / NumpyPCG64(ss::NumpySeedSequence)np.random.PCG64(SeedSequence(seed)): seeded from generate_state(4, uint64) as (hi, lo) pairs for initstate/initseq (pcg64_srandom_r). pcg64_next_uint64 / np_random_double / np_uniform / np_integers mirror the bit generator and the Generator methods called by the simulator reset path.
Duckietown.NumpySeedSequence — Type
NumpySeedSequence(entropy)np.random.SeedSequence(entropy) with the default pool size 4 and no spawn key: the entropy integer is split into little-endian 32-bit words, hashed and mixed into the pool; seedseq_generate_state reproduces generate_state.
Duckietown.mt_next_uint32! — Method
mt_next_uint32!(r) -> UInt32One tempered MT19937 output word (mt19937_next).
Duckietown.mt_state — Method
mt_state(r) -> (Vector{UInt32}, Int)The 624-word key and position, comparable with RandomState.get_state().
Duckietown.np_integers — Method
np_integers(g, low, high) -> IntGenerator.integers(low, high) (default endpoint=false, int64 dtype): random_bounded_uint64_fill with use_masked=false — for ranges that fit in 32 bits (every reference call site) this is Lemire's rejection on the BUFFERED 32-bit source (bounded_lemire_uint32 over pcg64_next32); larger ranges use the 64-bit Lemire.
Duckietown.np_normal — Method
np_normal(g, loc, scale) -> Float64Generator.normal(loc, scale): loc + scale * standard_normal().
Duckietown.np_random_double — Method
np_random_double(g) -> Float64Generator.random(): (next_uint64 >> 11) * 2^-53.
Duckietown.np_standard_normal — Method
np_standard_normal(g) -> Float64random_standard_normal (numpy ziggurat, verbatim incl. the GH-13361 log(1 - u) tail form). The fast path (~99.3%) is pure integer × table and bit-exact; the wedge/tail paths go through libm log/exp, subject to the documented ≤1-ULP cross-libm caveat at astronomically rare rejection boundaries.
Duckietown.np_uniform — Method
np_uniform(g, low, high) -> Float64Generator.uniform(low, high): low + (high - low) * random().
Duckietown.pcg64_next_uint32 — Method
pcg64_next_uint32(g) -> UInt32pcg64_next32: LOW half of a fresh uint64 first; the HIGH half is buffered in the generator state and returned by the next call.
Duckietown.pcg64_next_uint64 — Method
pcg64_next_uint64(g) -> UInt64pcg_setseq_128_xsl_rr_64_random_r: step, then XSL-RR output (rotr64(hi ⊻ lo, state >> 122)).
Duckietown.random_sample — Method
random_sample(r) -> Float64RandomState.random_sample(): 53-bit double from two tempered words, ((a >> 5) * 67108864 + (b >> 6)) / 9007199254740992.
Duckietown.seedseq_generate_state — Method
seedseq_generate_state(ss, n) -> Vector{UInt64}SeedSequence.generate_state(n, np.uint64): 2n hashed uint32 words from the cycled pool, paired little-endian (low word first).