Merge adjacent gaps

This commit is contained in:
Lee Spector 2023-12-10 23:11:08 -05:00
parent 435eb59371
commit 0b2024ec6e

View File

@ -180,11 +180,12 @@ The function `new-individual` returns a new individual produced by selection and
b-genes (utils/extract-genes plushy-b)]
(flatten
(interpose :gap
(mapv (fn [g]
(if (< (rand) rate)
(apply min-key #(bmx-distance g %) b-genes)
g))
a-genes)))))
(remove empty?
(mapv (fn [g]
(if (< (rand) rate)
(apply min-key #(bmx-distance g %) b-genes)
g))
a-genes))))))
(defn new-individual
"Returns a new individual produced by selection and variation of