Beispiel #1
0
        public FuzzyValue <T> Evaluate(FuzzyValueSet set)
        {
            FuzzyValue <T> ret = new FuzzyValue <T>();

            ret.linguisticVariable = this.OutputLinguisticVariable;
            ret.membershipDegree   = MathFz.Clamp01(this.Expression.Evaluate(set));
            return(ret);
        }
Beispiel #2
0
        public float Evaluate(FuzzyValueSet inputValueSet)
        {
            if (!this.OutputVarSet.IsValid())
            {
                return(float.NaN);
            }
            int ruleCount   = this.rules.Count;
            var ruleOutputs = this.RuleEvaluator.EvaluateRules(this.rules, inputValueSet);

            this.OutputsMerger.MergeValues(ruleOutputs, this.OutputValueSet);
            var result = this.Defuzzer.Defuzze(this.OutputVarSet, this.OutputValueSet);

            return(result);
        }
Beispiel #3
0
 public void Evaluate(float x, FuzzyValueSet outputs)
 {
     if (outputs == null)
     {
         return;
     }
     for (int i = 0; i < this._variables.Length; i++)
     {
         if (this._variables[i] == null)
         {
             continue;
         }
         FuzzyValue <T> value = this._variables[i].fX(x);
         outputs.Set(value);
     }
 }