From f9f1a9e22b0501d2ccbd71c1d21b35a46f940b3c Mon Sep 17 00:00:00 2001 From: Lee Spector Date: Wed, 1 Nov 2023 14:27:00 -0400 Subject: [PATCH] Strip :gene when using :autoconstructive-crossover --- src/propeller/genome.cljc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/propeller/genome.cljc b/src/propeller/genome.cljc index c9591fe..9ce9592 100755 --- a/src/propeller/genome.cljc +++ b/src/propeller/genome.cljc @@ -22,8 +22,9 @@ They hold the genetic material for an `individual`. In the initial population, w ([plushy] (plushy->push plushy {})) ([plushy argmap] (let [plushy (if (:diploid argmap) (map first (partition 2 plushy)) plushy) - plushy (if (> (or (:ah-umad (:variation argmap)) 0) 0) ;; strip :vary and :protect if using :ah-umad - (filter (complement #{:vary :protect}) plushy) + plushy (if (or (> (or (:ah-umad (:variation argmap)) 0) 0) ;; must strip :vary and :protect + (> (or (:autoconstructive-crossover (:variation argmap)) 0) 0)) ;; must strip :gene + (filter (complement #{:vary :protect :gene}) plushy) plushy) opener? #(and (vector? %) (= (first %) 'open))] ;; [open ] marks opens (loop [push () ;; iteratively build the Push program from the plushy