示例#1
0
        public static void CreateRandomStrategy()
        {
            OriginalStrategyDataSource ds = new OriginalStrategyDataSource();

            ActiveStrategy = new AssignmentStrategy(ds);
            FreeStrategyPool.Clear();
        }
示例#2
0
        public static void CreateRandomStrategy()
        {
            PartialFixedStrategyDataSource ds = new PartialFixedStrategyDataSource();

            ActiveStrategy = new AssignmentStrategy(ds);
            FreeStrategyPool.Clear();
        }
示例#3
0
        public static AssignmentStrategy GetFromPool()
        {
            AssignmentStrategy FreeStrategy = null;
            bool b = FreeStrategyPool.TryPop(out FreeStrategy);

            if (!b)
            {
                FreeStrategy = ActiveStrategy.Clone();
            }

            return(FreeStrategy);
        }
示例#4
0
 public static void Release(AssignmentStrategy strategy)
 {
     FreeStrategyPool.Push(strategy);
 }