csys: provide generic functions for accessing neuron state
This commit is contained in:
parent
ff1183707a
commit
c04546ffe7
1 changed files with 10 additions and 4 deletions
|
|
@ -3,9 +3,7 @@
|
||||||
(defpackage :scopes/csys
|
(defpackage :scopes/csys
|
||||||
(:use :common-lisp)
|
(:use :common-lisp)
|
||||||
(:local-nicknames (:actor :scopes/core/actor)
|
(:local-nicknames (:actor :scopes/core/actor)
|
||||||
(:async :scopes/util/async)
|
|
||||||
(:config :scopes/config)
|
(:config :scopes/config)
|
||||||
(:core :scopes/core)
|
|
||||||
(:message :scopes/core/message)
|
(:message :scopes/core/message)
|
||||||
(:shape :scopes/shape)
|
(:shape :scopes/shape)
|
||||||
(:util :scopes/util)
|
(:util :scopes/util)
|
||||||
|
|
@ -61,7 +59,15 @@
|
||||||
(destructuring-bind (nmsg nst nsyns)
|
(destructuring-bind (nmsg nst nsyns)
|
||||||
(handle-action msg state syns env :default #'remember)
|
(handle-action msg state syns env :default #'remember)
|
||||||
(forward nmsg nsyns)
|
(forward nmsg nsyns)
|
||||||
(update-neuron #'std-proc nst nsyns env)))
|
(update-neuron (next-proc nst) nst nsyns env)))
|
||||||
|
|
||||||
|
;;;; neuron state methods
|
||||||
|
|
||||||
|
(defgeneric next-proc (state &optional default)
|
||||||
|
(:method (state &optional (default #'std-proc)) default))
|
||||||
|
|
||||||
|
(defgeneric value (state)
|
||||||
|
(:method (state) state))
|
||||||
|
|
||||||
;;;; sensors: neurons receiving messages from environment, addressable via message head
|
;;;; sensors: neurons receiving messages from environment, addressable via message head
|
||||||
|
|
||||||
|
|
@ -78,7 +84,7 @@
|
||||||
;(util:lgi key sns)
|
;(util:lgi key sns)
|
||||||
sns))
|
sns))
|
||||||
|
|
||||||
;;;; effectors: pseudo-neurons embedded in environment
|
;;;; effector procs for pseudo-neurons embedded in environment
|
||||||
|
|
||||||
(defun do-log (msg state syns env)
|
(defun do-log (msg state syns env)
|
||||||
(util:lgi msg))
|
(util:lgi msg))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue