Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updated examples to comply with new way of running pushgp

  • Loading branch information...
commit 5f381bc1bd144a95f22504d8cd3900b937ab6050 1 parent 8906a5d
@etosch etosch authored
View
20 src/clojush/examples/majority.clj
@@ -36,16 +36,14 @@ depth and number of nodes."
(defn majority-pushgp
"Run Order with pushgp."
[argmap]
- (let [size (or (:size argmap) 16)
- atom-generators (make-majority-instructions size)
- args (-> argmap
- (assoc :max-points (* 10 size))
- (assoc :max-points-in-initial-program (* 10 size))
- (assoc :error-function majority-fitness)
- (assoc :atom-generators atom-generators))]
- (println "problem-size =" size)
+ (let [size (or (:size argmap) 16)
+ atom-generators (make-majority-instructions size)]
(reset! global-problem-size size)
- (pushgp-map args)))
-; (System/exit 0))
-
+ (println "problem-size =" size)
+ (define-push-argmap
+ :max-points (* 10 size)
+ :max-points-in-initial-program (* 10 size)
+ :error-function majority-fitness
+ :atom-generators atom-generators)))
+
(majority-pushgp {})
View
2  src/clojush/examples/odd.clj
@@ -16,7 +16,7 @@
in
(fn [state] (push-item (stack-ref :auxiliary 0 state) :integer state)))
-(pushgp
+(define-push-argmap
:use-single-thread true
:error-function (fn [program]
(doall
View
2  src/clojush/examples/odd_csv_and_json.clj
@@ -18,7 +18,7 @@
in
(fn [state] (push-item (stack-ref :auxiliary 0 state) :integer state)))
-(pushgp
+(define-push-argmap
:use-single-thread true
:error-function (fn [program]
(doall
View
16 src/clojush/examples/order.clj
@@ -38,15 +38,15 @@ depth and number of nodes."
"Run Order with pushgp."
[argmap]
(let [size (or (:size argmap) 16)
- atom-generators (make-order-instructions size)
- args (-> argmap
- (assoc :max-points (* 10 size))
- (assoc :max-points-in-initial-program (* 10 size))
- (assoc :error-function order-fitness)
- (assoc :atom-generators atom-generators))]
- (println "problem-size =" size)
+ atom-generators (make-order-instructions size)]
(reset! global-problem-size size)
- (pushgp-map args)))
+ (println "problem-size =" size)
+ (define-push-argmap
+ :max-points (* 10 size)
+ :max-points-in-initial-program (* 10 size)
+ :error-function order-fitness
+ :atom-generators atom-generators)))
+
; (System/exit 0))
(order-pushgp {})
View
2  src/clojush/examples/scaled_sextic.clj
@@ -37,7 +37,7 @@
(println "targets" (into [] targets)))
(scaled-errors outputs targets 1000000 print-scaling-info))))
-(pushgp
+(define-push-argmap
:error-function sextic-scaled-error-function
:error-threshold 0.01
:atom-generators (concat
View
2  src/clojush/examples/tagged_regression.clj
@@ -20,7 +20,7 @@
in
(fn [state] (push-item (stack-ref :auxiliary 0 state) :integer state)))
-(pushgp
+(define-push-argmap
:error-function (fn [program]
(doall
(for [input (range 10)]
View
2  src/clojush/examples/tagged_tg8.clj
@@ -21,7 +21,7 @@
(define-registered in
(fn [state] (push-item (stack-ref :auxiliary 0 state) :integer state)))
-(pushgp
+(define-push-argmap
:error-function (fn [program]
(doall
(for [input (range 10)]
View
2  src/clojush/examples/tg8.clj
@@ -20,7 +20,7 @@
(define-registered in
(fn [state] (push-item (stack-ref :auxiliary 0 state) :integer state)))
-(pushgp
+(define-push-argmap
:error-function (fn [program]
(doall
(for [input (range 10)]
Please sign in to comment.
Something went wrong with that request. Please try again.