pub enum MembershipFunction {
Triangular {
a: f64,
b: f64,
c: f64,
},
Trapezoidal {
a: f64,
b: f64,
c: f64,
d: f64,
},
Gaussian {
mean: f64,
sigma: f64,
},
Singleton {
value: f64,
},
Universe,
}Expand description
A membership function that maps a crisp value x to a degree in [0, 1].
Variants§
Triangular
Triangular MF — zero at a and c, peak 1.0 at b.
μ(x) = max(0, min((x-a)/(b-a), (c-x)/(c-b)))
Trapezoidal
Trapezoidal MF — zero below a and above d, full membership on [b,c].
μ(x) = max(0, min((x-a)/(b-a), 1.0, (d-x)/(d-c)))
Gaussian
Gaussian MF — bell-shaped curve.
μ(x) = exp(-0.5 * ((x - mean) / sigma)^2)
Singleton
Singleton MF — full membership at exactly one point, zero elsewhere.
Universe
Universe of discourse — full membership everywhere.
Implementations§
Trait Implementations§
Source§impl Clone for MembershipFunction
impl Clone for MembershipFunction
Source§fn clone(&self) -> MembershipFunction
fn clone(&self) -> MembershipFunction
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MembershipFunction
impl Debug for MembershipFunction
Source§impl PartialEq for MembershipFunction
impl PartialEq for MembershipFunction
Source§fn eq(&self, other: &MembershipFunction) -> bool
fn eq(&self, other: &MembershipFunction) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for MembershipFunction
Auto Trait Implementations§
impl Freeze for MembershipFunction
impl RefUnwindSafe for MembershipFunction
impl Send for MembershipFunction
impl Sync for MembershipFunction
impl Unpin for MembershipFunction
impl UnsafeUnpin for MembershipFunction
impl UnwindSafe for MembershipFunction
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more