From a8d046e52eed9ee992cf9c82cd0322dff4a2d81e Mon Sep 17 00:00:00 2001 From: Lee Spector Date: Sat, 14 Oct 2023 16:43:14 -0400 Subject: [PATCH] Add autoconstructive hypervariability tournaments --- src/propeller/problems/boolean/mul3.cljc | 1 + src/propeller/variation.cljc | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/propeller/problems/boolean/mul3.cljc b/src/propeller/problems/boolean/mul3.cljc index 5989acd..09b0b6c 100644 --- a/src/propeller/problems/boolean/mul3.cljc +++ b/src/propeller/problems/boolean/mul3.cljc @@ -313,6 +313,7 @@ ;:tournament-size 5 :umad-rate 0.001 ;; ah-umad :ah-umad-rate 0.1 ;; ah-umad + :ah-umad-tournament-size 2 ;; ah-umad ;:umad-rate [1/2 ; 1/4 1/4 ; 1/8 1/8 1/8 diff --git a/src/propeller/variation.cljc b/src/propeller/variation.cljc index 49b2462..08b7e2b 100755 --- a/src/propeller/variation.cljc +++ b/src/propeller/variation.cljc @@ -302,10 +302,17 @@ The function `new-individual` returns a new individual produced by selection and ; :ah-umad (let [rate (utils/onenum (:umad-rate argmap)) - ah-rate (utils/onenum (:ah-umad-rate argmap))] - (-> (:plushy (selection/select-parent pop argmap)) - (ah-uniform-addition (:instructions argmap) rate ah-rate) - (ah-uniform-deletion rate ah-rate))) + ah-rate (utils/onenum (:ah-umad-rate argmap)) + tourn-size (utils/onenum (:ah-umad-tournament-size argmap)) + parent-genome (:plushy (selection/select-parent pop argmap)) + offspring (repeatedly + tourn-size + #(-> parent-genome + (ah-uniform-addition (:instructions argmap) rate ah-rate) + (ah-uniform-deletion rate ah-rate))) + hypervariabilities (map #(reduce + (ah-rates % 0 1)) + offspring)] + (second (last (sort-by first (map vector hypervariabilities offspring))))) ; :uniform-addition (-> (:plushy (selection/select-parent pop argmap))