Пример #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;
        }
Пример #2
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();
        }
Пример #3
0
 public RandomRule(SimpleLogger logger, string Name)
     : base(Name)
 {
     _logger = logger;
 }