Exemplo n.º 1
0
        public ITree <NodeModel> create()
        {
            var threadPool = new ThreadsPool(this, this.threadCount);
            var tree       = new WideTree(new DfsSearch <NodeModel>(), nodeProcessor, prune, threadPool);

            foreach (var visitor in visitors)
            {
                tree.AttachVisitor(visitor);
            }

            return(tree);
        }
Exemplo n.º 2
0
        public IThreadTree <NodeModel> create(NodeModel rootNode, Action <Thread> onThreadClose)
        {
            var searchCollection = new ExtendedPrioritySearch <NodeModel>(new SumNodeComparer <NodeModel>());

            searchCollection.Push(rootNode);

            var threadPool = new ThreadsPool(this, this.threadCount);
            var tree       = new WideTree(searchCollection, nodeProcessor, prune, threadPool);
            var threadTree = new ThreadTree(tree, onThreadClose);

            foreach (var visitor in visitors)
            {
                threadTree.AttachVisitor(visitor);
            }

            return(threadTree);
        }