Esempio n. 1
0
        public static RandomRule BuildRuleTree(int CurrentDepth, int MaxDepth
            , SimpleLogger logger, string Name)
        {
            RandomRule rr = new RandomRule(logger, Name);
            CurrentDepth += 1;

            if (CurrentDepth <= MaxDepth)
                rr.RegisterRules(
                    BuildRuleTree(CurrentDepth, MaxDepth, logger, Name + ".Passed")
                    , BuildRuleTree(CurrentDepth, MaxDepth, logger, Name + ".Failed"));

            return rr;
        }
Esempio n. 2
0
        public static RandomRule BuildRuleTree(int CurrentDepth, int MaxDepth
                                               , SimpleLogger logger, string Name)
        {
            RandomRule rr = new RandomRule(logger, Name);

            CurrentDepth += 1;

            if (CurrentDepth <= MaxDepth)
            {
                rr.RegisterRules(
                    BuildRuleTree(CurrentDepth, MaxDepth, logger, Name + ".Passed")
                    , BuildRuleTree(CurrentDepth, MaxDepth, logger, Name + ".Failed"));
            }

            return(rr);
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            SimpleLogger log = new SimpleLogger("RandomRuleBuilder");

            log.StartTimer("Building Rules");

            RandomRule baseRule = RandomRule.BuildRuleTree(0, 10, log, "BaseRule");

            log.StopTimer("Rules Built");

            Console.WriteLine(log.ToString());


            log.StartTimer("Begin Processing Rules");
            baseRule.Invoke();
            log.StopTimer("All Rules Processed");

            Console.WriteLine(log.ToString());

            Console.Read();
        }