Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Picker ¶
type Picker struct {
// contains filtered or unexported fields
}
Picker is a utility class for picking values from a list using weighted random selection. The weight is based on a user-defined score function, where low scores are exponentially more favorable than high scores.
func (Picker) Disable ¶
Disable semi-permanently alters the probability of selecting the index'th value to 0.
func (Picker) Divvy ¶
Divvy divides and distributes the given quantity among the values according to their individual probabilities.
Click to show internal directories.
Click to hide internal directories.