Пример #1
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));
        }
Пример #2
0
 public override double Eval(InputValues inputs, AggregationMethod method)
 {
     return(fs.Membership(inputs[varName]));
 }
Пример #3
0
 public abstract double Eval(InputValues inputs, AggregationMethod method);