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)] b-genes (utils/extract-genes plushy-b)]
(flatten (flatten
(interpose :gap (interpose :gap
(mapv (fn [g] (remove empty?
(if (< (rand) rate) (mapv (fn [g]
(apply min-key #(bmx-distance g %) b-genes) (if (< (rand) rate)
g)) (apply min-key #(bmx-distance g %) b-genes)
a-genes))))) g))
a-genes))))))
(defn new-individual (defn new-individual
"Returns a new individual produced by selection and variation of "Returns a new individual produced by selection and variation of