[−][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
The Even variant picks from its choices with even distribution.
Attributes
choices- The list of choices to pick from.
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.
The Inventory 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 reduced by 1.
Attributes
choices- The list of choices to pick from.
Fields of Inventory
choices: Vec<InventoryChoice>The LRU variant picks the Least Recently Used item from the list of choices. The least recently used choice is found at the beginning of the list. Once a choice has been accepted, it is moved to the end of the list.
Attributes
choices- The list of choices to pick from.
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>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<'de> Deserialize<'de> for ConfigCategory[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
__D: Deserializer<'de>,
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 StructuralPartialEq for ConfigCategory[src]
Auto Trait Implementations
impl RefUnwindSafe for ConfigCategory
impl Send for ConfigCategory
impl Sync for ConfigCategory
impl Unpin for ConfigCategory
impl UnwindSafe for ConfigCategory
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<T, U> TryFrom<U> 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, U> TryInto<U> 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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,