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