diff --git a/src/narjure/core.clj b/src/narjure/core.clj index 0c79325..2163b82 100644 --- a/src/narjure/core.clj +++ b/src/narjure/core.clj @@ -11,14 +11,11 @@ [task-dispatcher :refer [task-dispatcher]]] [narjure.general-inference [active-concept-collator :refer [active-concept-collator]] - [derived-task-creator :refer [derived-task-creator]] [general-inferencer :refer [general-inferencer]]] [narjure.perception-action - [anticipated-event :refer [anticipated-event]] - [cross-modal-integrator :refer [cross-modal-integrator]] [operator-executor :refer [operator-executor]] [sentence-parser :refer [sentence-parser]] - [system-time :refer [system-time]]] + [task-creator :refer [task-creator]]] [taoensso.timbre :refer [info set-level!]]) (:refer-clojure :exclude [promise await]) (:import (ch.qos.logback.classic Level) @@ -29,32 +26,26 @@ ;co.paralleluniverse.actors.JMXActorMonitor (def actors-names #{:active-concept-collator - :anticipated-event :concept-creator - :cross-modal-integrator - :derived-task-creator :forgettable-concept-collator :general-inferencer :operator-executor :persistence-manager :sentence-parser - :system-time + :task-creator :task-dispatcher}) (defn create-system-actors "Spawns all actors which self register!" [] - (spawn active-concept-collator) (spawn anticipated-event) (spawn concept-creator) - (spawn cross-modal-integrator) - (spawn derived-task-creator) (spawn forgettable-concept-collator) (spawn general-inferencer) (spawn operator-executor) (spawn persistence-manager :state) (spawn sentence-parser) - (spawn system-time) + (spawn task-creator) (spawn task-dispatcher)) (defn check-actor [actor-name] @@ -77,7 +68,7 @@ (! :forgettable-concept-collator [:forgetting-tick-msg])) (defn system-tick [] - (! :system-time [:system-time-tick-msg])) + (! :task-creator [:system-time-tick-msg])) (defn prn-ok [msg] (info (format "\t[OK] %s" msg))) diff --git a/src/narjure/general_inference/derived_task_creator.clj b/src/narjure/general_inference/derived_task_creator.clj deleted file mode 100644 index f6aaca1..0000000 --- a/src/narjure/general_inference/derived_task_creator.clj +++ /dev/null @@ -1,22 +0,0 @@ -(ns narjure.general-inference.derived-task-creator - (:require - [narjure.actor.utils :refer [defactor]] - [taoensso.timbre :refer [debug]]) - (:refer-clojure :exclude [promise await])) - -(declare derived-task-creator system-time inference-result) - -(defactor derived-task-creator - "State is system-time." - {:time 0} - {:system-time-msg system-time - :inference-result-msg inference-result}) - -(def aname :derived-task-creator) - -(defn system-time [[_ time] _] - (debug aname "process-system-time") - {:time time}) - -(defn inference-result [_ _] - (debug aname "process-inference-result")) diff --git a/src/narjure/perception_action/anticipated_event.clj b/src/narjure/perception_action/anticipated_event.clj deleted file mode 100644 index 1f343f2..0000000 --- a/src/narjure/perception_action/anticipated_event.clj +++ /dev/null @@ -1,32 +0,0 @@ -(ns narjure.perception-action.anticipated-event - (:require - [co.paralleluniverse.pulsar.actors :refer [!]] - [narjure.actor.utils :refer [defactor]] - [taoensso.timbre :refer [debug]]) - (:refer-clojure :exclude [promise await])) - -(declare anticipated-event anticipated-event-handler system-time input-task) - -(def aname :anticipated-event) - -(defactor anticipated-event - "State is system-time and collection of anticipated events." - {:time 0 :anticipated-events {}} - {:system-time-msg system-time - :anticipated-event-msg anticipated-event-handler - :input-task-msg input-task}) - -(defn system-time - [[_ time] state] - (debug aname "process-system-time") - {:time time :anticipated-events (state :percepts)}) - -(defn anticipated-event-handler - [_ _] - #_(debug aname "process-anticipated-event")) - -(defn input-task - [[_ input-task] _] - #_(debug aname "process-input-task") - (! :task-dispatcher [:task-msg input-task])) - diff --git a/src/narjure/perception_action/cross_modal_integrator.clj b/src/narjure/perception_action/cross_modal_integrator.clj deleted file mode 100644 index fff1181..0000000 --- a/src/narjure/perception_action/cross_modal_integrator.clj +++ /dev/null @@ -1,22 +0,0 @@ -(ns narjure.perception-action.cross-modal-integrator - (:require - [narjure.actor.utils :refer [defactor]] - [taoensso.timbre :refer [debug]]) - (:refer-clojure :exclude [promise await])) - -(declare cross-modal-integrator system-time percept-sentence) - -(defactor cross-modal-integrator - "State is system-time and collection of precepts from current duration window." - {:time 0 :percepts []} - {:system-time-msg system-time - :percept-sentence-msg percept-sentence}) - -(def aname :cross-modal-integrator) - -(defn system-time [[_ time] state] - (debug aname "process-system-time") - {:time time :percepts (state :percepts)}) - -(defn percept-sentence [_ _] - (debug aname "process-percept-sentence")) diff --git a/src/narjure/perception_action/system_time.clj b/src/narjure/perception_action/system_time.clj deleted file mode 100644 index 7126290..0000000 --- a/src/narjure/perception_action/system_time.clj +++ /dev/null @@ -1,16 +0,0 @@ -(ns narjure.perception-action.system-time - (:require - [narjure.actor.utils :refer [defactor]] - [taoensso.timbre :refer [debug]]) - (:refer-clojure :exclude [promise await])) - -(declare system-time system-time-tick) - -(defactor system-time - "State is system-time." - 0 - {:system-time-tick-msg system-time-tick}) - -(defn system-time-tick [_ state] - ;(debug :system-time (str "process-system-time-tick " state)) - (inc state)) diff --git a/src/narjure/perception_action/task_creator.clj b/src/narjure/perception_action/task_creator.clj new file mode 100644 index 0000000..7ad67cb --- /dev/null +++ b/src/narjure/perception_action/task_creator.clj @@ -0,0 +1,22 @@ +(ns narjure.perception-action.task-creator + (:require + [narjure.actor.utils :refer [defactor]] + [taoensso.timbre :refer [debug]]) + (:refer-clojure :exclude [promise await])) + +(declare task-creator sentence) + +(defactor task-creator + "Creates task from Sentence + - Sets source property based on origin + - Add serial-no + - Converts tense to occurrence time (has system time in state)" + {:sentence-msg sentence + :system-time-tick-msg system-time-tick}) + +(defn sentence [_ _] + (debug aname "process-sentence")) + +(defn system-time-tick [_ state] + ;(debug :system-time (str "process-system-time-tick " state)) + (inc state))