Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Int64 ¶
func Int64[T constraints.Integer](max T) int64
Types ¶
type WeightedChooser ¶
type WeightedChooser struct {
// contains filtered or unexported fields
}
func NewWeightedRandomChooser ¶
func NewWeightedRandomChooser() *WeightedChooser
func (*WeightedChooser) Add ¶
func (w *WeightedChooser) Add(value interface{}, weight int)
func (*WeightedChooser) GetAndRemove ¶
func (w *WeightedChooser) GetAndRemove() (interface{}, error)
GetAndRemove choose a random entry based on their weights, and removes it from the list
func (*WeightedChooser) Remove ¶
func (w *WeightedChooser) Remove(i int)
func (*WeightedChooser) Size ¶
func (w *WeightedChooser) Size() int
Click to show internal directories.
Click to hide internal directories.