[−][src]Enum rpick::ConfigCategory
A category of items that can be chosen from.
Each variant of this Enum maps to one of the supported algorithms.
Variants
Even
The Even variant picks from its choices with even distribution.
Attributes
choices
- The list of choices to pick from.
Fields of Even
Gaussian
The Gaussian variant uses a Gaussian distribution to prefer choices near the beginning of the list of choices over those at the end. Once a choice has been accepted, it is moved to the end of the list.
Attributes
stddev_scaling_factor
- This is used to derive the standard deviation; the standard deviation is the length of the list of choices, divided by this scaling factor.choices
- The list of choices to pick from.
Fields of Gaussian
Lottery
The Lottery variant uses a weighted distribution to pick items, with each items chances being tied to how many tickets it has. When a choice is accepted, that choice's ticket count is set to 0, and every choice not chosen receives its weight in additional tickets.
Attributes
choices
- The list of choices to pick from.
Fields of Lottery
choices: Vec<LotteryChoice>
Weighted
The Weighted variant is a simple weighted distribution.
Attributes
choices
- The list of choices to pick from.
Fields of Weighted
choices: Vec<WeightedChoice>
Trait Implementations
impl PartialEq<ConfigCategory> for ConfigCategory
[src]
fn eq(&self, other: &ConfigCategory) -> bool
[src]
fn ne(&self, other: &ConfigCategory) -> bool
[src]
impl Serialize for ConfigCategory
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for ConfigCategory
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Send for ConfigCategory
impl Sync for ConfigCategory
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,