Esempio 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;
            }
Esempio n. 2
0
 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;
 }
Esempio 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);
            }
Esempio n. 4
0
        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];
        }
Esempio n. 5
0
 public FuzzyVariable(T linguisticVariable, IMemebershipFunction membershipFunction)
 {
     FuzzyUtils.IsGenericParameterValid <T>();
     this.LinguisticVariable = linguisticVariable;
     this.MembershipFunction = membershipFunction;
 }
Esempio n. 6
0
 public FuzzyRule(T outputVar, IFuzzyExpression exp)
 {
     FuzzyUtils.IsGenericParameterValid <T>();
     this.OutputLinguisticVariable = outputVar;
     this.Expression = exp;
 }