// MTinit initialises random numbers generators (Mersenne Twister code) // Input: // seed -- seed value; use seed <= 0 to use current time func MTinit(seed int) { if seed <= 0 { seed = int(time.Now().Unix()) } sfmt.Init(seed) dsfmt.Init(seed) }
// Init initialises random numbers generators // Input: // seed -- seed value; use seed <= 0 to use current time func Init(seed int) { if seed <= 0 { seed = int(time.Now().Unix()) } rand.Seed(int64(seed)) sfmt.Init(seed) dsfmt.Init(seed) }