private void AddRule(object obj)
        {
            LinguisticVariable linguistic = (LinguisticVariable)linguistics.Where(lv => lv.Title == ConsequentM.SelectedTitle).First();
            Antecedent         antecedent = AntecedentM.Make();
            Judgment           consequent = ConsequentM.Make();

            Rule newRule = new SimpleRule(linguistic, antecedent, consequent);

            SaveToDB(newRule);
        }
        private void SetEditedRule()
        {
            if (AntecedentM != null && ConsequentM != null)
            {
                LinguisticVariable linguistic = SelectedRule.LinguisticVariable;
                Antecedent         antecedent = AntecedentM.Make();
                Judgment           consequent = ConsequentM.Make();

                editedRule = new SimpleRule(linguistic, antecedent, consequent);
            }
        }
 private void SetAntecedentAndConsequent()
 {
     AntecedentM = new AntecedentM(
         linguistics,
         termSets,
         SelectedRule);
     ConsequentM = new ConsequentM(
         linguistics,
         termSets,
         SelectedRule.Consequent.Title,
         SelectedRule.Consequent.FuzzyValue);
 }
        private void Initialize()
        {
            using (DBManager db = new DBManager(DBManager.ConnectionString))
            {
                linguistics = db.GetLinguisticVariables();
                termSets    = db.GetTermSets();
            }

            AntecedentM = new AntecedentM(linguistics, termSets);
            AntecedentM.Initialize();
            ConsequentM = new ConsequentM(linguistics, termSets);
        }
 private bool CanAddRule(object obj)
 {
     return(AntecedentM.IsVerified() && ConsequentM.IsVerified());
 }