示例#1
0
        // METHODE PRIVEE
        /// <summary>
        /// Search and compute the premise degree for given problem : if premise is applicable returns the degree, if not returns double.Nan
        /// </summary>
        /// <param name="a_problem">FuzzyValue collections of a given problem</param>
        /// <param name="a_localPremise">Premise to check</param>
        /// <returns>Degree of the premise or double.Nan if premise not applicable</returns>
        protected double SearchAndComputePremiseDegree(List <FuzzyValue> a_problem, FuzzyExpression a_localPremise)
        {
            List <FuzzyValue> .Enumerator enumerator = a_problem.GetEnumerator();
            LinguisticValue linguisticValue          = null;

            while (enumerator.MoveNext())
            {
                if (a_localPremise.VariableName == enumerator.Current.VariableName)
                {
                    linguisticValue = a_localPremise.VariableName.LinguisticValueByName(a_localPremise.ValueName);
                    if (linguisticValue != null)
                    {
                        return(linguisticValue.DegreeAtValue(enumerator.Current.Value));
                    }
                    else
                    {
                        return(double.NaN);
                    }
                }
            }
            return(double.NaN);
        }
示例#2
0
 // CONSTRUCTEUR
 public FuzzyRule(List <FuzzyExpression> a_premises, FuzzyExpression a_conclusion)
 {
     Premises   = a_premises;
     Conclusion = a_conclusion;
 }