Documentation ¶
Index ¶
- func Probability(per int32, args ...int32) bool
- func Relative(items map[int32]int32) int32
- func RelativeMulti(items map[int32]int32, num int32, repeat ...bool) []int32
- func Roll(a, b int32) int32
- type Data
- type Less
- type Random
- func (this *Random) Filter(filter func(k, v int32) bool) *Random
- func (this *Random) Multi(num int) (r []int32)
- func (this *Random) Range(f func(k, v int32) bool)
- func (this *Random) Reset(filter func(k, v int32) int32) *Random
- func (this *Random) Roll() int32
- func (this *Random) Sort(f Less)
- func (this *Random) Weight() (r int32)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Probability ¶
Probability 独立概率,args单位,默认万分比,,,百分比传入100
func RelativeMulti ¶
RelativeMulti 相对概率,权重 返回多个,repeat 是否可以重复
Types ¶
Click to show internal directories.
Click to hide internal directories.