Documentation ¶
Index ¶
- Variables
- func Dur(max time.Duration) time.Duration
- func GetSeed() int64
- func Jitter(period time.Duration) time.Duration
- func JitterFraction(period time.Duration, fraction float64) time.Duration
- func NewSource(seed int64) rand.Source
- func PickN(population []interface{}, n int) (picked []interface{}, remaining []interface{}, err error)
- func Sample(population []interface{}, k int) (res []interface{}, err error)
- func SampleInts(n int, k int) (res []int, err error)
- func Shuffle(collection Swapper)
- type Swapper
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // See math/rand for documentation. New = rand.New // See math/rand for documentation. Seed = rand.New // See math/rand for documentation. Int63 = rand.Int63 // See math/rand for documentation. Uint32 = rand.Uint32 // See math/rand for documentation. Int31 = rand.Int31 // See math/rand for documentation. Int = rand.Int // See math/rand for documentation. Int63n = rand.Int63n // See math/rand for documentation. Int31n = rand.Int31n // See math/rand for documentation. Intn = rand.Intn // See math/rand for documentation. Float64 = rand.Float64 // See math/rand for documentation. Float32 = rand.Float32 // See math/rand for documentation. Perm = rand.Perm // See math/rand for documentation. NormFloat64 = rand.NormFloat64 // See math/rand for documentation. ExpFloat64 = rand.ExpFloat64 // See math/rand for documentation. NewZipf = rand.NewZipf )
Functions ¶
func JitterFraction ¶
Uniformly jitters the provided duration by +/- the given fraction. NOTE: fraction must be in (0, 1].
func PickN ¶
func PickN(population []interface{}, n int) ( picked []interface{}, remaining []interface{}, err error, )
Same as 'Sample' except it returns both the 'picked' sample set and the 'remaining' elements.
func SampleInts ¶
Samples 'k' unique ints from the range [0, n)
Types ¶
Click to show internal directories.
Click to hide internal directories.