// Initializes the Expert System public int InitializeES() { //int test = LoadKnowledgeBase(); if (LoadKnowledgeBase() == 0) { CurrentRule = KnowledgeBase.ElementAt(0); RulesFired = 1; return(0); } else { // Initialization failed return -1 return(-1); } }
// Reset the Expert System to start from the beginning public void Reset() { CurrentRule = KnowledgeBase.Find(x => x.RuleID == 1); RulesFired = 1; }
// Get the Next Rule from the knowledgebase public void NextRule() { CurrentRule = KnowledgeBase.Find(x => x.RuleID == CurrentRule.NextRuleID); RulesFired++; }