예제 #1
0
 // 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);
     }
 }
예제 #2
0
 // Reset the Expert System to start from the beginning
 public void Reset()
 {
     CurrentRule = KnowledgeBase.Find(x => x.RuleID == 1);
     RulesFired  = 1;
 }
예제 #3
0
 // Get the Next Rule from the knowledgebase
 public void NextRule()
 {
     CurrentRule = KnowledgeBase.Find(x => x.RuleID == CurrentRule.NextRuleID);
     RulesFired++;
 }