Пример #1
0
 /// <summary>
 /// Evaluates the fuzzy clause.
 /// </summary>
 ///
 /// <returns>Degree of membership [0..1] of the clause.</returns>
 ///
 public float Evaluate( )
 {
     return(label.GetMembership(variable.NumericInput));
 }
Пример #2
0
        /// <summary>
        /// Calculate the membership of a given value to a given label. Used to evaluate linguistics clauses like
        /// "X IS A", where X is a value and A is a linguistic label.
        /// </summary>
        ///
        /// <param name="labelName">Label (fuzzy set) to evaluate value's membership.</param>
        /// <param name="value">Value which label's membership will to be calculated.</param>
        ///
        /// <returns>Degree of membership [0..1] of the value to the label (fuzzy set).</returns>
        ///
        /// <exception cref="KeyNotFoundException">The label indicated in labelName was not found in the linguistic variable.</exception>
        ///
        public float GetLabelMembership(string labelName, float value)
        {
            FuzzySet fs = labels[labelName];

            return(fs.GetMembership(value));
        }