;;;
If your browser supports JAVA, you can display the data in a graph by checking the Graphic output box on the interface page.;;; -*- mode: LISP; Package: CL-USER; Syntax: COMMON-LISP; Base: 10 -*- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Author : Mike Byrne ;;; Copyright : (c)1998 CMU/Mike Byrne, All Rights Reserved ;;; Availability: public domain ;;; Address : Carnegie Mellon University ;;; : Psychology Department ;;; : Pittsburgh,PA 15213-3890 ;;; : byrne+@andrew.cmu.edu ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Filename : prp1-dual-task.model ;;; Version : 1.0 ;;; ;;; Description : Model file for the PRP Arithmetic experiment, modified for ;;; : use with the Web version of ACT-R. This file models the ;;; : dual-task or PRP conditions. ;;; : To run a single trial, call: ;;; : (run-prp-trial-prp1d x y) where X is the SOA (in seconds) and ;;; : Y is T for "difficult" T2 addition and NIL for "easy" ;;; : To run a block of N trials and get averaged results, call: ;;; : (run-prp-block-prp1d n x y) where X and Y are as above. ;;; : To run a block at every SOA and both difficuties, call: ;;; : (run-all-conditions-prp1d n) where N is the number of runs ;;; : in each block. ;;; ;;; ;;; ----- History ----- ;;; 98.02.03 Mike Byrne ;;; : Modified original files for Web use. ;;; 98.02.13 Dan Bothell ;;; : General changes to facilitate running over the web: ;;; : a) function names, macro names, structure names, and class ;;; : names changed by appending -prp1d (if not already part of ;;; : the name) to avoid conflict with other models (current ;;; : and future) ;;; : b) changed several variables to constants ;;; : c) added *local-symbols* and *WWW-interface* ;;; : d) added output-prp1d function for displaying data in ;;; : tables, and graphs (on the web) ;;; : e) removed functions and macros that were never used ;;; : f) renamed test-block to test-one-block (to fix a problem ;;; : I am not quite sure of...) ;;; ;;; 98.03.16 Dan Bothell ;;; : further mangled the code, by appending -prp1d to the method ;;; : names. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defvar *www-interface*) (setf *WWW-interface* '((:heading "Simulation of the Dual task PRP arithmetic experiment" 2) (:table) (:table) "Noise (s): " (:string :sy *noise* .27) (:new-row) "Latency Factor (F): " (:string :sy *lf* .85) (:new-row) "Digit Recode time (sec.): " (:string :sy *dr* .35) (:new-row) "Digit Detection Delay (sec.): " (:string :sy *dd* .2) (:new-row) "Base level activiation for encoding chunks: " (:string :sy *cs* 3) (:new-row) "Number of runs (3-20): " (:string :sy *runs* 3) (:table-end) (:table) (:checkbox "Trace" :sy *vflag* nil) (:new-row) (:checkbox "Text output" :sy *text* t) (:new-row) (:checkbox "Graphic output" :sy *graphic* nil) (:new-row) (:checkbox "Show simulation and experiment data on one graph" :sy *overlay* nil) (:table-end) (:table-end) (:new-para) (:heading "Model not currently available" 2) #| (:button "Show Experiment Results" "(output-prp1d *prp1d-exp-data* nil)") (:new-para) (:button "Run model" "(if (and (numberp *noise*) (numberp *lf*) (numberp *dr*) (numberp *dd*) (numberp *cs*) (numberp *runs*)) (progn (run-all-conditions-prp1d (min 20 (max 3 *runs*))) (window-close *experiment*) (setf *experiment* nil)) (format *standard-output* \"All parameters must be numbers~%\"))") (:reset "Default values") (:button "Production Rules" "(let ((prods (no-output (pp)))) (dolist (x prods) (pp-fct (list x)) (spp-fct (list x)) (format *standard-output* \"~%\")))") (:button "Chunk types" "(chunk-type)") (:button "Chunks" "(dm)") (:new-para) "TIME and SIZE:" (:new-para) "- It usually takes about 5 minutes for 3 runs of the model" (:new-line) "- The trace of 3 runs is approximatly 150k (100 pages) in size" |# (:new-para))) (defvar *vflag* t) (defvar *cs* 3.00) (defvar *lf* 0.85) (defvar *dr* 0.35) (defvar *switch* nil) (defvar *noise* 0.25) (defvar *experiment* nil) (setf *experiment* nil) (defvar *dd* .2) ;;;; ---------------------------------------------------------------------- ;;;; ;;;; Numbers stuff ;;;; previously these were variables, but they have been changed to ;;;; constants, and had the names modified for running over the web (defparameter *twenty-names-prp1d* (make-array 20 :initial-contents '("zero" "one" "two" "three" "four" "five" "six" "seven" "eight" "nine" "ten" "eleven" "twelve" "thirteen" "fourteen" "fifteen" "sixteen" "seventeen" "eighteen" "nineteen"))) (defparameter *tens-names-prp1d* (make-array 11 :initial-contents '("zero" "ten" "twenty" "thirty" "forty" "fifty" "sixty" "seventy" "eighty" "ninety" "one-hundred"))) (defparameter *addition-base-levels-prp1d* '(0.118 0.061 -0.000 -0.065 -0.133 -0.207 -0.288 -0.375 -0.469 -0.575 0.061 0.004 -0.057 -0.122 -0.190 -0.264 -0.345 -0.432 -0.526 -0.631 -0.000 -0.057 -0.117 -0.182 -0.251 -0.325 -0.406 -0.492 -0.587 -0.693 -0.065 -0.122 -0.182 -0.246 -0.316 -0.390 -0.469 -0.557 -0.652 -0.757 -0.133 -0.190 -0.251 -0.316 -0.385 -0.458 -0.538 -0.625 -0.721 -0.826 -0.207 -0.264 -0.325 -0.390 -0.458 -0.533 -0.612 -0.699 -0.795 -0.900 -0.288 -0.345 -0.406 -0.469 -0.538 -0.612 -0.693 -0.780 -0.875 -0.979 -0.375 -0.432 -0.492 -0.557 -0.625 -0.699 -0.780 -0.866 -0.961 -1.067 -0.469 -0.526 -0.587 -0.652 -0.721 -0.795 -0.875 -0.961 -1.056 -1.161 -0.575 -0.631 -0.693 -0.757 -0.826 -0.900 -0.979 -1.067 -1.161 -1.268)) (defparameter *addition-arg1-ia-prp1d* '(2.015 1.322 1.322 1.322 1.322 1.322 1.322 1.322 1.322 1.322 1.379 2.072 1.379 1.379 1.379 1.379 1.379 1.379 1.379 1.379 1.440 1.440 2.133 1.440 1.440 1.440 1.440 1.440 1.440 1.440 1.504 1.504 1.504 2.197 1.504 1.504 1.504 1.504 1.504 1.504 1.573 1.573 1.573 1.573 2.266 1.573 1.573 1.573 1.573 1.573 1.647 1.647 1.647 1.647 1.647 2.340 1.647 1.647 1.647 1.647 1.727 1.727 1.727 1.727 1.727 1.727 2.420 1.727 1.727 1.727 1.814 1.814 1.814 1.814 1.814 1.814 1.814 2.507 1.814 1.814 1.909 1.909 1.909 1.909 1.909 1.909 1.909 1.909 2.602 1.909 2.014 2.014 2.014 2.014 2.014 2.014 2.014 2.014 2.014 2.707)) (defparameter *addition-arg2-ia-prp1d* '(2.015 1.379 1.440 1.504 1.573 1.647 1.727 1.814 1.909 2.014 1.322 2.072 1.440 1.504 1.573 1.647 1.727 1.814 1.909 2.014 1.322 1.379 2.133 1.504 1.573 1.647 1.727 1.814 1.909 2.014 1.322 1.379 1.440 2.197 1.573 1.647 1.727 1.814 1.909 2.014 1.322 1.379 1.440 1.504 2.266 1.647 1.727 1.814 1.909 2.014 1.322 1.379 1.440 1.504 1.573 2.340 1.727 1.814 1.909 2.014 1.322 1.379 1.440 1.504 1.573 1.647 2.420 1.814 1.909 2.014 1.322 1.379 1.440 1.504 1.573 1.647 1.727 2.507 1.909 2.014 1.322 1.379 1.440 1.504 1.573 1.647 1.727 1.814 2.602 2.014 1.322 1.379 1.440 1.504 1.573 1.647 1.727 1.814 1.909 2.707)) (defparameter *multiplication-base-levels-prp1d* '(-0.228 -0.285 -0.346 -0.410 -0.480 -0.553 -0.632 -0.720 -0.815 -0.921 -0.285 -0.342 -0.403 -0.467 -0.536 -0.611 -0.690 -0.777 -0.873 -0.977 -0.346 -0.403 -0.464 -0.529 -0.596 -0.670 -0.750 -0.837 -0.933 -1.038 -0.410 -0.467 -0.529 -0.593 -0.661 -0.735 -0.815 -0.901 -0.996 -1.103 -0.480 -0.536 -0.596 -0.661 -0.730 -0.805 -0.884 -0.972 -1.066 -1.170 -0.553 -0.611 -0.670 -0.735 -0.805 -0.877 -0.958 -1.046 -1.139 -1.245 -0.632 -0.690 -0.750 -0.815 -0.884 -0.958 -1.038 -1.125 -1.220 -1.326 -0.720 -0.777 -0.837 -0.901 -0.972 -1.046 -1.125 -1.211 -1.306 -1.410 -0.815 -0.873 -0.933 -0.996 -1.066 -1.139 -1.220 -1.306 -1.403 -1.506 -0.921 -0.977 -1.038 -1.103 -1.170 -1.245 -1.326 -1.410 -1.506 -1.612)) (defparameter *multiplication-arg1-ia-prp1d* '(2.016 1.322 1.322 1.322 1.322 1.322 1.322 1.322 1.322 1.322 1.379 2.073 1.379 1.379 1.379 1.379 1.379 1.379 1.379 1.379 1.440 1.440 2.133 1.440 1.440 1.440 1.440 1.440 1.440 1.440 1.504 1.504 1.504 2.198 1.504 1.504 1.504 1.504 1.504 1.504 1.573 1.573 1.573 1.573 2.266 1.573 1.573 1.573 1.573 1.573 1.647 1.647 1.647 1.647 1.647 2.340 1.647 1.647 1.647 1.647 1.727 1.727 1.727 1.727 1.727 1.727 2.420 1.727 1.727 1.727 1.814 1.814 1.814 1.814 1.814 1.814 1.814 2.507 1.814 1.814 1.909 1.909 1.909 1.909 1.909 1.909 1.909 1.909 2.602 1.909 2.014 2.014 2.014 2.014 2.014 2.014 2.014 2.014 2.014 2.707)) (defparameter *multiplication-arg2-ia-prp1d* '(2.016 1.379 1.440 1.504 1.573 1.647 1.727 1.814 1.909 2.014 1.322 2.073 1.440 1.504 1.573 1.647 1.727 1.814 1.909 2.014 1.322 1.379 2.133 1.504 1.573 1.647 1.727 1.814 1.909 2.014 1.322 1.379 1.440 2.198 1.573 1.647 1.727 1.814 1.909 2.014 1.322 1.379 1.440 1.504 2.266 1.647 1.727 1.814 1.909 2.014 1.322 1.379 1.440 1.504 1.573 2.340 1.727 1.814 1.909 2.014 1.322 1.379 1.440 1.504 1.573 1.647 2.420 1.814 1.909 2.014 1.322 1.379 1.440 1.504 1.573 1.647 1.727 2.507 1.909 2.014 1.322 1.379 1.440 1.504 1.573 1.647 1.727 1.814 2.602 2.014 1.322 1.379 1.440 1.504 1.573 1.647 1.727 1.814 1.909 2.707)) ;;;; ---------------------------------------------------------------------- ;;;; ;;;; From "prp1-ext.lisp" ;;;; ---------------------------------------------------------------------- ;;;; ;;; ;;; Macros ;;; (defmacro while-prp1d (test &body body) `(do () ((not ,test)) ,@body)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; trial-prp1d stuff (defstruct trial-prp1d kind ;; either PRP, ADD, or MULT soa ;; the SOA for the two mult1 ;; first multiplier mult2 ;; second multiplier rt1 ;; RT to the multiplication task (audio) add1 ;; first addend add2 ;; second addend sum ;; presented sum (may not be actual sum) add-hard ;; NIL = easy, T = hard add-match ;; NIL = no match, T = match rt2 ;; RT to the addition task add-corr ;; Got T2 correct? main-block ;; block of the experiment sub-block ;; sub-block ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Experiment management stuff (defclass experiment-window-prp1d (dialog) ((trial-list :accessor trial-list :initform nil) (addition-item :accessor addn-item) (current-trial :accessor current-trial) (start-time :accessor start-time) (num-blocks :accessor nblocks :initarg :nblocks) (current-block :accessor cblock :initform 0) (sub-block :accessor sub-block :initform 0) (completed-trials :accessor completed-trials :initform nil) ) (:default-initargs :view-position #@(2 39) :view-size #@(636 439) :window-title "PRP Experiment" :close-box-p NIL)) (defmethod install-text-prp1d ((self experiment-window-prp1d)) "Installs the text item to be used for displaying text" (setf (addn-item self) (make-instance 'static-text-dialog-item :view-font '("Helvetica" 18) :view-size #@(200 32) :view-position #@(260 200)))) (defmethod initialize-instance-prp1d ((self experiment-window-prp1d) &key) "Does all the setup stuff necessary to run the experiment" (install-text-prp1d self)) (defmethod set-addn-prob-prp1d ((self experiment-window-prp1d)) "Setst the string for addition problem presentation" (let ((ct (current-trial self))) (set-dialog-item-text (addn-item self) (format nil "~A + ~A = ~A" (trial-prp1d-add1 ct) (trial-prp1d-add2 ct) (trial-prp1d-sum ct))))) (defmethod show-addn-prp1d ((self experiment-window-prp1d)) "Show that addition problem" (add-subviews self (addn-item self)) (view-focus-and-draw-contents (addn-item self))) (defmethod setup-trial-prp1d ((self experiment-window-prp1d)) "Does the setup for a trial" (reset) ;(pm-reset) (setf (current-trial self) (pop (trial-list self))) (when (current-trial self) (do-prp-trial-prp1d self))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Misc utility stuff (defun random-num-prp1d (max &optional (not-this 0)) "Returns a random number--not zero--with max of MAX and not= NOT-THIS" (let ((num not-this)) (while-prp1d (= num not-this) (setf num (1+ (random max)))) num)) ;;;; ---------------------------------------------------------------------- ;;;; ;;;; From "prp1-1-act.lisp" ;;;; ---------------------------------------------------------------------- ;;;; (defclass act-prp1d-window (experiment-window-prp1d) ((waiting-for-key :accessor key-waiting-p :initform nil) (waiting-for-sound :accessor sound-waiting-p :initform nil) (show-time :accessor show-time :initform nil) )) (defun check-screen-window-prp1d (time) (when (numberp (show-time *experiment*)) (cond (*switch* (pm-timed-event (+ 0.9 (trial-prp1d-soa (current-trial *experiment*))) #'show-screen-prp1d) (setf (show-time *experiment*) nil)) ((>= time (show-time *experiment*)) (setf (show-time *experiment*) nil) (show-screen-prp1d))))) (defmethod end-trial-prp1d ((tw act-prp1d-window)) (when (subviews tw) (remove-subviews tw (addn-item tw))) (let ((ct (current-trial tw))) (when *verbose* (format t "~%----------~%SOA: ~S~%" (trial-prp1d-soa ct)) (format t "Mult RT: ~6,3F~%" (trial-prp1d-rt1 ct)) (format t "Addn RT: ~6,3F~%---------~%" (trial-prp1d-rt2 ct))) (push ct (completed-trials tw)))) (defmethod view-key-event-handler ((tw act-prp1d-window) key) (declare (ignore key)) (format t "key handler called~%") (when (key-waiting-p *experiment*) (setf (key-waiting-p *experiment*) nil) (let ((ct (current-trial *experiment*))) (setf (trial-prp1d-rt2 ct) (- (mp-time *mp*) (start-time *experiment*) (trial-prp1d-soa ct))) (when (or (eql (trial-prp1d-kind ct) 'ADD) (not (sound-waiting-p *experiment*))) (end-trial-prp1d *experiment*))))) (defmethod do-prp-trial-prp1d ((tw act-prp1d-window)) "Do a PRP trial, i.e. both multiplication and addition" (setf (start-time tw) (+ (pm-get-time) 0.9)) (setf (key-waiting-p tw) t) (setf (sound-waiting-p tw) t) (setf *switch* nil) (let ((ct (current-trial tw))) (set-addn-prob-prp1d tw) (pm-play-digit-prp1d (trial-prp1d-mult1 ct) 0.0) (pm-play-digit-prp1d (trial-prp1d-mult2 ct) 0.9) (setf (show-time tw) (+ 0.9 (trial-prp1d-soa ct))))) (defun mul-avg-prp1d (tlis) (pprint tlis) (let ((accum 0)) (dolist (trial tlis) (incf accum (trial-prp1d-rt1 trial))) (float (/ accum (length tlis))))) (defun add-avg-prp1d (tlis) (let ((accum 0)) (dolist (trial tlis) (incf accum (trial-prp1d-rt2 trial))) (float (/ accum (length tlis))))) (defun heard-sound-prp1d (time text) (declare (ignore text)) (when (sound-waiting-p *experiment*) (setf (sound-waiting-p *experiment*) nil) (let ((ct (current-trial *experiment*))) (setf (trial-prp1d-rt1 ct) (- time (start-time *experiment*) -0.1)) (when (or (eql (trial-prp1d-kind ct) 'MULT) (not (key-waiting-p *experiment*))) (end-trial-prp1d *experiment*))))) (defun show-screen-prp1d () (show-addn-prp1d *experiment*) (pm-proc-display) (update-attended-loc (vis-m *mp*))) (defun pm-play-digit-prp1d (num time) (new-digit-sound (format nil "~A" num) time)) (defun build-window-prp1d () (setf *experiment* (make-instance 'act-prp1d-window :nblocks 2)) (initialize-instance-prp1d *experiment*) (PM-INSTALL-DEVICE *experiment*)) (defun run-prp-trial-prp1d (soa diff?) "Run one PRP trial" (unless *experiment* (build-window-prp1d)) (let ((the-trial (make-trial-prp1d :kind 'PRP :soa soa :add-hard diff? :mult1 (random-num-prp1d 9 1) :add1 (random-num-prp1d 4))) (match? (when (zerop (random 2)))) ) (setf (trial-prp1d-mult2 the-trial) (random-num-prp1d 9 (trial-prp1d-mult1 the-trial))) (setf (trial-prp1d-add2 the-trial) (random-num-prp1d 4 (trial-prp1d-add1 the-trial))) (setf (trial-prp1d-sum the-trial) (+ (trial-prp1d-add1 the-trial) (trial-prp1d-add2 the-trial))) (unless (setf (trial-prp1d-add-match the-trial) match?) (if (zerop (random 2)) (incf (trial-prp1d-sum the-trial) (1+ (random 2))) (decf (trial-prp1d-sum the-trial) (1+ (random 2))))) (when diff? (incf (trial-prp1d-add1 the-trial) 5) (incf (trial-prp1d-add2 the-trial) 5) (incf (trial-prp1d-sum the-trial) 10)) (push the-trial (trial-list *experiment*))) (setup-trial-prp1d *experiment*) (goal-focus topgoal) (pm-run 10.)) (defun run-prp-block-prp1d (ntimes soa diff-p &optional (stream t)) "Runs a block of PRP trials." (unless *experiment* (build-window-prp1d)) (multiple-value-bind (rt1 rt2) (test-one-block *experiment* ntimes soa diff-p) (format stream "~&~% Means of ~S trials, ~S addition, SOA of ~s" ntimes (if diff-p "difficult" "easy") soa) (format stream "~% Task 1 (multiplication): ~6,3F sec" rt1) (format stream "~% Task 2 (addition): ~6,3F sec~%~%" rt2) (list rt1 rt2 diff-p))) (defmethod test-one-block ((tw act-prp1d-window) ntimes soa diff) (setf (completed-trials tw) nil) (gc) (dotimes (i ntimes) (when *vflag* (format t "~% <=======> Trial #~S <=======>" i)) (run-prp-trial-prp1d soa diff)) (values (mul-avg-prp1d (completed-trials tw)) (add-avg-prp1d (completed-trials tw))) ) (defun run-all-conditions-prp1d (ntimes) (let ((dummy-stream (make-string-output-stream)) (results nil)) (dolist (soa '(0.0 0.1 0.2 0.4 0.5 0.6 0.8 1.2 1.8 2.4)) (dolist (diff '(nil t)) (push (cons soa (run-prp-block-prp1d ntimes soa diff dummy-stream)) results))) (when *vflag* (format t (get-output-stream-string dummy-stream))) (output-prp1d (process-results-prp1d results) t))) (defun process-results-prp1d (res) (do* ((x res) (f (pop x) (pop x)) (s (pop x) (pop x)) (result (list (list (first f) (* 1000 (/ (+ (second f) (second s)) 2)) (* 1000 (third s)) (* 1000 (third f)))) (cons (list (first f) (* 1000 (/ (+ (second f) (second s)) 2)) (* 1000 (third s)) (* 1000 (third f))) result))) ((null x) result) )) ;;;; ---------------------------------------------------------------------- ;;;; ;;;; from "Mike's Numbers" ;;;; ---------------------------------------------------------------------- ;;;; (defun integer-name-prp1d (i) "Takes an integer and returns a symbol whose print-name is the name of this number, which is currently restricted to [-100,100]." (cond ((minusp i) (concatenate 'string "minus-" (integer-name-prp1d (- i)))) ((< i 20) (aref *twenty-names-prp1d* i)) ((> i 1000) (error "integer-name-prp1d is not defined for value ~D ~%" i)) ((zerop (mod i 100)) (concatenate 'string (aref *twenty-names-prp1d* (/ i 100)) "-hundred")) ((> i 100) (concatenate 'string (aref *twenty-names-prp1d* (floor i 100)) "-hundred-and-" (integer-name-prp1d (mod i 100)))) ((zerop (mod i 10)) (aref *tens-names-prp1d* (/ i 10))) (t (concatenate 'string (aref *tens-names-prp1d* (floor i 10)) "-" (aref *twenty-names-prp1d* (mod i 10)))))) (defun set-arithmetic-parameters-prp1d () (no-output (let ((facts (swm isa arithmetic)) (base-levels (append *addition-base-levels-prp1d* *multiplication-base-levels-prp1d*)) (arg1-ia (append *addition-arg1-ia-prp1d* *multiplication-arg1-ia-prp1d*)) (arg2-ia (append *addition-arg2-ia-prp1d* *multiplication-arg2-ia-prp1d*)) (arguments nil)) (dolist (fact facts) (setf fact (get-safe-wme fact)) (push (list fact :base-level (pop base-levels) :ias (list (cons (get-slot-value fact 'arg1) (pop arg1-ia)) (cons (get-slot-value fact 'operator) 0.0) (cons (get-slot-value fact 'arg2) (pop arg2-ia)) (cons (get-slot-value fact 'result) 0.0))) arguments)) (swp-fct arguments) (length facts)))) ;;; ;;; From "verbal-codes.actr" ;;; (defun set-coding-levels-prp1d (x) (let (accum) (set-base-levels-fct (dotimes (i 82 accum) (push (list (read-from-string (format nil "~A-~A" i (integer-name-prp1d i))) x) accum))))) ;;; ;;; New code for the web interface ;;; (defvar *runs*) (defvar *text*) (defvar *graphic*) (defvar *overlay*) (setf *text* t) (setf *graphic* nil) (setf *overlay* nil) (setf *vflag* nil) (setf *runs* 10) ;;; ms times for multiply, easy addition, and hard addition (defparameter *prp1d-exp-data* '((0 1423.9 2070.3 2247) (.1 1443.5 2038.2 2161.3) (.2 1439.2 1882.5 2113) (.4 1409.5 1672.7 1950.7) (.5 1382.9 1627.7 1790.9) (.6 1414.1 1509.7 1810.5) (.8 1397.7 1469.7 1535.8) (1.2 1410.3 1228.1 1455.7) (1.8 1398.2 975.5 1239.6) (2.4 1381.4 981 1210.7))) (defun output-prp1d (res sim) (format *standard-output* "~%~%Parameters for run: (~S ~S ~S ~S ~S ~S)~%~%" *noise* *lf* *dr* *dd* *cs* *runs*) (when *text* (format *standard-output* "~%~%~a data:~%" (if sim "Simulation" "Experimental")) (format *standard-output* " RT's in ms~%") (format *standard-output* "SOA (ms) Multiplication Addition (easy) Addition (hard)~%") (dolist (x res) (format *standard-output* "~5,0f ~6,1f ~6,1f ~6,1f~%" (* 1000 (first x)) (second x) (third x) (fourth x))) (format *standard-output* "~%") (when (and sim *overlay*) (format *standard-output* "~%~%Experimental data:~%") (format *standard-output* " RT's in ms~%") (format *standard-output* "SOA (ms) Multiplication Addition (easy) Addition (hard)~%") (dolist (x *prp1d-exp-data*) (format *standard-output* "~5,0f ~6,1f ~6,1f ~6,1f~%" (* 1000 (first x)) (second x) (third x) (fourth x))) (format *standard-output* "~%") ) (unless *graphic* (format *standard-output* "~%
~%~%")))
(when *graphic*
(format *standard-output* "
")))
;;;; ---------------------------------------------------------------------- ;;;;
;;;; from "prp1-dt.actr"
;;;; ---------------------------------------------------------------------- ;;;;
(clearall)
(pm-reset)
(pm-add-types-and-chunks)
(pm-set-params :digit-duration 0.4 :digit-detect-delay *dd*)
(pm-set-params :speech-hook-fct #'heard-sound-prp1d :auto-dequeue t)
(sgp :era t)
(sgp-fct `(:lf ,*lf*))
(set-pm-params-mth *mp* `(:digit-recode-delay ,*dr*))
(pm-set-params :device-updater-fct #'check-screen-window-prp1d)
(sgp-fct `(:an ,*noise*))
(sgp-fct `(:v ,*vflag*))
(sgp :er t)
(sgp :lt nil)
(chunk-type dt-goal t1op1 t1op2 t1ans t2op1 t2op2 t2scrn t2ans working)
(chunk-type mul-goal op1 op2 answer)
(chunk-type add-goal op1 op2 answer screen working)
(chunk-type verbal-coding num string)
(chunk-type dummy-top started)
;;;; Spliced in from "Mike's Numbers"
(wmetype operator symbol)
(wmetype integer value)
(wmetype arithmetic arg1 operator arg2 result)
(addwm
(+ isa operator)
(* isa operator)
(zero isa integer value 0)
(one isa integer value 1)
(two isa integer value 2)
(three isa integer value 3)
(four isa integer value 4)
(five isa integer value 5)
(six isa integer value 6)
(seven isa integer value 7)
(eight isa integer value 8)
(nine isa integer value 9)
(ten isa integer value 10)
(eleven isa integer value 11)
(twelve isa integer value 12)
(thirteen isa integer value 13)
(fourteen isa integer value 14)
(fifteen isa integer value 15)
(sixteen isa integer value 16)
(seventeen isa integer value 17)
(eighteen isa integer value 18)
(nineteen isa integer value 19)
(twenty isa integer value 20)
(twenty-one isa integer value 21)
(twenty-two isa integer value 22)
(twenty-three isa integer value 23)
(twenty-four isa integer value 24)
(twenty-five isa integer value 25)
(twenty-six isa integer value 26)
(twenty-seven isa integer value 27)
(twenty-eight isa integer value 28)
(twenty-nine isa integer value 29)
(thirty isa integer value 30)
(thirty-one isa integer value 31)
(thirty-two isa integer value 32)
(thirty-three isa integer value 33)
(thirty-four isa integer value 34)
(thirty-five isa integer value 35)
(thirty-six isa integer value 36)
(thirty-seven isa integer value 37)
(thirty-eight isa integer value 38)
(thirty-nine isa integer value 39)
(forty isa integer value 40)
(forty-one isa integer value 41)
(forty-two isa integer value 42)
(forty-three isa integer value 43)
(forty-four isa integer value 44)
(forty-five isa integer value 45)
(forty-six isa integer value 46)
(forty-seven isa integer value 47)
(forty-eight isa integer value 48)
(forty-nine isa integer value 49)
(fifty isa integer value 50)
(fifty-one isa integer value 51)
(fifty-two isa integer value 52)
(fifty-three isa integer value 53)
(fifty-four isa integer value 54)
(fifty-five isa integer value 55)
(fifty-six isa integer value 56)
(fifty-seven isa integer value 57)
(fifty-eight isa integer value 58)
(fifty-nine isa integer value 59)
(sixty isa integer value 60)
(sixty-one isa integer value 61)
(sixty-two isa integer value 62)
(sixty-three isa integer value 63)
(sixty-four isa integer value 64)
(sixty-five isa integer value 65)
(sixty-six isa integer value 66)
(sixty-seven isa integer value 67)
(sixty-eight isa integer value 68)
(sixty-nine isa integer value 69)
(seventy isa integer value 70)
(seventy-one isa integer value 71)
(seventy-two isa integer value 72)
(seventy-three isa integer value 73)
(seventy-four isa integer value 74)
(seventy-five isa integer value 75)
(seventy-six isa integer value 76)
(seventy-seven isa integer value 77)
(seventy-eight isa integer value 78)
(seventy-nine isa integer value 79)
(eighty isa integer value 80)
(eighty-one isa integer value 81)
(eighty-two isa integer value 82)
(eighty-three isa integer value 83)
(eighty-four isa integer value 84)
(eighty-five isa integer value 85)
(eighty-six isa integer value 86)
(eighty-seven isa integer value 87)
(eighty-eight isa integer value 88)
(eighty-nine isa integer value 89)
(ninety isa integer value 90)
(ninety-one isa integer value 91)
(ninety-two isa integer value 92)
(ninety-three isa integer value 93)
(ninety-four isa integer value 94)
(ninety-five isa integer value 95)
(ninety-six isa integer value 96)
(ninety-seven isa integer value 97)
(ninety-eight isa integer value 98)
(ninety-nine isa integer value 99)
(0+0 isa arithmetic arg1 zero operator + arg2 zero result zero)
(0+1 isa arithmetic arg1 zero operator + arg2 one result one)
(0+2 isa arithmetic arg1 zero operator + arg2 two result two)
(0+3 isa arithmetic arg1 zero operator + arg2 three result three)
(0+4 isa arithmetic arg1 zero operator + arg2 four result four)
(0+5 isa arithmetic arg1 zero operator + arg2 five result five)
(0+6 isa arithmetic arg1 zero operator + arg2 six result six)
(0+7 isa arithmetic arg1 zero operator + arg2 seven result seven)
(0+8 isa arithmetic arg1 zero operator + arg2 eight result eight)
(0+9 isa arithmetic arg1 zero operator + arg2 nine result nine)
(1+0 isa arithmetic arg1 one operator + arg2 zero result one)
(1+1 isa arithmetic arg1 one operator + arg2 one result two)
(1+2 isa arithmetic arg1 one operator + arg2 two result three)
(1+3 isa arithmetic arg1 one operator + arg2 three result four)
(1+4 isa arithmetic arg1 one operator + arg2 four result five)
(1+5 isa arithmetic arg1 one operator + arg2 five result six)
(1+6 isa arithmetic arg1 one operator + arg2 six result seven)
(1+7 isa arithmetic arg1 one operator + arg2 seven result eight)
(1+8 isa arithmetic arg1 one operator + arg2 eight result nine)
(1+9 isa arithmetic arg1 one operator + arg2 nine result ten)
(2+0 isa arithmetic arg1 two operator + arg2 zero result two)
(2+1 isa arithmetic arg1 two operator + arg2 one result three)
(2+2 isa arithmetic arg1 two operator + arg2 two result four)
(2+3 isa arithmetic arg1 two operator + arg2 three result five)
(2+4 isa arithmetic arg1 two operator + arg2 four result six)
(2+5 isa arithmetic arg1 two operator + arg2 five result seven)
(2+6 isa arithmetic arg1 two operator + arg2 six result eight)
(2+7 isa arithmetic arg1 two operator + arg2 seven result nine)
(2+8 isa arithmetic arg1 two operator + arg2 eight result ten)
(2+9 isa arithmetic arg1 two operator + arg2 nine result eleven)
(3+0 isa arithmetic arg1 three operator + arg2 zero result three)
(3+1 isa arithmetic arg1 three operator + arg2 one result four)
(3+2 isa arithmetic arg1 three operator + arg2 two result five)
(3+3 isa arithmetic arg1 three operator + arg2 three result six)
(3+4 isa arithmetic arg1 three operator + arg2 four result seven)
(3+5 isa arithmetic arg1 three operator + arg2 five result eight)
(3+6 isa arithmetic arg1 three operator + arg2 six result nine)
(3+7 isa arithmetic arg1 three operator + arg2 seven result ten)
(3+8 isa arithmetic arg1 three operator + arg2 eight result eleven)
(3+9 isa arithmetic arg1 three operator + arg2 nine result twelve)
(4+0 isa arithmetic arg1 four operator + arg2 zero result four)
(4+1 isa arithmetic arg1 four operator + arg2 one result five)
(4+2 isa arithmetic arg1 four operator + arg2 two result six)
(4+3 isa arithmetic arg1 four operator + arg2 three result seven)
(4+4 isa arithmetic arg1 four operator + arg2 four result eight)
(4+5 isa arithmetic arg1 four operator + arg2 five result nine)
(4+6 isa arithmetic arg1 four operator + arg2 six result ten)
(4+7 isa arithmetic arg1 four operator + arg2 seven result eleven)
(4+8 isa arithmetic arg1 four operator + arg2 eight result twelve)
(4+9 isa arithmetic arg1 four operator + arg2 nine result thirteen)
(5+0 isa arithmetic arg1 five operator + arg2 zero result five)
(5+1 isa arithmetic arg1 five operator + arg2 one result six)
(5+2 isa arithmetic arg1 five operator + arg2 two result seven)
(5+3 isa arithmetic arg1 five operator + arg2 three result eight)
(5+4 isa arithmetic arg1 five operator + arg2 four result nine)
(5+5 isa arithmetic arg1 five operator + arg2 five result ten)
(5+6 isa arithmetic arg1 five operator + arg2 six result eleven)
(5+7 isa arithmetic arg1 five operator + arg2 seven result twelve)
(5+8 isa arithmetic arg1 five operator + arg2 eight result thirteen)
(5+9 isa arithmetic arg1 five operator + arg2 nine result fourteen)
(6+0 isa arithmetic arg1 six operator + arg2 zero result six)
(6+1 isa arithmetic arg1 six operator + arg2 one result seven)
(6+2 isa arithmetic arg1 six operator + arg2 two result eight)
(6+3 isa arithmetic arg1 six operator + arg2 three result nine)
(6+4 isa arithmetic arg1 six operator + arg2 four result ten)
(6+5 isa arithmetic arg1 six operator + arg2 five result eleven)
(6+6 isa arithmetic arg1 six operator + arg2 six result twelve)
(6+7 isa arithmetic arg1 six operator + arg2 seven result thirteen)
(6+8 isa arithmetic arg1 six operator + arg2 eight result fourteen)
(6+9 isa arithmetic arg1 six operator + arg2 nine result fifteen)
(7+0 isa arithmetic arg1 seven operator + arg2 zero result seven)
(7+1 isa arithmetic arg1 seven operator + arg2 one result eight)
(7+2 isa arithmetic arg1 seven operator + arg2 two result nine)
(7+3 isa arithmetic arg1 seven operator + arg2 three result ten)
(7+4 isa arithmetic arg1 seven operator + arg2 four result eleven)
(7+5 isa arithmetic arg1 seven operator + arg2 five result twelve)
(7+6 isa arithmetic arg1 seven operator + arg2 six result thirteen)
(7+7 isa arithmetic arg1 seven operator + arg2 seven result fourteen)
(7+8 isa arithmetic arg1 seven operator + arg2 eight result fifteen)
(7+9 isa arithmetic arg1 seven operator + arg2 nine result sixteen)
(8+0 isa arithmetic arg1 eight operator + arg2 zero result eight)
(8+1 isa arithmetic arg1 eight operator + arg2 one result nine)
(8+2 isa arithmetic arg1 eight operator + arg2 two result ten)
(8+3 isa arithmetic arg1 eight operator + arg2 three result eleven)
(8+4 isa arithmetic arg1 eight operator + arg2 four result twelve)
(8+5 isa arithmetic arg1 eight operator + arg2 five result thirteen)
(8+6 isa arithmetic arg1 eight operator + arg2 six result fourteen)
(8+7 isa arithmetic arg1 eight operator + arg2 seven result fifteen)
(8+8 isa arithmetic arg1 eight operator + arg2 eight result sixteen)
(8+9 isa arithmetic arg1 eight operator + arg2 nine result seventeen)
(9+0 isa arithmetic arg1 nine operator + arg2 zero result nine)
(9+1 isa arithmetic arg1 nine operator + arg2 one result ten)
(9+2 isa arithmetic arg1 nine operator + arg2 two result eleven)
(9+3 isa arithmetic arg1 nine operator + arg2 three result twelve)
(9+4 isa arithmetic arg1 nine operator + arg2 four result thirteen)
(9+5 isa arithmetic arg1 nine operator + arg2 five result fourteen)
(9+6 isa arithmetic arg1 nine operator + arg2 six result fifteen)
(9+7 isa arithmetic arg1 nine operator + arg2 seven result sixteen)
(9+8 isa arithmetic arg1 nine operator + arg2 eight result seventeen)
(9+9 isa arithmetic arg1 nine operator + arg2 nine result eighteen)
(0*0 isa arithmetic arg1 zero operator * arg2 zero result zero)
(0*1 isa arithmetic arg1 zero operator * arg2 one result zero)
(0*2 isa arithmetic arg1 zero operator * arg2 two result zero)
(0*3 isa arithmetic arg1 zero operator * arg2 three result zero)
(0*4 isa arithmetic arg1 zero operator * arg2 four result zero)
(0*5 isa arithmetic arg1 zero operator * arg2 five result zero)
(0*6 isa arithmetic arg1 zero operator * arg2 six result zero)
(0*7 isa arithmetic arg1 zero operator * arg2 seven result zero)
(0*8 isa arithmetic arg1 zero operator * arg2 eight result zero)
(0*9 isa arithmetic arg1 zero operator * arg2 nine result zero)
(1*0 isa arithmetic arg1 one operator * arg2 zero result zero)
(1*1 isa arithmetic arg1 one operator * arg2 one result one)
(1*2 isa arithmetic arg1 one operator * arg2 two result two)
(1*3 isa arithmetic arg1 one operator * arg2 three result three)
(1*4 isa arithmetic arg1 one operator * arg2 four result four)
(1*5 isa arithmetic arg1 one operator * arg2 five result five)
(1*6 isa arithmetic arg1 one operator * arg2 six result six)
(1*7 isa arithmetic arg1 one operator * arg2 seven result seven)
(1*8 isa arithmetic arg1 one operator * arg2 eight result eight)
(1*9 isa arithmetic arg1 one operator * arg2 nine result nine)
(2*0 isa arithmetic arg1 two operator * arg2 zero result zero)
(2*1 isa arithmetic arg1 two operator * arg2 one result two)
(2*2 isa arithmetic arg1 two operator * arg2 two result four)
(2*3 isa arithmetic arg1 two operator * arg2 three result six)
(2*4 isa arithmetic arg1 two operator * arg2 four result eight)
(2*5 isa arithmetic arg1 two operator * arg2 five result ten)
(2*6 isa arithmetic arg1 two operator * arg2 six result twelve)
(2*7 isa arithmetic arg1 two operator * arg2 seven result fourteen)
(2*8 isa arithmetic arg1 two operator * arg2 eight result sixteen)
(2*9 isa arithmetic arg1 two operator * arg2 nine result eighteen)
(3*0 isa arithmetic arg1 three operator * arg2 zero result zero)
(3*1 isa arithmetic arg1 three operator * arg2 one result three)
(3*2 isa arithmetic arg1 three operator * arg2 two result six)
(3*3 isa arithmetic arg1 three operator * arg2 three result nine)
(3*4 isa arithmetic arg1 three operator * arg2 four result twelve)
(3*5 isa arithmetic arg1 three operator * arg2 five result fifteen)
(3*6 isa arithmetic arg1 three operator * arg2 six result eighteen)
(3*7 isa arithmetic arg1 three operator * arg2 seven result twenty-one)
(3*8 isa arithmetic arg1 three operator * arg2 eight result twenty-four)
(3*9 isa arithmetic arg1 three operator * arg2 nine result twenty-seven)
(4*0 isa arithmetic arg1 four operator * arg2 zero result zero)
(4*1 isa arithmetic arg1 four operator * arg2 one result four)
(4*2 isa arithmetic arg1 four operator * arg2 two result eight)
(4*3 isa arithmetic arg1 four operator * arg2 three result twelve)
(4*4 isa arithmetic arg1 four operator * arg2 four result sixteen)
(4*5 isa arithmetic arg1 four operator * arg2 five result twenty)
(4*6 isa arithmetic arg1 four operator * arg2 six result twenty-four)
(4*7 isa arithmetic arg1 four operator * arg2 seven result twenty-eight)
(4*8 isa arithmetic arg1 four operator * arg2 eight result thirty-two)
(4*9 isa arithmetic arg1 four operator * arg2 nine result thirty-six)
(5*0 isa arithmetic arg1 five operator * arg2 zero result zero)
(5*1 isa arithmetic arg1 five operator * arg2 one result five)
(5*2 isa arithmetic arg1 five operator * arg2 two result ten)
(5*3 isa arithmetic arg1 five operator * arg2 three result fifteen)
(5*4 isa arithmetic arg1 five operator * arg2 four result twenty)
(5*5 isa arithmetic arg1 five operator * arg2 five result twenty-five)
(5*6 isa arithmetic arg1 five operator * arg2 six result thirty)
(5*7 isa arithmetic arg1 five operator * arg2 seven result thirty-five)
(5*8 isa arithmetic arg1 five operator * arg2 eight result forty)
(5*9 isa arithmetic arg1 five operator * arg2 nine result forty-five)
(6*0 isa arithmetic arg1 six operator * arg2 zero result zero)
(6*1 isa arithmetic arg1 six operator * arg2 one result six)
(6*2 isa arithmetic arg1 six operator * arg2 two result twelve)
(6*3 isa arithmetic arg1 six operator * arg2 three result eighteen)
(6*4 isa arithmetic arg1 six operator * arg2 four result twenty-four)
(6*5 isa arithmetic arg1 six operator * arg2 five result thirty)
(6*6 isa arithmetic arg1 six operator * arg2 six result thirty-six)
(6*7 isa arithmetic arg1 six operator * arg2 seven result forty-two)
(6*8 isa arithmetic arg1 six operator * arg2 eight result forty-eight)
(6*9 isa arithmetic arg1 six operator * arg2 nine result fifty-four)
(7*0 isa arithmetic arg1 seven operator * arg2 zero result zero)
(7*1 isa arithmetic arg1 seven operator * arg2 one result seven)
(7*2 isa arithmetic arg1 seven operator * arg2 two result fourteen)
(7*3 isa arithmetic arg1 seven operator * arg2 three result twenty-one)
(7*4 isa arithmetic arg1 seven operator * arg2 four result twenty-eight)
(7*5 isa arithmetic arg1 seven operator * arg2 five result thirty-five)
(7*6 isa arithmetic arg1 seven operator * arg2 six result forty-two)
(7*7 isa arithmetic arg1 seven operator * arg2 seven result forty-nine)
(7*8 isa arithmetic arg1 seven operator * arg2 eight result fifty-six)
(7*9 isa arithmetic arg1 seven operator * arg2 nine result sixty-three)
(8*0 isa arithmetic arg1 eight operator * arg2 zero result zero)
(8*1 isa arithmetic arg1 eight operator * arg2 one result eight)
(8*2 isa arithmetic arg1 eight operator * arg2 two result sixteen)
(8*3 isa arithmetic arg1 eight operator * arg2 three result twenty-four)
(8*4 isa arithmetic arg1 eight operator * arg2 four result thirty-two)
(8*5 isa arithmetic arg1 eight operator * arg2 five result forty)
(8*6 isa arithmetic arg1 eight operator * arg2 six result forty-eight)
(8*7 isa arithmetic arg1 eight operator * arg2 seven result fifty-six)
(8*8 isa arithmetic arg1 eight operator * arg2 eight result sixty-four)
(8*9 isa arithmetic arg1 eight operator * arg2 nine result seventy-two)
(9*0 isa arithmetic arg1 nine operator * arg2 zero result zero)
(9*1 isa arithmetic arg1 nine operator * arg2 one result nine)
(9*2 isa arithmetic arg1 nine operator * arg2 two result eighteen)
(9*3 isa arithmetic arg1 nine operator * arg2 three result twenty-seven)
(9*4 isa arithmetic arg1 nine operator * arg2 four result thirty-six)
(9*5 isa arithmetic arg1 nine operator * arg2 five result forty-five)
(9*6 isa arithmetic arg1 nine operator * arg2 six result fifty-four)
(9*7 isa arithmetic arg1 nine operator * arg2 seven result sixty-three)
(9*8 isa arithmetic arg1 nine operator * arg2 eight result seventy-two)
(9*9 isa arithmetic arg1 nine operator * arg2 nine result eighty-one)
)
(set-arithmetic-parameters-prp1d)
;;;; end splice
;;;; spliced in from "verbal-codes.actr"
(add-dm
(0-ZERO isa verbal-coding num ZERO string "0")
(1-ONE isa verbal-coding num ONE string "1")
(2-TWO isa verbal-coding num TWO string "2")
(3-THREE isa verbal-coding num THREE string "3")
(4-FOUR isa verbal-coding num FOUR string "4")
(5-FIVE isa verbal-coding num FIVE string "5")
(6-SIX isa verbal-coding num SIX string "6")
(7-SEVEN isa verbal-coding num SEVEN string "7")
(8-EIGHT isa verbal-coding num EIGHT string "8")
(9-NINE isa verbal-coding num NINE string "9")
(10-TEN isa verbal-coding num TEN string "10")
(11-ELEVEN isa verbal-coding num ELEVEN string "11")
(12-TWELVE isa verbal-coding num TWELVE string "12")
(13-THIRTEEN isa verbal-coding num THIRTEEN string "13")
(14-FOURTEEN isa verbal-coding num FOURTEEN string "14")
(15-FIFTEEN isa verbal-coding num FIFTEEN string "15")
(16-SIXTEEN isa verbal-coding num SIXTEEN string "16")
(17-SEVENTEEN isa verbal-coding num SEVENTEEN string "17")
(18-EIGHTEEN isa verbal-coding num EIGHTEEN string "18")
(19-NINETEEN isa verbal-coding num NINETEEN string "19")
(20-TWENTY isa verbal-coding num TWENTY string "20")
(21-TWENTY-ONE isa verbal-coding num TWENTY-ONE string "21")
(22-TWENTY-TWO isa verbal-coding num TWENTY-TWO string "22")
(23-TWENTY-THREE isa verbal-coding num TWENTY-THREE string "23")
(24-TWENTY-FOUR isa verbal-coding num TWENTY-FOUR string "24")
(25-TWENTY-FIVE isa verbal-coding num TWENTY-FIVE string "25")
(26-TWENTY-SIX isa verbal-coding num TWENTY-SIX string "26")
(27-TWENTY-SEVEN isa verbal-coding num TWENTY-SEVEN string "27")
(28-TWENTY-EIGHT isa verbal-coding num TWENTY-EIGHT string "28")
(29-TWENTY-NINE isa verbal-coding num TWENTY-NINE string "29")
(30-THIRTY isa verbal-coding num THIRTY string "30")
(31-THIRTY-ONE isa verbal-coding num THIRTY-ONE string "31")
(32-THIRTY-TWO isa verbal-coding num THIRTY-TWO string "32")
(33-THIRTY-THREE isa verbal-coding num THIRTY-THREE string "33")
(34-THIRTY-FOUR isa verbal-coding num THIRTY-FOUR string "34")
(35-THIRTY-FIVE isa verbal-coding num THIRTY-FIVE string "35")
(36-THIRTY-SIX isa verbal-coding num THIRTY-SIX string "36")
(37-THIRTY-SEVEN isa verbal-coding num THIRTY-SEVEN string "37")
(38-THIRTY-EIGHT isa verbal-coding num THIRTY-EIGHT string "38")
(39-THIRTY-NINE isa verbal-coding num THIRTY-NINE string "39")
(40-FORTY isa verbal-coding num FORTY string "40")
(41-FORTY-ONE isa verbal-coding num FORTY-ONE string "41")
(42-FORTY-TWO isa verbal-coding num FORTY-TWO string "42")
(43-FORTY-THREE isa verbal-coding num FORTY-THREE string "43")
(44-FORTY-FOUR isa verbal-coding num FORTY-FOUR string "44")
(45-FORTY-FIVE isa verbal-coding num FORTY-FIVE string "45")
(46-FORTY-SIX isa verbal-coding num FORTY-SIX string "46")
(47-FORTY-SEVEN isa verbal-coding num FORTY-SEVEN string "47")
(48-FORTY-EIGHT isa verbal-coding num FORTY-EIGHT string "48")
(49-FORTY-NINE isa verbal-coding num FORTY-NINE string "49")
(50-FIFTY isa verbal-coding num FIFTY string "50")
(51-FIFTY-ONE isa verbal-coding num FIFTY-ONE string "51")
(52-FIFTY-TWO isa verbal-coding num FIFTY-TWO string "52")
(53-FIFTY-THREE isa verbal-coding num FIFTY-THREE string "53")
(54-FIFTY-FOUR isa verbal-coding num FIFTY-FOUR string "54")
(55-FIFTY-FIVE isa verbal-coding num FIFTY-FIVE string "55")
(56-FIFTY-SIX isa verbal-coding num FIFTY-SIX string "56")
(57-FIFTY-SEVEN isa verbal-coding num FIFTY-SEVEN string "57")
(58-FIFTY-EIGHT isa verbal-coding num FIFTY-EIGHT string "58")
(59-FIFTY-NINE isa verbal-coding num FIFTY-NINE string "59")
(60-SIXTY isa verbal-coding num SIXTY string "60")
(61-SIXTY-ONE isa verbal-coding num SIXTY-ONE string "61")
(62-SIXTY-TWO isa verbal-coding num SIXTY-TWO string "62")
(63-SIXTY-THREE isa verbal-coding num SIXTY-THREE string "63")
(64-SIXTY-FOUR isa verbal-coding num SIXTY-FOUR string "64")
(65-SIXTY-FIVE isa verbal-coding num SIXTY-FIVE string "65")
(66-SIXTY-SIX isa verbal-coding num SIXTY-SIX string "66")
(67-SIXTY-SEVEN isa verbal-coding num SIXTY-SEVEN string "67")
(68-SIXTY-EIGHT isa verbal-coding num SIXTY-EIGHT string "68")
(69-SIXTY-NINE isa verbal-coding num SIXTY-NINE string "69")
(70-SEVENTY isa verbal-coding num SEVENTY string "70")
(71-SEVENTY-ONE isa verbal-coding num SEVENTY-ONE string "71")
(72-SEVENTY-TWO isa verbal-coding num SEVENTY-TWO string "72")
(73-SEVENTY-THREE isa verbal-coding num SEVENTY-THREE string "73")
(74-SEVENTY-FOUR isa verbal-coding num SEVENTY-FOUR string "74")
(75-SEVENTY-FIVE isa verbal-coding num SEVENTY-FIVE string "75")
(76-SEVENTY-SIX isa verbal-coding num SEVENTY-SIX string "76")
(77-SEVENTY-SEVEN isa verbal-coding num SEVENTY-SEVEN string "77")
(78-SEVENTY-EIGHT isa verbal-coding num SEVENTY-EIGHT string "78")
(79-SEVENTY-NINE isa verbal-coding num SEVENTY-NINE string "79")
(80-EIGHTY isa verbal-coding num EIGHTY string "80")
(81-EIGHTY-ONE isa verbal-coding num EIGHTY-ONE string "81"))
(set-coding-levels-prp1d *cs*)
;;;; end splice
(add-dm (topgoal isa dt-goal working *))
(add-dm (op1loc isa visual-location screen-x 260 screen-y 200)
(op2loc isa visual-location screen-x 262 screen-y 200)
(ansloc isa visual-location screen-x 264 screen-y 200))
(set-base-levels (op1loc 5.0) (op2loc 5.0) (ansloc 5.0))
;;;; ---------------------------------------------------------------------- ;;;;
;;;; Task 1: Multiplication
;;;; Works like this: Listen for op1, listen for op2, retrieve answer,
;;;; output answer. Fairly simple.
(p listen-op1
=goal>
isa dt-goal
t1op1 nil
working *
=state>
isa module-state
module :AUDIO
modality free
==>
!send-command! :AUDIO listen-for :attended nil :onset lowest
=goal>
t1op1 "working")
(parameters listen-op1 :r 0.6)
(p encode-first
=goal>
isa dt-goal
t1op1 "working"
=sound>
isa sound
type digit
content =str
=code>
isa verbal-coding
string =str
num =num
==>
=goal>
t1op1 =num)
(parameters encode-first :r 0.8)
(p listen-op2
=goal>
isa dt-goal
- t1op1 nil
t1op2 nil
=module>
isa module-state
module :AUDIO
modality free
==>
!send-command! :AUDIO listen-for :attended nil :onset lowest)
(parameters listen-op2 :r 0.5)
(p encode-second
=goal>
isa dt-goal
t1op1 =first
- t1op1 "working"
t1op2 nil
=sound>
isa sound
type digit
content =str
=code>
isa verbal-coding
string =str
num =num
!eval! (not (equal =first =num))
=mgr>
isa module-state
module :AUDIO
modality free
last-command listen-for
==>
=goal>
t1op2 =num)
(p retrieve-mult
=goal>
isa dt-goal
t1op1 =num1
t1op2 =num2
t1ans nil
working *
=fact>
isa arithmetic
arg1 =num1
arg2 =num2
operator *
result =res
==>
=goal>
t1ans =res)
(p t1-respond
=goal>
isa dt-goal
t1ans =res
- t1ans nil
working *
=code>
isa verbal-coding
num =res
string =str
=loc>
isa visual-location
attended nil
==>
!send-command! :SPEECH speak =str
!send-command! :VISION move-attention :location =loc :scale phrase
=goal>
working nil)
(p switch
=goal>
isa dt-goal
working nil
- t1ans nil
=state>
isa module-state
module :SPEECH
modality BUSY
==>
=goal>
t1op1 nil
t1op2 nil
t1ans nil
working +
!eval! (setf *switch* t))
(p encode-add-op1
=goal>
isa dt-goal
working +
t2op1 nil
=phrase>
isa phrase!
words =phr
!bind! =str (first =phr)
=code>
isa verbal-coding
string =str
num =num
==>
=goal>
t2op1 =num)
(parameters encode-add-op1 :r 0.9)
(p encode-add-op2
=goal>
isa dt-goal
- t2op1 nil
t2op2 nil
=phrase>
isa phrase!
words =phr
!bind! =str (third =phr)
=code>
isa verbal-coding
string =str
num =num
==>
=goal>
t2op2 =num)
(p encode-answer
=goal>
isa dt-goal
- t2op1 nil
- t2op2 nil
t2scrn nil
=phrase>
isa phrase!
words =phr
!bind! =str (fifth =phr)
=code>
isa verbal-coding
string =str
num =num
==>
=goal>
t2scrn =num)
(p retrieve-addn
=goal>
isa dt-goal
t2op1 =num1
t2op2 =num2
t2ans nil
working +
=fact>
isa arithmetic
arg1 =num1
arg2 =num2
operator +
result =res
==>
=goal>
t2ans =res)
(p respond-add-yes
=goal>
isa dt-goal
t2scrn =num
t2ans =num
working +
- t2scrn nil
- t2ans nil
=state>
isa module-state
module :MOTOR
modality free
==>
!send-command! :MOTOR punch :hand right :finger ring
=goal>
working "finish")
(p respond-add-no
=goal>
isa dt-goal
t2scrn =num
- t2ans =num
working +
- t2scrn nil
- t2ans nil
=state>
isa module-state
module :MOTOR
modality free
==>
!send-command! :MOTOR punch :hand right :finger index
=goal>
working "finish")
(p all-done
=goal>
isa dt-goal
working "finish"
=state>
isa module-state
module :MOTOR
modality free
last-command punch
==>
!pop!)