Crate random_picker

Source
Expand description

Generates random choices based on the weight table of probabilities. It can be used to calculate each item’s probability of being picked up when picking a given amount of non-repetitive items, or to compare the speed of OS random source with that of the CSPRNG.

Structs§

Config
Configuration required by Picker. All members are public and are supposed to be modified by the user.
Picker
Generator of groups of random items of type T with different probabilities. According to the configuration, items in each group can be either repetitive or non-repetitive.

Enums§

Error
Possible errors returned by functions in this crate.

Functions§

pick
Convenience wrapper for exactly one picking operation.
print_table
Prints the weight table to the standard output.

Type Aliases§

Table
Alias of HashMap. The weight value type is always f64.