Esempio n. 1
0
        public static void CreateRandomStrategy()
        {
            OriginalStrategyDataSource ds = new OriginalStrategyDataSource();

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

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

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

            return(FreeStrategy);
        }
Esempio n. 4
0
 public static void Release(AssignmentStrategy strategy)
 {
     FreeStrategyPool.Push(strategy);
 }