Exemple #1
0
 public override double Eval(InputValues inputs, AggregationMethod method)
 {
     return
         (method.OrOper(
              leftPredicate.Eval(inputs, method),
              rightPredicate.Eval(inputs, method)));
 }
 public FuzzyInferenceSystem(
     KnowledgeBase kb,
     Func <FuzzySet <double>, IEnumerable <double>, double> defuzzification,
     AggregationMethod method)
 {
     KB = kb;
     Defuzzification = defuzzification;
     Method          = method;
 }
Exemple #3
0
        public FuzzySet Eval(InputValues inputs, AggregationMethod method)
        {
            var antecedentVal = antecedent.Eval(inputs, method);

            return(new FuzzySet(
                       AggregationMethod.Combine(
                           method.ImplicationOper,
                           consecuent.Membership,
                           x => antecedentVal)));
        }
        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));
        }
 public override double Eval(InputValues inputs, AggregationMethod method)
 {
     return(fs.Membership(inputs[varName]));
 }
Exemple #6
0
 public abstract double Eval(InputValues inputs, AggregationMethod method);