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; }
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); }
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); }
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); } }
public void Set <T>(FuzzyValue <T> fuzzyValue) where T : struct, IConvertible { this.container.Set(fuzzyValue); }