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])); }
public abstract double Eval(InputValues inputs, AggregationMethod method);