Skip to content

Instantly share code, notes, and snippets.

@eschulte
Created October 15, 2010 19:52
Show Gist options
  • Save eschulte/628831 to your computer and use it in GitHub Desktop.
Save eschulte/628831 to your computer and use it in GitHub Desktop.
(dorun
(take (to-int out-num)
(filter
#(= (:fitness %) (to-int test-num))
(map
#(do (println (pr-str %)) %)
(let [cross (to-int cross)
cross (if (< cross 1) cross (/ cross 100))]
(pmap
#(evaluate-asm % script (to-int timeout))
(filter
#(if max-len
(< (count (% :representation)) (to-int max-len))
%)
(repeatedly
(fn []
(if (< (rand) cross)
;; crossover
(crossover-asm (pick pop) (pick pop) (to-int cross-pt))
;; mutation
(mutate-asm (pick pop) mut-ops)))))))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment