public AllAlternatigJumpsTreeCollection(IJumpNodeTreeWithFactory parent, IAlphaBetaOptions alphaBetaOptions, ISearchNodeVisitor <JumpNode> afterMoveVisitor) { _alphaBetaOptions = alphaBetaOptions; _afterMoveVisitor = afterMoveVisitor; Parent = parent; _parentJumpNode = Parent.Node; }
public AlphaBetaSearch(IValueOf <T> valuer, IAlphaBetaOptions maxDepth, ISearchNodeVisitor <T> nodeVisitor) { _valuer = valuer; _maxDepth = maxDepth.SearchDepth; _depthCounter = new DepthCounterNodeVisitor <T>(); _nodeVisitor = _depthCounter.FollowedBy(nodeVisitor); }
public BruteForceMoveFindingStartegy(ISearchNodeVisitor <JumpNode> defaultNodeVistor, Func <ISearchNodeVisitor <JumpNode>, IPerformMoves, TargetBorder, ITreeSearch <JumpNode> > searchFactory, IPlayersState playersState, MovesFactory movesFactory) { _defaultNodeVistor = defaultNodeVistor; _movesFactory = movesFactory; _searchFactory = searchFactory; _playersState = playersState; }
public BruteForceMoveFindingStartegy(ISearchNodeVisitor<JumpNode> defaultNodeVistor, Func<ISearchNodeVisitor<JumpNode>, IPerformMoves, TargetBorder,ITreeSearch<JumpNode>> searchFactory, IPlayersState playersState, MovesFactory movesFactory) { _defaultNodeVistor = defaultNodeVistor; _movesFactory = movesFactory; _searchFactory = searchFactory; _playersState = playersState; }
public BruteForceMoveFindingStartegy( ISearchNodeVisitor <JumpNode> defaultNodeVistor, Func <ISearchNodeVisitor <JumpNode>, ITreeSearch <JumpNode> > searchFactory, IPlayersState playersState, MovesFactory movesFactory) { _defaultNodeVistor = defaultNodeVistor; _movesFactory = movesFactory; _searchFactory = (visotors, perfomer, target) => searchFactory(visotors); _playersState = playersState; }
public BruteForceMoveFindingStartegy( ISearchNodeVisitor<JumpNode> defaultNodeVistor, Func<ISearchNodeVisitor<JumpNode>,ITreeSearch<JumpNode>> searchFactory, IPlayersState playersState, MovesFactory movesFactory) { _defaultNodeVistor = defaultNodeVistor; _movesFactory = movesFactory; _searchFactory = (visotors,perfomer, target) => searchFactory(visotors); _playersState = playersState; }
public CuttoffsMoveFindingStrategy( ISearchNodeVisitor <JumpNode> defaultNodeVistor, Func <ISearchNodeVisitor <JumpNode>, IPerformMoves, TargetBorder, ITreeSearch <JumpNode> > searchFactory, IPlayersState playersState, MovesFactory movesFactory) { _defaultNodeVistor = defaultNodeVistor; _movesFactory = movesFactory; _searchFactory = searchFactory; _playersState = playersState; MaxVisitedNodes = int.MaxValue; }
public CuttoffsMoveFindingStrategy( ISearchNodeVisitor<JumpNode> defaultNodeVistor, Func<ISearchNodeVisitor<JumpNode>, IPerformMoves, TargetBorder,ITreeSearch<JumpNode>> searchFactory, IPlayersState playersState, MovesFactory movesFactory) { _defaultNodeVistor = defaultNodeVistor; _movesFactory = movesFactory; _searchFactory = searchFactory; _playersState = playersState; MaxVisitedNodes = int.MaxValue; }
public static IEnumerable <ITree <T> > TraverseDfs <T>(this ITree <T> tree, ISearchNodeVisitor <T> visitor, int depth) { if (depth == 0) { yield break; } visitor.OnEnter(tree, null); yield return(tree); foreach (var child in tree.Children.SelectMany(child => child.TraverseDfs(visitor, depth - 1))) { yield return(child); } visitor.OnLeave(tree, null); }
public CompisiteSearchNodeVisitor(ISearchNodeVisitor <TNode> first, ISearchNodeVisitor <TNode> second) { _first = first; _second = second; }
public BfsSearch(ISearchNodeVisitor <TNode> nodeVisitor, IAddRemoveCollection <ITree <TNode> > toVisit) { _nodeVisitor = nodeVisitor; _toVisit = toVisit; }
public BfsSearch(ISearchNodeVisitor <TNode> nodeVisitor) : this(nodeVisitor, new QueueAddRemoveCollection <ITree <TNode> >()) { }
public DfsSearch(ISearchNodeVisitor <TNode> nodeVisitor) { _nodeVisitor = nodeVisitor; }
public static ISearchNodeVisitor <TNode> FollowedBy <TNode>(this ISearchNodeVisitor <TNode> left, ISearchNodeVisitor <TNode> right) { return(new CompisiteSearchNodeVisitor <TNode>(left, right)); }
public static IEnumerable <ITree <T> > TraverseDfs <T>(this ITree <T> tree, ISearchNodeVisitor <T> visitor) { return(tree.TraverseDfs(visitor, int.MaxValue)); }