Exemplo n.º 1
0
 /// <summary>
 /// Create a new Fuzzy Rule
 /// </summary>
 /// <param name="rb"></param>
 /// <param name="name"></param>
 /// <param name="lhs"></param>
 /// <param name="rhs"></param>
 internal FuzzyRule(FuzzyRuleBase rb, string name, FuzzyClause lhs, FuzzyClause rhs)
 {
     moRuleBase = rb;
     msName = name;
     moRdRefs = new System.Collections.BitArray(Constants.FUZZY_MAXVALUES);
     moWrRefs = new System.Collections.BitArray(Constants.FUZZY_MAXVALUES);
     mbFiredFlag = false;
     moAntecedents = new List<FuzzyClause>(10);
     moAntecedents.Add(lhs);
     moConsequent = rhs;
     if (moConsequent != null)
     {
         AddWrReference(moConsequent.LhsReferent);
         AddRdReference(moConsequent.RhsReferent);
     }
     moRuleBase.AddConditionalRule(this); // add self to rule list
 }
Exemplo n.º 2
0
        /// <summary>
        /// Crate the Clause
        /// </summary>
        /// <param name="lhs">Left Hand Side</param>
        /// <param name="oper">Operator</param>
        /// <param name="hedges">Hedges</param>
        /// <param name="setName">Set Name</param>
        /// <returns>FuzzyClause</returns>
        public FuzzyClause CreateClause(ContinuousFuzzyRuleVariable lhs, EnumFuzzyOperator oper, string hedges, string setName)
        {
            // Retrieve the fuzzy set object based on hedges and setName
            FuzzySet rhs = GetFuzzySet(lhs, setName, hedges);

            // Create a clause to place into a rule.
            FuzzyClause clause = new FuzzyClause(lhs, oper, rhs);

            return clause;
        }