pub enum AllocationCurve {
Linear,
Exponential {
exponent: f64,
},
Stepped {
thresholds: Vec<(f64, u64)>,
},
}Expand description
Curve controlling how probability maps to divisor.
Variants§
Linear
Linear: divisor = max - (max - min) * probability.
Exponential
Exponential: divisor = max * (1 - probability)^exponent.
Gives more budget to high-probability screens with sharp falloff.
Stepped
Stepped: bucket probabilities into tiers.
Thresholds are checked in descending order; first match wins. Must be sorted descending by threshold value.
Example: [(0.3, 1), (0.1, 2), (0.03, 5), (0.0, 20)]
Trait Implementations§
Source§impl Clone for AllocationCurve
impl Clone for AllocationCurve
Source§fn clone(&self) -> AllocationCurve
fn clone(&self) -> AllocationCurve
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AllocationCurve
impl RefUnwindSafe for AllocationCurve
impl Send for AllocationCurve
impl Sync for AllocationCurve
impl Unpin for AllocationCurve
impl UnsafeUnpin for AllocationCurve
impl UnwindSafe for AllocationCurve
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more