Пример #1
0
        private static FourInARowMove Common(String[] input, IGameAlgorithm algorithm, IGameFactory gameFactory)
        {
            FourInARowState state = PrepareState(input);

            IGameFactory factory = gameFactory;

            IGameLogic logic = factory.CreateLogic();

            IGameAlgorithm alg = algorithm;

            Int32 res = factory.CreateStateEvaluator().Evaluate(state, GamePlayer.PlayerMax);

            return((FourInARowMove)alg.FindBestMove(state, GamePlayer.PlayerMax));
        }
Пример #2
0
        public MiniMaxWithAlfaBetaPrunningB(Int32 depth, IGameFactory gameFactory)
        {
            if (depth < 1)
            {
                throw new ArgumentOutOfRangeException("depth");
            }

            if (null == gameFactory)
            {
                throw new ArgumentNullException("gameFactory");
            }

            _depth = depth;

            _gameFactory = gameFactory;

            _gameLogic = gameFactory.CreateLogic();

            _stateEvaluator = gameFactory.CreateStateEvaluator();
        }
Пример #3
0
        public MiniMaxAlgorithmImproved(Int32 depth, IGameFactory gameFactory, Boolean useParallel)
        {
            if (depth < 1)
            {
                throw new ArgumentOutOfRangeException("depth");
            }

            if (null == gameFactory)
            {
                throw new ArgumentNullException("gameFactory");
            }

            _useParallel = useParallel;

            _depth = depth;

            _gameFactory = gameFactory;

            _gameLogic = gameFactory.CreateLogic();

            _stateEvaluator = gameFactory.CreateStateEvaluator();
        }