;
(defvar *system-is-still-learning*)
(defvar *style*)
(defvar *done-time*)
(defvar *block-size*)
(defvar *jtb-hacked-block-number*)
(defvar *current-focus*)
(defvar *correct-category*)
(defvar *rt*)
(defvar *last-guess*)
(defvar *ebrw-criterion*)
(defvar *lax-criterion*)
(defvar *strict-criterion*)
(defvar *r-time* .05)
(defvar *r-thresh* 0)
(defvar *intercept* .2)
(defvar *counter-thresh* 1)
(defvar *runs* 5)
(defvar *text* t)
(defvar *graphic* nil)
(defvar *v* nil)
(defvar *overlay* nil)
(defparameter *categories* '(category-a category-b))
(defparameter *egs* (/ 2.2 (sqrt 2)))
(defparameter *noise* .55)
(defparameter *jtb-sim-factor* 30)
(defparameter *jtb-hack-track* nil)
(defparameter *learning* nil)
(defparameter *styles* nil)
(defparameter *experiment-3-patterns*
'((item1 h-nine p-two nil nil category-a) (item2 h-nine p-seven nil nil category-a)
(item3 h-eight p-five nil nil category-a) (item4 h-seven p-zero nil nil category-a)
(item5 h-seven p-nine nil nil category-a) (item6 h-six p-four nil nil category-a)
(item7 h-five p-one nil nil category-a) (item8 h-five p-six nil nil category-a)
(item9-1 h-seven p-two nil nil category-c) (item9-2 h-seven p-two nil nil category-c)
(item9-3 h-seven p-two nil nil category-c) (item9-4 h-seven p-two nil nil category-c)
(item10-1 h-seven p-seven nil nil category-a)(item10-2 h-seven p-seven nil nil category-a)
(item11 h-four p-three nil nil category-b) (item12 h-four p-eight nil nil category-b)
(item14 h-three p-five nil nil category-b) (item15 h-two p-zero nil nil category-b)
(item16 h-two p-nine nil nil category-b) (item17 h-one p-four nil nil category-b)
(item18 h-zero p-two nil nil category-b) (item19 h-zero p-seven nil nil category-b)
(item20-1 h-two p-two nil nil category-b) (item20-2 h-two p-two nil nil category-b)
(item20-3 h-two p-two nil nil category-b) (item20-4 h-two p-two nil nil category-b)
(item21-1 h-two p-seven nil nil category-d) (item21-2 h-two p-seven nil nil category-d)
)
)
(defparameter *experiment-3-transfer-patterns* '(
(tran0 h-zero p-zero nil nil category-b)(tran1 h-zero p-one nil nil category-b)
(tran2 h-zero p-two nil nil category-b)(tran3 h-zero p-three nil nil category-b)
(tran4 h-zero p-four nil nil category-b)(tran5 h-zero p-five nil nil category-b)
(tran6 h-zero p-six nil nil category-b) (tran7 h-zero p-seven nil nil category-b)
(tran8 h-zero p-eight nil nil category-b)
(tran9 h-zero p-nine nil nil category-b) (tran10 h-one p-zero nil nil category-b)
(tran11 h-one p-one nil nil category-b)
(tran12 h-one p-two nil nil category-b) (tran13 h-one p-three nil nil category-b) (tran14 h-one p-four nil nil category-b)
(tran15 h-one p-five nil nil category-b) (tran16 h-one p-six nil nil category-b) (tran17 h-one p-seven nil nil category-b)
(tran18 h-one p-eight nil nil category-b) (tran19 h-one p-nine nil nil category-b) (tran20 h-two p-zero nil nil category-b)
(tran21 h-two p-one nil nil category-b) (tran22 h-two p-two nil nil category-b) (tran23 h-two p-three nil nil category-b)
(tran24 h-two p-four nil nil category-b) (tran25 h-two p-five nil nil category-b) (tran26 h-two p-six nil nil category-b)
(tran27 h-two p-seven nil nil category-b) (tran28 h-two p-eight nil nil category-b) (tran29 h-two p-nine nil nil category-b)
(tran30 h-three p-zero nil nil category-b) (tran31 h-three p-one nil nil category-b) (tran32 h-three p-two nil nil category-b)
(tran33 h-three p-three nil nil category-b)(tran34 h-three p-four nil nil category-b) (tran35 h-three p-five nil nil category-b)
(tran36 h-three p-six nil nil category-b) (tran37 h-three p-seven nil nil category-b)(tran38 h-three p-eight nil nil category-b)
(tran39 h-three p-nine nil nil category-b) (tran40 h-four p-zero nil nil category-b) (tran41 h-four p-one nil nil category-b)
(tran42 h-four p-two nil nil category-b) (tran43 h-four p-three nil nil category-b) (tran44 h-four p-four nil nil category-b)
(tran45 h-four p-five nil nil category-b) (tran46 h-four p-six nil nil category-b) (tran47 h-four p-seven nil nil category-b)
(tran48 h-four p-eight nil nil category-b) (tran49 h-four p-nine nil nil category-b nil nil category-b)
(tran50 h-five p-zero nil nil category-a)
(tran51 h-five p-one nil nil category-a) (tran52 h-five p-two nil nil category-a) (tran53 h-five p-three nil nil category-a)
(tran54 h-five p-four nil nil category-a) (tran55 h-five p-five nil nil category-a) (tran56 h-five p-six nil nil category-a)
(tran57 h-five p-seven nil nil category-a) (tran58 h-five p-eight nil nil category-a) (tran59 h-five p-nine nil nil category-a)
(tran60 h-six p-zero nil nil category-a) (tran61 h-six p-one nil nil category-a) (tran62 h-six p-two nil nil category-a)
(tran63 h-six p-three nil nil category-a) (tran64 h-six p-four nil nil category-a) (tran65 h-six p-five nil nil category-a)
(tran66 h-six p-six nil nil category-a) (tran67 h-six p-seven nil nil category-a) (tran68 h-six p-eight nil nil category-a)
(tran69 h-six p-nine nil nil category-a) (tran70 h-seven p-zero nil nil category-a) (tran71 h-seven p-one nil nil category-a)
(tran72 h-seven p-two nil nil category-a)(tran73 h-seven p-three nil nil category-a)(tran74 h-seven p-four nil nil category-a)
(tran75 h-seven p-five nil nil category-a) (tran76 h-seven p-six nil nil category-a) (tran77 h-seven p-seven nil nil category-a)
(tran78 h-seven p-eight nil nil category-a)(tran79 h-seven p-nine nil nil category-a) (tran80 h-eight p-zero nil nil category-a)
(tran81 h-eight p-one nil nil category-a) (tran82 h-eight p-two nil nil category-a) (tran83 h-eight p-three nil nil category-a)
(tran84 h-eight p-four nil nil category-a) (tran85 h-eight p-five nil nil category-a) (tran86 h-eight p-six nil nil category-a)
(tran87 h-eight p-seven nil nil category-a)(tran88 h-eight p-eight nil nil category-a)(tran89 h-eight p-nine nil nil category-a)
(tran90 h-nine p-zero nil nil category-a) (tran91 h-nine p-one nil nil category-a) (tran92 h-nine p-two nil nil category-a)
(tran93 h-nine p-three nil nil category-a) (tran94 h-nine p-four nil nil category-a) (tran95 h-nine p-five nil nil category-a)
(tran96 h-nine p-six nil nil category-a) (tran97 h-nine p-seven nil nil category-a) (tran98 h-nine p-eight nil nil category-a)
(tran99 h-nine p-nine nil nil category-a)))
(defconstant *exp3-data-catds3* '(73 79 87 81 62.5 50.9 87.2 80.9))
(defconstant *atrium-data-catds3* '(68 76 78 76 67 49 85 82))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; This section contains the interface for the WWW using the
;;; ACT-R on the Web application by Elmar Schwarz
(setf *WWW-interface*
'((:heading "Categorization Model of Erickson & Krushke, 1998" 2)
(:table)
(:table)
"Retrieval Time: " (:string :sy *r-time* .05) (:new-row)
"Retrieval Threshold: " (:string :sy *r-thresh* 0.0) (:new-row)
"Intercept Parameter: " (:string :sy *intercept* .20) (:new-row)
"Counter Threshold: " (:string :sy *counter-thresh* 1) (:new-row)
"Number of runs (1-200): " (:string :sy *runs* 5)
(:table-end)
(:table)
(:checkbox "Trace (NOT recommended, see below)" :sy *v* nil) (:new-row)
(:checkbox "Text output" :sy *text* t) (:new-row)
(:checkbox "Graphic output" :sy *graphic* nil) (:new-row)
(:checkbox "Show both simulation and experiment data" :sy *overlay* nil)
(:table-end)
(:table-end)
(:new-para)
(:button "Show Experimental and ATRIUM Results" "(display-catds3 nil
*exp3-data-catds3* *atrium-data-catds3*)")
(:new-para)
(:button "Run model" "(if (and (numberp *r-time*) (numberp *r-thresh*)
(numberp *intercept*) (numberp *counter-thresh*)
(numberp *runs*))
(display-catds3 (demo-3-catds3 (min 200 (max 1 *runs*)) *r-time* *r-thresh* *intercept* *counter-thresh*)
*exp3-data-catds3* *atrium-data-catds3*
)
(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 2 minutes for 5 runs of the model"
(:new-line)
"- The trace of 1 run is approximatly 0.6 MEGABYTES (300 pages) in size"
(:new-para)))
(defun display-catds3 (model experi atrium)
(when model
(format *standard-output* "~%~%Parameters for run: (~S ~S ~S ~S ~S)~%"
*r-time* *r-thresh* *intercept* *counter-thresh* (min 200 (max 1 *runs*))))
(dotimes (i 8)
(when model
(setf (nth i model) (* 100 (nth i model))))
)
(when *text*
(when model
(format *standard-output* "~%~%ACT-R Percent \"Correct\"~%")
(format *standard-output* "~% Frequency~% 2 4~%")
(format *standard-output* "Training Rule ~6,1f ~6,1f~%" (nth 7 model) (nth 6 model))
(format *standard-output* "Training Exception ~6,1f ~6,1f~%" (nth 5 model) (nth 4 model))
(format *standard-output* "Transfer Rule ~6,1f ~6,1f~%" (nth 3 model) (nth 2 model))
(format *standard-output* "Transfer Exception ~6,1f ~6,1f~%" (nth 1 model) (nth 0 model))
)
(when (or (null model) *overlay*)
(format *standard-output* "~%~%Experimental Percent \"Correct\"~%")
(format *standard-output* "~% Frequency~% 2 4~%")
(format *standard-output* "Training Rule ~6,1f ~6,1f~%" (nth 7 experi) (nth 6 experi))
(format *standard-output* "Training Exception ~6,1f ~6,1f~%" (nth 5 experi) (nth 4 experi))
(format *standard-output* "Transfer Rule ~6,1f ~6,1f~%" (nth 3 experi) (nth 2 experi))
(format *standard-output* "Transfer Exception ~6,1f ~6,1f~%" (nth 1 experi) (nth 0 experi))
(format *standard-output* "~%~%ATRIUM Percent \"Correct\"~%")
(format *standard-output* "~% Frequency~% 2 4~%")
(format *standard-output* "Training Rule ~6,1f ~6,1f~%" (nth 7 atrium) (nth 6 atrium))
(format *standard-output* "Training Exception ~6,1f ~6,1f~%" (nth 5 atrium) (nth 4 atrium))
(format *standard-output* "Transfer Rule ~6,1f ~6,1f~%" (nth 3 atrium) (nth 2 atrium))
(format *standard-output* "Transfer Exception ~6,1f ~6,1f~%" (nth 1 atrium) (nth 0 atrium))
(format *standard-output* "~%")
)
(unless *graphic* (format *standard-output*
"~%
If your browser supports JAVA, you
can display the data in a graph by checking
the Graphic output box on the interface page.~%~%")))
(when *graphic*
(when model
(format *standard-output* "