From f8bdacc388af7ee9bb709bc6950be24f56cb6d3f Mon Sep 17 00:00:00 2001 From: Lee Spector Date: Sun, 22 Nov 2020 23:35:07 -0500 Subject: [PATCH] Remove debugging printing; update session.clj --- src/propeller/push/utils/helpers.cljc | 1 - src/propeller/session.cljc | 40 +++++---------------------- 2 files changed, 7 insertions(+), 34 deletions(-) diff --git a/src/propeller/push/utils/helpers.cljc b/src/propeller/push/utils/helpers.cljc index f9ab440..46eb572 100755 --- a/src/propeller/push/utils/helpers.cljc +++ b/src/propeller/push/utils/helpers.cljc @@ -32,7 +32,6 @@ (defn make-instruction [state function arg-stacks return-stack] (let [popped-args (get-args-from-stacks state arg-stacks)] - (println popped-args) (if (= popped-args :not-enough-args) state (let [result (apply function (:args popped-args)) diff --git a/src/propeller/session.cljc b/src/propeller/session.cljc index 8af6922..e638c35 100755 --- a/src/propeller/session.cljc +++ b/src/propeller/session.cljc @@ -7,24 +7,25 @@ [propeller.problems.string-classification :as string-classif] [propeller.push.core :as push] [propeller.push.interpreter :as interpreter] - [propeller.push.state :as state])) + [propeller.push.state :as state] + [propeller.push.utils.helpers :refer [get-stack-instructions]])) #_(interpreter/interpret-program '(1 2 :integer_add) state/empty-state 1000) -(interpreter/interpret-program +#_(interpreter/interpret-program '(3 3 :integer_eq :exec_if (1 "yes") (2 "no")) state/empty-state 1000) -(interpreter/interpret-program +#_(interpreter/interpret-program '(:in1 :string_reverse 1 :string_take "?" :string_eq :exec_if (:in1 " I am asking." :string_concat) (:in1 " I am saying." :string_concat)) (assoc state/empty-state :input {:in1 "Can you hear me?"}) 1000) -(interpreter/interpret-program +#_(interpreter/interpret-program '(:in1 :string_reverse 1 :string_take "?" :string_eq :exec_if (:in1 " I am asking." :string_concat) (:in1 " I am saying." :string_concat)) @@ -32,36 +33,9 @@ 1000) #_(genome/plushy->push - (genome/make-random-plushy push/default-instructions 20)) + (genome/make-random-plushy (get-stack-instructions #{:float :integer :exec :boolean}) 20)) -#_(interpreter/interpret-program - (genome/plushy->push - (genome/make-random-plushy push/default-instructions 20)) - (assoc state/empty-state :input {:in1 "I can hear you."}) - 1000) - -;; ============================================================================= -;; Target function: f(x) = x^3 + x + 3 -;; ============================================================================= - -#_(gp/gp {:instructions push/default-instructions - :error-function regression/error-function - :max-generations 50 - :population-size 200 - :max-initial-plushy-size 50 - :step-limit 100 - :parent-selection :tournament - :tournament-size 5}) - -#_(gp/gp {:instructions push/default-instructions - :error-function string-classif/error-function - :max-generations 50 - :population-size 200 - :max-initial-plushy-size 50 - :step-limit 100 - :parent-selection :lexicase}) - -#_(gp/gp {:instructions propeller.problems.software.number-io/instructions +(gp/gp {:instructions propeller.problems.software.number-io/instructions :error-function propeller.problems.software.number-io/error-function :max-generations 500 :population-size 500