parallel-tree-search 0.2 → 0.2.1
raw patch · 2 files changed
+24/−3 lines, 2 files
Files
Control/Concurrent/ParallelTreeSearch.hs view
@@ -14,7 +14,7 @@ SearchQueue(..), SearchView(..), LIFO(..), FIFO(..), - parallelTreeSearch+ parallelDFS, parallelBFS, parallelTreeSearch ) where @@ -83,6 +83,27 @@ viewQ (FIFO q) = case Seq.viewl q of Seq.EmptyL -> EmptyQ x Seq.:< xs -> x :~ FIFO xs++-- |+-- Enumerate the leaves of a search tree concurrently in depth-first+-- order.+-- +parallelDFS :: Int -- ^ thread limit+ -> Int -- ^ work limit+ -> SearchTree a -- ^ tree to search+ -> IO [a]+parallelDFS tl wl t = parallelTreeSearch tl wl (LIFO [t])++-- |+-- Enumerate the leaves of a search tree concurrently in breadth-first+-- order.+-- +parallelBFS :: Int -- ^ thread limit+ -> Int -- ^ work limit+ -> SearchTree a -- ^ tree to search+ -> IO [a]+parallelBFS tl wl t = parallelTreeSearch tl wl (FIFO (Seq.singleton t))+ -- | -- This function enumerates the results stored in the queue of
parallel-tree-search.cabal view
@@ -1,5 +1,5 @@ Name: parallel-tree-search-Version: 0.2+Version: 0.2.1 Cabal-Version: >= 1.6 Synopsis: Parallel Tree Search Description: @@ -10,7 +10,7 @@ Category: Control, Concurrency License: PublicDomain License-File: LICENSE-Author: Sebastian Fischer+Author: Fabian Reck, Sebastian Fischer Maintainer: sebf@informatik.uni-kiel.de Bug-Reports: mailto:sebf@informatik.uni-kiel.de Homepage: http://github.com/sebfisch/parallel-tree-search