예제 #1
0
 public override double Eval(InputValues inputs, AggregationMethod method)
 {
     return
         (method.OrOper(
              leftPredicate.Eval(inputs, method),
              rightPredicate.Eval(inputs, method)));
 }
예제 #2
0
 public FuzzyInferenceSystem(
     KnowledgeBase kb,
     Func <FuzzySet <double>, IEnumerable <double>, double> defuzzification,
     AggregationMethod method)
 {
     KB = kb;
     Defuzzification = defuzzification;
     Method          = method;
 }
예제 #3
0
파일: Rule.cs 프로젝트: pablodearmas/Fuzzy
        public FuzzySet Eval(InputValues inputs, AggregationMethod method)
        {
            var antecedentVal = antecedent.Eval(inputs, method);

            return(new FuzzySet(
                       AggregationMethod.Combine(
                           method.ImplicationOper,
                           consecuent.Membership,
                           x => antecedentVal)));
        }
예제 #4
0
        public double Compute(InputValues inputs)
        {
            if (!KB.CheckIntegrity(out var outputvarname))
            {
                throw new ArgumentException("Invalid KnowledgeBase");
            }

            var aggregation = KB.First().Eval(inputs, Method);
            var rules       = KB.Skip(1);

            foreach (var rule in rules)
            {
                var ruleSet = rule.Eval(inputs, Method);
                aggregation = new FuzzySet(
                    AggregationMethod.Combine(
                        Method.AggregationOper,
                        aggregation.Membership,
                        ruleSet.Membership));
            }

            return(Defuzzification(aggregation, KB.GetVar(outputvarname).Universe));
        }
예제 #5
0
 public override double Eval(InputValues inputs, AggregationMethod method)
 {
     return(fs.Membership(inputs[varName]));
 }
예제 #6
0
 public abstract double Eval(InputValues inputs, AggregationMethod method);