Skip to content

Commit

Permalink
Merge adjacent gaps
Browse files Browse the repository at this point in the history
  • Loading branch information
lspector committed Dec 11, 2023
1 parent 435eb59 commit 0b2024e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/propeller/variation.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0b2024e

Please sign in to comment.