pub struct FuzzySet {
pub universe_size: usize,
pub membership: Vec<f64>,
}Expand description
A fuzzy set over a universe represented as a list of (element, degree) pairs. Degrees are in [0, 1].
Fields§
§universe_size: usize§membership: Vec<f64>membership[i] ∈ [0.0, 1.0]
Implementations§
Source§impl FuzzySet
impl FuzzySet
Sourcepub fn new(universe_size: usize) -> Self
pub fn new(universe_size: usize) -> Self
Create a crisp empty fuzzy set over a universe of the given size.
Sourcepub fn set(&mut self, i: usize, degree: f64)
pub fn set(&mut self, i: usize, degree: f64)
Set the membership degree for element i (clamped to [0,1]).
Sourcepub fn alpha_cut(&self, alpha: f64) -> Vec<usize>
pub fn alpha_cut(&self, alpha: f64) -> Vec<usize>
α-cut: returns a crisp set of elements with membership ≥ α.
Sourcepub fn strong_alpha_cut(&self, alpha: f64) -> Vec<usize>
pub fn strong_alpha_cut(&self, alpha: f64) -> Vec<usize>
Strong α-cut: elements with membership > α.
Sourcepub fn complement(&self) -> FuzzySet
pub fn complement(&self) -> FuzzySet
Fuzzy complement using standard negation: 1 − μ(x).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FuzzySet
impl RefUnwindSafe for FuzzySet
impl Send for FuzzySet
impl Sync for FuzzySet
impl Unpin for FuzzySet
impl UnsafeUnpin for FuzzySet
impl UnwindSafe for FuzzySet
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