Commit 492a9b74 authored by root's avatar root

Small fixes in test output

parent 29afcf66
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -28,6 +28,8 @@
;;For extending chunks, we should add merge-function, copy-function, and copy-from-chunk function values
;; -Fear Function names are constructed as "sensory-category/category"-"object/survival-category"
(defconstant +START-TIME+ (write-to-string (get-internal-real-time)))
(defun add-aa-to-chunks ()
(suppress-extension-warnings)
(extend-chunks fValue :default-value 0 :merge-function merge-chunks-fValue)
......@@ -243,32 +245,39 @@
(defun compute-arousal-factor (&optional pred-error-factor test)
(let ((aa (get-module Affective-Associations))
(phys (get-module physio)))
(if (and (probe-file "CEC-Arous.txt") test)
(with-open-file
(msgStream "CEC-Arous.txt"
:direction :output :if-exists :append :if-does-not-exist :create)
(format msgStream "f(Cortisol),g(Epinephrine),h(crh),Arousal~&"
(compute-homeostatic-arousal-factor) (compute-epi-arousal) (compute-crh-arousal)
(* (compute-homeostatic-arousal-factor) (+ (* (AA-epi-arous-ratio aa) (compute-epi-arousal)) (* (AA-crh-arous-ratio aa) (compute-crh-arousal)) )))))
(if (and (get-module physio) (phys-module-enabled phys))
(when (and (>= (mod (mp-time) 10) 0) (<= (mod (mp-time) 10) 1))
(with-open-file
(msgStream (concatenate 'string "Cort-EPI-CRH-Vals" (write-to-string (get-internal-real-time)) ".txt")
:direction :output :if-exists :append :if-does-not-exist :create)
(format msgStream "~5$,~5$,~5$,~5$~&"
(compute-cort) (compute-epi-arousal) (compute-crh-arousal)
(* (compute-homeostatic-arousal-factor) (compute-cort) (+ (* (AA-epi-arous-ratio aa) (compute-epi-arousal)) (* (AA-crh-arous-ratio aa) (compute-crh-arousal))))))))
(* (compute-homeostatic-arousal-factor) (compute-cort)
(+
(if (and (get-module physio) (phys-module-enabled phys))
(+
(* (AA-epi-arous-ratio aa) (compute-epi-arousal))
(* (AA-crh-arous-ratio aa) (compute-crh-arousal)))
0)
(if (and (get-module FEAR) (FEAR-enabled (get-module FEAR)))
(* (AA-FEAR-arous-ratio aa) (/ (FEAR-arousal (get-module FEAR)) (log (exp (FEAR-max-FEAR-val (get-module FEAR)))))) 0)
(if (and (numberp pred-error-factor) (> pred-error-factor 0))
(* (AA-pred-error-arous-ratio aa) pred-error-factor) 0)))))
;When physiology is enabled
(when (and (get-module physio) (phys-module-enabled phys))
(if test
(if (probe-file (concatenate 'string "CEC-Arous" +START-TIME+ ".txt"))
(when (and (>= (mod (mp-time) 10) 0) (<= (mod (mp-time) 10) 1))
(with-open-file
(msgStream (concatenate 'string "CEC-Arous" +START-TIME+ ".txt")
:direction :output :if-exists :append :if-does-not-exist :create)
(format msgStream "~5$,~5$,~5$,~5$~&"
(compute-cort test) (compute-epi-arousal test) (compute-crh-arousal test)
(* (compute-homeostatic-arousal-factor)
(compute-cort test)
(+ (* (AA-epi-arous-ratio aa)
(compute-epi-arousal))
(* (AA-crh-arous-ratio aa) (compute-crh-arousal)))))))
(with-open-file
(msgStream (concatenate 'string "CEC-Arous" +START-TIME+ ".txt")
:direction :output :if-exists :supersede :if-does-not-exist :create)
(format msgStream "f(Cortisol),g(Epinephrine),h(CRH),Arousal~&"))))
(* (compute-homeostatic-arousal-factor) (compute-cort)
(+
(if (and (get-module physio) (phys-module-enabled phys))
(+
(* (AA-epi-arous-ratio aa) (compute-epi-arousal))
(* (AA-crh-arous-ratio aa) (compute-crh-arousal)))
0)
(if (and (get-module FEAR) (FEAR-enabled (get-module FEAR)))
(* (AA-FEAR-arous-ratio aa)
(/ (FEAR-arousal (get-module FEAR)) (log (exp (FEAR-max-FEAR-val (get-module FEAR))))))
0)
(if (and (numberp pred-error-factor) (> pred-error-factor 0))
(* (AA-pred-error-arous-ratio aa) pred-error-factor)
0))))))
;;This function computes a factor to decay arousal slightly non-linearly (X^2) based
;; on how long it has been since the model has slept. By default, the function assumes
......@@ -796,14 +805,14 @@
(when (AA-chunk-arousal-switch AA)
(sgp-fct (list :bl-hook 'blc-arousal)))
(when (AA-chunk-affect-switch AA)
(print "AA-766")
(sgp-fct (list :activation-offsets 'FEAR-chunk-activation-offset))
(sgp-fct (list :activation-offsets 'SEEKING-chunk-activation-offset))
(schedule-periodic-event 0.016 'check-aur-loc-buffer-affect :module 'Affective-Associations :maintenance t :priority :max)
(schedule-periodic-event 0.016 'check-vis-loc-buffer-affect :module 'Affective-Associations :maintenance t :priority :max)
(schedule-periodic-event 0.100 'check-aur-buffer-affect :module 'Affective-Associations :maintenance t :priority :max)
(schedule-periodic-event 0.100 'check-vis-buffer-affect :module 'Affective-Associations :maintenance t :priority :max)
(schedule-periodic-event 0.016 'check-retr-buffer-affect :module 'Affective-Associations :maintenance t :priority :max))))
(schedule-periodic-event 0.016 'check-retr-buffer-affect :module 'Affective-Associations :maintenance t :priority :max))
t))
;;ACT-R Module functions
(defstruct AA
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment