Exemplo n.º 1
0
            public void Set <T>(FuzzyValue <T> fuzzyValue) where T : struct, System.IConvertible
            {
                FuzzyUtils.IsGenericParameterValid <T>();
                EnumKey key    = EnumKey.From(fuzzyValue.linguisticVariable);
                float   degree = fuzzyValue.membershipDegree;

                this._internalDictionary[key] = degree;
            }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
            public FuzzyValue <T> Get <T>(T linguisticVariable) where T : struct, System.IConvertible
            {
                FuzzyUtils.IsGenericParameterValid <T>();
                EnumKey key    = EnumKey.From(linguisticVariable);
                float   degree = 0.0f;

                this._internalDictionary.TryGetValue(key, out degree);
                FuzzyValue <T> fuzzyValue = new FuzzyValue <T>(linguisticVariable, degree);

                return(fuzzyValue);
            }
Exemplo n.º 4
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);
     }
 }
Exemplo n.º 5
0
 public void Set <T>(FuzzyValue <T> fuzzyValue) where T : struct, IConvertible
 {
     this.container.Set(fuzzyValue);
 }