07
Apr
11

Success!

Completed function for replacing some percentage of all point on a given tree with new subtrees

(defn mutateAll
“Mutates Across the board with p % of every point being replaced by a subtree”
[i p]
(let [old-genome (:genome i)
new-genome (loop [z old-genome i ((* count-points old-genome (/ p 100)) )]
(if (zero? i)
(zip/root (zip/replace z (random-code 20 pushcollider-atom-generators)))
(recur (zip/next z) (dec i))))]
(if (> (count-points new-genome) 50)
i
(individual. new-genome (evaluate new-genome)))))

~Tim




0 Responses to “Success!”


  1. No Comments

Leave a Reply

You must login to post a comment.