Hi,

3 questions:

1. Are you sure your moves list at the op level is in a vector?
  Looking at the code for reducers, it seems that it is the only
implementation actually doing concurrency.
2. The default block size for spawning a new thread is 512. Meaning
that if you have
  less than 512 first move in your game (quite likely, or else your
tree is too highly branching to do anything
 by min-max anyway), then it is only working on one thread.
This is tuned for large data set with moderate amount of work per datum.
Exactly the opposite of your workload. (Only 20 datums, but a lot of
work per datum).
 You will want to change the size of the block to something like 1, 2 or 3.
 So your last line should look like that:

(defn best-move "Start folding here." [dir b d]
  (r/fold 1 best best
   (r/map #(Move-Value. (:move %) (search score-by-count (:tree %) d))
                                       (:children (game-tree dir b
next-level)))))
3. I have doubte about your best function. The first branch should
return something that the second branch can read.
I suggest:
(defn best
([] nil)
([best1 best2]
  (cond
    (nil? best1) best2
    (nil? best2) best1)
    t (if (>= (:value best1) (:value best2))
             best1 best2))))


With these modifications, it should run in // and be quite fast.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to