Beispiel #1
0
 public AllAlternatigJumpsTreeCollection(IJumpNodeTreeWithFactory parent, IAlphaBetaOptions alphaBetaOptions, ISearchNodeVisitor <JumpNode> afterMoveVisitor)
 {
     _alphaBetaOptions = alphaBetaOptions;
     _afterMoveVisitor = afterMoveVisitor;
     Parent            = parent;
     _parentJumpNode   = Parent.Node;
 }
Beispiel #2
0
 public AlternatingJumpsMovesTree(
     JumpNode jumpNode,
     Func <IJumpNodeTreeWithFactory, IEnumerable <IJumpNodeTreeWithFactory> > childFactory)
 {
     Node         = jumpNode;
     ChildFactory = childFactory;
     _children    = childFactory(this);
 }
 public AlternatingJumpsMovesTree(
     JumpNode jumpNode,
     Func<IJumpNodeTreeWithFactory, IEnumerable<IJumpNodeTreeWithFactory>> childFactory)
 {
     Node = jumpNode;
     ChildFactory = childFactory;
     _children = childFactory(this);
 }
Beispiel #4
0
 public PlaceBlackStonesForPlayer(
     IJumpNodeTreeWithFactory parent,
     IPlayersState playersState,
     Func <IPlaceBlackStone> blackStonePlacer)
 {
     _parent           = parent;
     _playersState     = playersState;
     _blackStonePlacer = blackStonePlacer;
     _parentJumpNode   = _parent.Node;
     _placersFactory   = new PlayerBlackStonePlacer(_parentJumpNode.ActualGraph, _playersState);
 }
Beispiel #5
0
        public IMoveFindingStartegy SmartAlphaBetaJumpOrStay()
        {
            var playersStateCopy = _playersStateCopy();
            var alphaBetaOptions = _phutballOptions.AlphaBeta.AllowNoMoveToBeTaken().HalfDepth();

            return(new AlphaBetaMoveFindingStrategy(
                       playersStateCopy, alphaBetaOptions,
                       (graph) => new AlternatingJumpsMovesTree(JumpNode.Empty(graph),
                                                                (parent) =>
                                                                new JumpCollectWhiteStonePlacesThenPutBlack(parent, alphaBetaOptions,
                                                                                                            playersStateCopy))
                       ));
        }
Beispiel #6
0
        public IMoveFindingStartegy AlphaBeta()
        {
            var playersStateCopy = _playersStateCopy();
            var alphaBetaOptions = _phutballOptions.AlphaBeta;

            return(new AlphaBetaMoveFindingStrategy(
                       playersStateCopy, alphaBetaOptions,
                       (graph) => new AlternatingJumpsMovesTree(JumpNode.Empty(graph),
                                                                (parent) =>
                                                                new FirstJumpThenPlaceStones(parent, alphaBetaOptions,
                                                                                             playersStateCopy))
                       ));
        }
Beispiel #7
0
        public IMoveFindingStartegy AlphaBetaJumpsOrStay()
        {
            var playersStateCopy = _playersStateCopy();
            var options          = _phutballOptions.AlphaBeta.AllowNoMoveToBeTaken();

            return(new AlphaBetaMoveFindingStrategy(playersStateCopy, options,
                                                    (graph) => new AlternatingJumpsMovesTree(JumpNode.Empty(graph),
                                                                                             (parent) => new AllAlternatigJumpsTreeCollection(parent, options))
                                                    ));
        }