Random Sampler behavior

this is because Java defaults to Int32:

julia> RNG = MT19937(0)
MT19937(UInt32[0x00000000, 0x00000001, 0x6c078967, 0x714acb41, 0x48077044, 0x93e7383e, 0xf0f54bb2, 0x141f95dc, 0xc0acdbd4, 0x3cb9cadc  …  0xad4200bc, 0xdaa1fb5d, 0x78ff7c7e, 0x71e51784, 0x499b76e3, 0xd522db95, 0x075dea9a, 0x8ccffb2f, 0xb5b4302f, 0x6b1a1930], 625)

julia> for i in 1:5 println(rand(RNG)) end
0.548813502304256
0.5928446163889021
0.715189364971593
0.8442657440900803
0.6027633703779429

julia> for i in 1:10 print(rand(RNG, Int32(1):Int32(10)), " ") end
9 6 9 5 7 7 4 5 3 9 

so you want to change to:

s = Random.Sampler(RNG, Int32(1):Int32(10))
4 Likes