diff --git a/src/propeller/genome.cljc b/src/propeller/genome.cljc index d61bcc7..cb18903 100755 --- a/src/propeller/genome.cljc +++ b/src/propeller/genome.cljc @@ -48,8 +48,8 @@ They hold the genetic material for an `individual`. In the initial population, w (plushy->push plushy {})) ;; call plushy->push-internal with possibly-preprocessed plushy ([plushy argmap] - (plushy->push-internal (if (or (> (or (:bmx (:variation argmap)) 0) 0) ;; must strip :gene - (> (or (:bmx-umad (:variation argmap)) 0) 0)) ;; must strip :gene - (filter (complement #{:gene}) plushy) + (plushy->push-internal (if (or (> (or (:bmx (:variation argmap)) 0) 0) ;; must strip :gap + (> (or (:bmx-umad (:variation argmap)) 0) 0)) ;; must strip :gap + (filter (complement #{:gap}) plushy) plushy) argmap))) \ No newline at end of file diff --git a/src/propeller/gp.cljc b/src/propeller/gp.cljc index 86c7be3..d133088 100644 --- a/src/propeller/gp.cljc +++ b/src/propeller/gp.cljc @@ -184,7 +184,7 @@ n (:bmx-enrichment args)] (if (or (and prob-bmx (> prob-bmx 0)) (and prob-bmx-umad (> prob-bmx-umad 0))) - (update args :instructions concat (repeat (or n 1) :gene)) + (update args :instructions concat (repeat (or n 1) :gap)) args)))] (gp-loop (-> argmap (adjust-for-bmx))))) diff --git a/src/propeller/utils.cljc b/src/propeller/utils.cljc index 27aa193..0f1ecc2 100755 --- a/src/propeller/utils.cljc +++ b/src/propeller/utils.cljc @@ -165,13 +165,13 @@ (defn count-genes "A utility for best match crossover (bmx). Returns the number of segments - between (and before and after) instances of :gene." + between (and before and after) instances of :gap." [plushy] - (inc (count (filter #(= % :gene) plushy)))) + (inc (count (filter #(= % :gap) plushy)))) (defn extract-genes "A utility for best match crossover (bmx). Returns the segments of the plushy - before/between/after instances of :gene." + before/between/after instances of :gap." [plushy] (loop [genes [] current-gene [] @@ -179,7 +179,7 @@ (cond (empty? remainder) (conj genes current-gene) ; - (= (first remainder) :gene) + (= (first remainder) :gap) (recur (conj genes current-gene) [] (rest remainder)) diff --git a/src/propeller/variation.cljc b/src/propeller/variation.cljc index a380c92..d575e27 100644 --- a/src/propeller/variation.cljc +++ b/src/propeller/variation.cljc @@ -139,7 +139,7 @@ The function `new-individual` returns a new individual produced by selection and [plushy-a plushy-b rate] (let [a-genes (utils/extract-genes plushy-a) b-genes (utils/extract-genes plushy-b)] - (flatten (interpose :gene + (flatten (interpose :gap (mapv (fn [g] (if (< (rand) rate) (apply min-key #(metrics/levenshtein-distance g %) b-genes)