internal FuzzySet moRhs; // Righthand side value #endregion Fields #region Constructors /// <summary> Creates a new fuzzy clause with the specified lvalue, operator, and /// rvalue. /// /// </summary> /// <param name="lhs">the FuzzyRuleVariable which is the lvalue /// </param> /// <param name="op">the integer operator /// </param> /// <param name="rhs">the FuzzySet which is the rvalue /// </param> protected internal FuzzyClause(FuzzyRuleVariable lhs, EnumFuzzyOperator op, FuzzySet rhs) { this.moLhs = lhs; this.meOp = op; this.moRhs = rhs; mbConsequent = (op == EnumFuzzyOperator.Assign); }
/// <summary> /// Add the Variable /// </summary> /// <param name="variable">The Variable</param> public void AddVariable(FuzzyRuleVariable variable) { moVariableList[variable.Name] = variable; }
/// <summary> /// Assign the Rhs Fuzzy to the Lhs with a truth value /// </summary> /// <param name="lhs"></param> /// <param name="rhs"></param> /// <param name="truthValue"></param> internal static void Assign(FuzzyRuleVariable lhs, FuzzySet rhs, double truthValue) { //This is correlation with a truth value. ((ContinuousFuzzyRuleVariable)lhs).SetFuzzyValue(rhs, truthValue); }
/// <summary> /// Determines the Membership /// </summary> /// <param name="lhs"></param> /// <param name="rhs"></param> /// <returns></returns> internal static double Compare(FuzzyRuleVariable lhs, FuzzySet rhs) { // Take crisp value and look up membership return (rhs.Membership(lhs.GetNumericValue())); }
/// <summary> /// Assign the Rhs to the Lhs /// </summary> /// <param name="lhs"></param> /// <param name="rhs"></param> internal static void Assign(FuzzyRuleVariable lhs, FuzzySet rhs) { lhs.SetFuzzyValue(rhs); }