# HG changeset patch # User Robert McIntyre # Date 1395283633 14400 # Node ID f689967c254593d24201c8a578226105910c6db9 # Parent 9e52b6730fd07b3db1608f16dc9b657608395608 modified phi-space lookup to return indices. diff -r 9e52b6730fd0 -r f689967c2545 org/worm_learn.clj --- a/org/worm_learn.clj Wed Mar 19 22:02:06 2014 -0400 +++ b/org/worm_learn.clj Wed Mar 19 22:47:13 2014 -0400 @@ -299,9 +299,6 @@ experiences {:touch touch-data :proprioception proprioception-data :muscle muscle-data}) - (if-let [res (phi-scan proprioception-data)] - (println-repl "lookup successful --" (count res)) - (println-repl "lookup failed")) (cond (grand-circle? @experiences) (println "Grand Circle") (curled? @experiences) (println "Curled") @@ -350,15 +347,28 @@ (defn gen-phi-scan [phi-space] (let [bin-keys (map bin [3 2 1]) bin-maps - (map (fn [bin-key phi-space] - (group-by (comp bin-key :proprioception) phi-space)) - bin-keys (repeat phi-space)) + (map (fn [bin-key] + (group-by + (comp bin-key :proprioception phi-space) + (range (count phi-space)))) bin-keys) lookups (map (fn [bin-key bin-map] (fn [proprio] (bin-map (bin-key proprio)))) bin-keys bin-maps)] (fn lookup [proprio-data] (some #(% proprio-data) lookups)))) +;; (defn gen-phi-scan [phi-space] +;; (let [bin-keys (map bin [3 2 1]) +;; bin-maps +;; (map (fn [bin-key phi-space] +;; (group-by (comp bin-key :proprioception) phi-space)) +;; bin-keys (repeat phi-space)) +;; lookups (map (fn [bin-key bin-map] +;; (fn [proprio] (bin-map (bin-key proprio)))) +;; bin-keys bin-maps)] +;; (fn lookup [proprio-data] +;; (some #(% proprio-data) lookups)))) + (defn init [] (def phi-space (generate-phi-space)) (def phi-scan (gen-phi-scan phi-space)) diff -r 9e52b6730fd0 -r f689967c2545 thesis/org/roadmap.org --- a/thesis/org/roadmap.org Wed Mar 19 22:02:06 2014 -0400 +++ b/thesis/org/roadmap.org Wed Mar 19 22:47:13 2014 -0400 @@ -205,10 +205,13 @@ *** DONE build an automatic "do all the things" sequence. CLOSED: [2014-03-19 Wed 16:55] SCHEDULED: <2014-03-19 Wed> CLOCK: [2014-03-19 Wed 16:53]--[2014-03-19 Wed 16:55] => 0:02 -*** TODO implement proprioception based movement lookup in phi-space +*** DONE implement proprioception based movement lookup in phi-space + CLOSED: [2014-03-19 Wed 22:04] SCHEDULED: <2014-03-19 Wed> + CLOCK: [2014-03-19 Wed 19:32]--[2014-03-19 Wed 22:04] => 2:32 +*** TODO make proprioception reference phi-space indexes SCHEDULED: <2014-03-19 Wed> - CLOCK: [2014-03-19 Wed 16:55] - CLOCK: [2014-03-19 Wed 16:53]--[2014-03-19 Wed 16:53] => 0:00 + CLOCK: [2014-03-19 Wed 22:07] + *** TODO create test videos, also record positions of worm segments