Example #1
0
        private static float GetValueOfAnticedent(FuzzyInputData fuzzyInput, FuzzyRulesList.FuzzyAnticedent anticedent)
        {
            float value = 0;

            switch (anticedent.isOrIsNot)
            {
            case FuzzyRulesList.FuzzyAnticedent.IsOrIsNot.Is:
                value = ValueIsRule(fuzzyInput, anticedent);
                break;

            case FuzzyRulesList.FuzzyAnticedent.IsOrIsNot.IsNot:
                value = ValueIsNotRule(fuzzyInput, anticedent);
                break;
            }

            return(value);
        }
Example #2
0
 private static float ValueIsNotRule(FuzzyInputData fuzzyInput, FuzzyRulesList.FuzzyAnticedent anticedent) => (!fuzzyInput[anticedent.input])[anticedent.state];