#[non_exhaustive]pub enum Curve {
Constant(Score),
Linear,
Inverse,
Quadratic,
Threshold {
at: Score,
below: Score,
above: Score,
},
}Expand description
Maps a raw input signal (already a Score) to a contribution score.
Curves are what make decisions feel graded rather than a rigid if: a low
signal can still contribute something, and emphasis can be shaped.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Constant(Score)
Always returns the given score, ignoring the input.
Linear
Returns the input unchanged.
Inverse
Returns 1.0 - input (high when the input is low).
Quadratic
Returns input * input — dampens low inputs, keeps high ones.
Threshold
A soft step: returns above when input >= at, otherwise below.
Implementations§
Trait Implementations§
impl Copy for Curve
impl Eq for Curve
impl StructuralPartialEq for Curve
Auto Trait Implementations§
impl Freeze for Curve
impl RefUnwindSafe for Curve
impl Send for Curve
impl Sync for Curve
impl Unpin for Curve
impl UnsafeUnpin for Curve
impl UnwindSafe for Curve
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