コード例 #1
0
 public ESProvider(FactParser factParser, RuleParser ruleParser)
 {
     FactParser     = factParser;
     RuleParser     = ruleParser;
     FactRepository = FactParser.FactRepository;
     RuleRepository = RuleParser.RuleRepository;
     Answers        = new Dictionary <string, bool>();
     errorMessage   = "shit happens.";
 }
コード例 #2
0
 public ESProvider(FactParser factParser, RuleParser ruleParser)
 {
     factRepo        = factParser.GetFactRepository();
     ruleRepo        = ruleParser.GetRuleRepository();
     this.factParser = factParser;
     this.ruleParser = ruleParser;
     myenumrule      = ruleRepo.GetEnumerator();
     myenumfact      = factRepo.GetEnumerator();
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: markdioszegi/TW3
        static void Main(string[] args)
        {
            FactParser factParser = new FactParser("facts.xml");
            RuleParser ruleParser = new RuleParser("rules.xml");
            ESProvider provider   = new ESProvider(factParser, ruleParser);

            /* foreach (var fact in factParser.FactRepository.Facts)
             * {
             *  System.Console.WriteLine(fact.Description);
             * } */

            provider.CollectAnswers();

            /* Console.Write("Enter an ID: ");
             * Console.WriteLine(provider.GetAnswerByQuestion(Console.ReadLine())); */
            Console.WriteLine(provider.Evaluate());
        }