math/rand/v2 (Go 1.22+) replaces the old math/rand: PCG generator, no global Seed(), and rand.New(rand.NewPCG(seed, 0)) gives an isolated deterministic stream. Each randomness consumer (graph, thresholds, education sampling) will get its own stream so levers vary independently. Tests live next to the code as *_test.go; 'go test ./...' runs them all. 'for i := range 100' is Go 1.22 range-over-int. |
||
|---|---|---|
| .. | ||
| rng.go | ||
| rng_test.go | ||