From 037baf9b2e38760617c29736b3a39b9748d95aa4 Mon Sep 17 00:00:00 2001 From: Lee Spector Date: Wed, 8 Nov 2023 19:17:16 -0500 Subject: [PATCH] Add :vary and :protect when using ah-umad --- src/propeller/gp.cljc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/propeller/gp.cljc b/src/propeller/gp.cljc index 1749ba6..b721eda 100644 --- a/src/propeller/gp.cljc +++ b/src/propeller/gp.cljc @@ -148,6 +148,15 @@ n (:autoconstructive-crossover-enrichment args)] (if (and prob (> prob 0)) (update args :instructions concat (repeat (or n 1) :gene)) + args))) + ; + adjust-for-ah-umad + (fn [args] + (let [prob (:ah-umad (:variation args)) + n (:ah-umad-enrichment args)] + (if (and prob (> prob 0)) + (update args :instructions concat (flatten (repeat (or n 1) [:vary :protect]))) args)))] (gp-loop (-> argmap - (adjust-for-autoconstructive-crossover))))) \ No newline at end of file + (adjust-for-autoconstructive-crossover) + (adjust-for-ah-umad))))) \ No newline at end of file