Skip to content

Commit

Permalink
Merge pull request #8 from jarradh/update-actors
Browse files Browse the repository at this point in the history
Update Actors
  • Loading branch information
0xc1c4da committed Apr 1, 2016
2 parents 0fb047d + 2788d90 commit e791284
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 105 deletions.
17 changes: 4 additions & 13 deletions src/narjure/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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]
Expand All @@ -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)))

Expand Down
22 changes: 0 additions & 22 deletions src/narjure/general_inference/derived_task_creator.clj

This file was deleted.

32 changes: 0 additions & 32 deletions src/narjure/perception_action/anticipated_event.clj

This file was deleted.

22 changes: 0 additions & 22 deletions src/narjure/perception_action/cross_modal_integrator.clj

This file was deleted.

16 changes: 0 additions & 16 deletions src/narjure/perception_action/system_time.clj

This file was deleted.

22 changes: 22 additions & 0 deletions src/narjure/perception_action/task_creator.clj
Original file line number Diff line number Diff line change
@@ -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))

0 comments on commit e791284

Please sign in to comment.