csys: minor fixes

This commit is contained in:
Helmut Merz 2026-03-03 22:13:25 +01:00
parent c6292309a4
commit 6ea6811103
2 changed files with 8 additions and 9 deletions

View file

@ -50,10 +50,10 @@
(defun find-sensors (msg) (defun find-sensors (msg)
(let* ((key (cddr (shape:head msg))) (let* ((key (cddr (shape:head msg)))
(sns (gethash key (sensors *environment*)))) (sns (gethash key (sensors *environment*))))
;(util:lgi key sns) (util:lgi key sns)
sns)) sns))
;;;; detectors: pseudo-neurons in environment, addressabel via message head ;;;; detectors: pseudo-neurons embedded in environment, addressable via message head
(defun do-log (msg state syns env) (defun do-log (msg state syns env)
(util:lgi msg)) (util:lgi msg))
@ -83,10 +83,10 @@
(defun std-proc (msg state syns env) (defun std-proc (msg state syns env)
;(util:lgi msg state) ;(util:lgi msg state)
(destructuring-bind (nmsg nst syns) (destructuring-bind (nmsg nst nsyns)
(handle-action msg state syns env :default #'remember) (handle-action msg state syns env :default #'remember)
(forward nmsg syns) (forward nmsg nsyns)
(actor:become (neuron #'std-proc nst syns env)))) (update-neuron #'std-proc nst nsyns env)))
(defun forward (msg syns) (defun forward (msg syns)
(dolist (s syns) (dolist (s syns)
@ -106,8 +106,7 @@
(list msg (shape:data msg) syns)) (list msg (shape:data msg) syns))
(defun create-sensor (msg state syns env) (defun create-sensor (msg state syns env)
(let ((key (shape:data msg)) (let* ((key (shape:data msg))
(sensor (actor:create (sensor (make-neuron actor:*self* :state key)))
(neuron #'std-proc 0 (list (synapse actor:*self*))))))
(setf (gethash key (sensors env)) (list sensor)) (setf (gethash key (sensors env)) (list sensor))
(list msg state syns))) (list msg state syns)))

View file

@ -49,7 +49,7 @@
(format stream "~&(~a ~a) = ~a~%" op args r) (format stream "~&(~a ~a) = ~a~%" op args r)
r))) r)))
;;;; date and time manipulations ;;;; date and time manipulations
(defconstant +unix-time-base+ (encode-universal-time 0 0 0 1 1 1970 0)) (defconstant +unix-time-base+ (encode-universal-time 0 0 0 1 1 1970 0))