pub struct RuleSpace { /* private fields */ }👎Deprecated since 0.2.0: Use system::System and SystemBuilder instead
Expand description
Container for fuzzy variables, rules, and intermediate membership data.
Internally, RuleSpace stores:
vars: the set of named input/output variables.rules: the rule base defining inference behavior.agg_memberships: aggregated membership samples per output variable from the most recent call toaggregate/defuzzify.
Implementations§
Source§impl RuleSpace
impl RuleSpace
Sourcepub fn new(vars: HashMap<String, Variable>, rules: Vec<Rule>) -> Result<Self>
👎Deprecated since 0.2.0: Use system::System and SystemBuilder instead
pub fn new(vars: HashMap<String, Variable>, rules: Vec<Rule>) -> Result<Self>
Create a rule space with the supplied variables and rules.
Errors
FuzzyError::EmptyInputifvarsorrulesis empty.
Sourcepub fn add_rules(&mut self, rules: &mut Vec<Rule>) -> Result<&mut Self>
👎Deprecated since 0.2.0: Use system::System and SystemBuilder instead
pub fn add_rules(&mut self, rules: &mut Vec<Rule>) -> Result<&mut Self>
Append additional rules to the existing rule set.
Returns a mutable reference to self upon success.
Errors
FuzzyError::EmptyInputifrulesis empty.
Sourcepub fn aggregate<KI>(
&mut self,
input: &HashMap<KI, Float>,
sampler: &UniformSampler,
) -> Result<()>
👎Deprecated since 0.2.0: Use system::System and SystemBuilder instead
pub fn aggregate<KI>( &mut self, input: &HashMap<KI, Float>, sampler: &UniformSampler, ) -> Result<()>
Run the aggregation step for all rules with the provided crisp inputs.
This populates agg_memberships with a sample vector for each output
variable. Use defuzzify if you want crisp outputs in a single call.
Type parameters
KI: key type forinput, must borrow asstr.
Errors
- Propagates errors from rule activation/implication and aggregation.
Sourcepub fn defuzzify<KI>(
&mut self,
input: &HashMap<KI, Float>,
sampler: &UniformSampler,
) -> Result<HashMap<String, Float>>
👎Deprecated since 0.2.0: Use system::System and SystemBuilder instead
pub fn defuzzify<KI>( &mut self, input: &HashMap<KI, Float>, sampler: &UniformSampler, ) -> Result<HashMap<String, Float>>
Aggregate and then defuzzify each output variable using the supplied sampler.
Combines aggregate and defuzzification to return crisp values for
all output variables in a single call.
Type parameters
KI: key type forinput, must borrow asstr.
Errors
- Propagates any error from aggregation or defuzzification.
Auto Trait Implementations§
impl Freeze for RuleSpace
impl !RefUnwindSafe for RuleSpace
impl Send for RuleSpace
impl Sync for RuleSpace
impl Unpin for RuleSpace
impl !UnwindSafe for RuleSpace
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