pub struct SingletonFuzzySet {
pub singletons: HashMap<String, f64>,
}Expand description
Singleton fuzzy set for discrete inputs (common in fuzzy control).
Represents a collection of singleton (crisp input, fuzzy membership) pairs.
Fields§
§singletons: HashMap<String, f64>Map from crisp value to membership degree
Implementations§
Source§impl SingletonFuzzySet
impl SingletonFuzzySet
Sourcepub fn add(&mut self, value: String, membership: f64)
pub fn add(&mut self, value: String, membership: f64)
Add a singleton (value, membership) pair.
Sourcepub fn defuzzify(&self) -> Option<f64>
pub fn defuzzify(&self) -> Option<f64>
Defuzzify using weighted average of singletons.
Assumes values can be parsed as f64.
Sourcepub fn winner_takes_all(&self) -> Option<(String, f64)>
pub fn winner_takes_all(&self) -> Option<(String, f64)>
Get the singleton with maximum membership (winner-takes-all).
Trait Implementations§
Source§impl Clone for SingletonFuzzySet
impl Clone for SingletonFuzzySet
Source§fn clone(&self) -> SingletonFuzzySet
fn clone(&self) -> SingletonFuzzySet
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 moreSource§impl Debug for SingletonFuzzySet
impl Debug for SingletonFuzzySet
Auto Trait Implementations§
impl Freeze for SingletonFuzzySet
impl RefUnwindSafe for SingletonFuzzySet
impl Send for SingletonFuzzySet
impl Sync for SingletonFuzzySet
impl Unpin for SingletonFuzzySet
impl UnwindSafe for SingletonFuzzySet
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