csys, work in progress: retire neurons, improve location (space) stuff, ...
This commit is contained in:
parent
dd4956cd4f
commit
dc124a6eff
4 changed files with 22 additions and 7 deletions
|
|
@ -95,6 +95,7 @@
|
|||
|
||||
(defun synapse (rcvr &optional op)
|
||||
(lambda (msg)
|
||||
;(if (eql (message:domain msg) :_meta) (setf op (handle-syn-meta msg rcvr op)) (...))
|
||||
(let ((nmsg (if op (funcall op msg) msg)))
|
||||
(when nmsg
|
||||
(actor:send rcvr nmsg)))))
|
||||
|
|
@ -157,7 +158,7 @@
|
|||
(lambda (msg scope)
|
||||
(let* ((val (getf (shape:data msg) :value))
|
||||
(newval (+ val (value scope))))
|
||||
(util:lgi newval (length (syns scope)))
|
||||
;(util:lgi newval (length (syns scope)))
|
||||
(if (>= newval threshold)
|
||||
(let* ((head (new-msg-head msg scope))
|
||||
(msg (message:create head :data (list :value newval))))
|
||||
|
|
@ -179,9 +180,9 @@
|
|||
|
||||
(defun connect ()
|
||||
(lambda (msg scope)
|
||||
(let ((data (shape:data msg)))
|
||||
(setf (syns scope)
|
||||
(cons (synapse (getf data :target) (getf data :op)) (syns scope)))
|
||||
(let* ((data (shape:data msg))
|
||||
(syn (synapse (getf data :target) (getf data :op))))
|
||||
(push syn (syns scope))
|
||||
(values nil scope))))
|
||||
|
||||
(defun switch (&key (default :active))
|
||||
|
|
@ -189,9 +190,21 @@
|
|||
(let ((data (shape:data msg)))
|
||||
(setf (stage scope) (getf data :stage default))
|
||||
(set-proc scope)
|
||||
(util:lgi (stage scope) (proc scope) (syns scope))
|
||||
;(util:lgi (stage scope) (proc scope) (syns scope))
|
||||
(values nil scope))))
|
||||
|
||||
(defun retire (msg scope)
|
||||
;(environ:unregister *self*)
|
||||
;(environ:remove-pred-syns *self*)
|
||||
(setf (stage scope) :retired)
|
||||
(setf (syns scope) nil)
|
||||
(setf (proc scope)
|
||||
(lambda (msg scope)
|
||||
(util:lgw "message for retired cell" msg scope)
|
||||
;(notify ...)
|
||||
nil))
|
||||
(values nil scope))
|
||||
|
||||
;;;; synapse ops
|
||||
|
||||
(defun multiply (n)
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
"core/actor" "core/message"
|
||||
"forge/forge" "logging"
|
||||
"util/async" "util/util"))
|
||||
(:file "csys/csys" :depends-on ("core/core"))
|
||||
(:file "core/message" :depends-on ("core/actor" "shape/shape"))
|
||||
(:file "forge/forge" :depends-on ("util/iter" "util/util"))
|
||||
(:file "logging" :depends-on ("config" "util/util"))
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
(add-package-local-nickname :basic :scopes/csys/program/basic)
|
||||
(add-package-local-nickname :environ :scopes/csys/environ)
|
||||
(add-package-local-nickname :message :scopes/core/message)
|
||||
(add-package-local-nickname :shape :scopes/shape)
|
||||
|
||||
(scopes/util/async:init)
|
||||
(setf environ:*env* (environ:simple-setup (basic:config-b2)))
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
;;;; cl-scopes/test-core - testing for the scopes-core system.
|
||||
;;;; cl-scopes/test-core - testing for the scopes-core system
|
||||
;;;; including shape and util packages.
|
||||
|
||||
(defpackage :scopes/test-core
|
||||
(:use :common-lisp)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue