diff --git a/src/clojush/args.clj b/src/clojush/args.clj index 1ecc4c268..a7a002082 100644 --- a/src/clojush/args.clj +++ b/src/clojush/args.clj @@ -1,6 +1,3 @@ -;; gorilla-repl.fileformat = 1 - -;; @@ (ns clojush.args (:require [clj-random.core :as random]) (:use [clojush globals random util pushstate] @@ -198,6 +195,10 @@ ;; When using :autoconstructive-diversification-test :diffmeans-diversifying?, specifies ;; how many children of each child to generate and test. See genetic-operators.clj. + :autoconstructive-si-children 8 + ;; When using a "size and instruction" diversification test, specifies how many + ;; children to generate and test. See genetic-operators.clj. + :autoconstructive-fotd false ;; If true, autoconstruction will be performed using the 'flavor of the day' code in ;; genetic_operators.clj, which may change without fanfare. Other autoconstruction-related @@ -523,4 +524,3 @@ -;; @@ diff --git a/src/clojush/pushgp/genetic_operators.clj b/src/clojush/pushgp/genetic_operators.clj index 1518e1588..114a18290 100644 --- a/src/clojush/pushgp/genetic_operators.clj +++ b/src/clojush/pushgp/genetic_operators.clj @@ -1,6 +1,3 @@ -;; gorilla-repl.fileformat = 1 - -;; @@ (ns clojush.pushgp.genetic-operators (:use [clojush util random individual globals interpreter translate pushstate] clojush.instructions.tag @@ -573,7 +570,8 @@ programs encoded by genomes g1 and g2." (defn size-and-instruction-diversifying? "Returns true iff genome g passes the diversification test." [g argmap] - (let [kids (repeatedly 8 #(produce-child-genome-by-autoconstruction g g false argmap)) + (let [kids (repeatedly (:autoconstructive-si-children argmap) + #(produce-child-genome-by-autoconstruction g g false argmap)) instruction-set (fn [genome] (hash-set (keys (frequencies (map :instruction genome)))))] (and (not (some #{g} kids)) @@ -586,7 +584,8 @@ programs encoded by genomes g1 and g2." (let [make-child #(produce-child-genome-by-autoconstruction % % false argmap) instruction-set (fn [genome] (hash-set (keys (frequencies (map :instruction genome))))) - kids (repeatedly 8 #(make-child g)) + kids (repeatedly (:autoconstructive-si-children argmap) + #(make-child g)) grandkids (map make-child kids)] (and (apply distinct? (concat kids grandkids [g])) (not (apply = (map count kids))) @@ -755,4 +754,3 @@ be set globally or eliminated in the future." -;; @@