From f2f0804d757d59794776d9345b771d90f20d2547 Mon Sep 17 00:00:00 2001 From: Lee Spector Date: Sun, 7 Jun 2020 16:59:53 -0400 Subject: [PATCH] Add "session" file with expressions for REPL --- src/propeller/session.clj | 46 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/propeller/session.clj diff --git a/src/propeller/session.clj b/src/propeller/session.clj new file mode 100644 index 0000000..26f2e44 --- /dev/null +++ b/src/propeller/session.clj @@ -0,0 +1,46 @@ +(ns propeller.session + (:use [propeller core problems gp variation selection genome interpreter instructions pushstate util])) + + +#_(interpret-program '(1 2 integer_+) empty-push-state 1000) + +#_(interpret-program '(3 5 integer_= exec_if (1 "yes") (2 "no")) + empty-push-state + 1000) + +#_(interpret-program '(in1 string_reverse 1 string_take "?" string_= exec_if + (in1 " I am asking." string_concat) + (in1 " I am saying." string_concat)) + (assoc empty-push-state :input {:in1 "Can you hear me?"}) + 1000) + +#_(interpret-program '(in1 string_reverse 1 string_take "?" string_= exec_if + (in1 " I am asking." string_concat) + (in1 " I am saying." string_concat)) + (assoc empty-push-state :input {:in1 "I can hear you."}) + 1000) + +#_(push-from-plushy (make-random-plushy default-instructions 20)) + +#_(interpret-program (push-from-plushy (make-random-plushy default-instructions 20)) + (assoc empty-push-state :input {:in1 "I can hear you."}) + 1000) + +;; Target function: f(x) = x^3 + x + 3 + +#_(gp {:instructions 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 {:instructions default-instructions + :error-function string-classification-error-function + :max-generations 50 + :population-size 200 + :max-initial-plushy-size 50 + :step-limit 100 + :parent-selection :lexicase}) \ No newline at end of file