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 FuzzyRuleSet(FuzzySet <T> varSet, List <FuzzyRule <T> > rules, IRuleEvaluator <T> ruleEvaluator, IFuzzyValuesMerger <T> outputsMerger, IDefuzzer <T> defuzzer) { FuzzyUtils.IsGenericParameterValid <T>(); this.rules = rules; this.OutputVarSet = varSet; this.OutputValueSet = new FuzzyValueSet(); this.RuleEvaluator = ruleEvaluator; this.OutputsMerger = outputsMerger; this.Defuzzer = defuzzer; }
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 FuzzySet() { FuzzyUtils.IsGenericParameterValid <T>(); var enumArr = FuzzyUtils.GetEnumValues <T>(); this.enumValues = new EnumKey <T> [enumArr.Length]; for (int i = 0; i < this.enumValues.Length; i++) { this.enumValues[i] = EnumKey <T> .From(enumArr[i]); } this._variables = new FuzzyVariable <T> [this.enumValues.Length]; }
public FuzzyVariable(T linguisticVariable, IMemebershipFunction membershipFunction) { FuzzyUtils.IsGenericParameterValid <T>(); this.LinguisticVariable = linguisticVariable; this.MembershipFunction = membershipFunction; }
public FuzzyRule(T outputVar, IFuzzyExpression exp) { FuzzyUtils.IsGenericParameterValid <T>(); this.OutputLinguisticVariable = outputVar; this.Expression = exp; }