Accessors
randomOption
- get randomOption(): null | T
Protected
Returns null | T
len
- get len(): number
-
Returns number
allOptions
- get allOptions(): T[]
-
Returns T[]
Methods
Protected computeWeights
- computeWeights(list: OptionList<T>): [number, number]
Protected
Returns [number, number]
Protected generatePool
- generatePool(list: OptionList<T>): void
Protected
Returns void
remove
- remove(option: T): void
-
Returns void
Private calcRateOf
- calcRateOf(index: number): number
-
Returns number
rateOf
- rateOf(option: T): number
-
Returns number
维护一个选项池