-
Notifications
You must be signed in to change notification settings - Fork 1
/
2afc-model.lisp
281 lines (257 loc) · 6.89 KB
/
2afc-model.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
;;; ------------------------------------------------------------------
;;; 2AFC TASK IN ACT-R and DDM
;;; ==================================================================
;;; This is the code to implement an abstract and general version of
;;; a two-alternative forced-hoice task (2AFC) in ACT-R. The goal is
;;; to examine the model's behavior across a limited set of
;;; parameters that can be compared against Ratcliff's Drfit-Diffusion
;;; model, a standard model to interpret response times and latencies.
;;; ==================================================================
;;;
;;; 2AFC in DDM
;;; ------
;;; In DDM, decisions are modeled as drifting processes that proceed
;;; towards one of two possible thresholds (corresponding to the
;;; two options). The model is controlled by three parameters:
;;; (1) a drift parameter 'v'
;;; (2) a threshold or boundary parameter 'a', which represents
;;; the distance from either of the response thresholds.
;;; (c) a non-decision time 'T', which represents response and
;;; encoding times.
;;;
;;; 2AFC in ACT-R
;;; -------------
;;; In ACT-R, decisions can be made through several mechanisms,
;;; procedural and declarative. Here, we describe a general enough
;;; mechanisms that comprises both, and is based on the following
;;; steps:
;;; (a) The model holds in mind an internal correctness criterion
;;; in the working memory (WM) buffer, and maintains the
;;; two options in the visual buffer.
;;; (b) The model retrieves the S/R mappings from LTM.
;;; (c) The model proceeds through a check stage, during which
;;; it compares the retrieved S/R against the internal
;;; correctness criterion.
;;; (c1) If a match is found, the model responds.
;;; (c2) If not, the model either...
;;; (c.2.1) restarts the search with probability 'p'
;;; (c.2.2) responds anyway with probability (1 - p).
;;;
;;; Stimuli in the model
;;; --------------------
;;; For simplicity, we will consider only conditions with
;;; homogeneous stimuli. The stimuli will be "incongruent", that is,
;;; internal control is required to retrieve the proper rule.
;;;
;;; ACT-R Parameters
;;; ----------------
;;; The main parameters in the ACT-R implementation are:
;;; (a) W: the spreading activation from the internal correctness
;;; criterion. This corresponds to WM in ACT-R and should
;;; correspond to 'v' in DDM.
;;; (b) S: The noise in declarative memory. This mimics the
;;; resistance to spreading activation.
;;; (c) U: The perceived utility of restarting the search process,
;;; defined in terms of RL expected value V. This determines
;;; the boundary parameter 'a'.
;;; ==================================================================
(clear-all)
(define-model 2afc
(sgp :esc t
:auto-attend t
:er t
:mas 1.69 ;; This is 1 + log(2), so that S - log(Sji) = 1.
:bll nil
:imaginal-activation 2.0
:visual-activation 0.0
:ga 0.0
:le 0.1
:lf 0.5
:blc 1 ;;1.0
:ans 0.5;;2.25) ;; 0.1)
)
(chunk-type 2afc-object; (:include visual-object))
kind value)
(chunk-type (2afc-location (:include visual-location))
kind nature)
(chunk-type response-mapping kind response)
(chunk-type task state)
(chunk-type criterion criterion)
(add-dm (2afc-screen isa chunk)
(2afc-location isa chunk)
(2afc-stimulus isa chunk)
(pause isa chunk)
(done isa chunk)
;; Stimuli
(correct isa chunk)
(incorrect isa chunk)
;; States
(start isa chunk)
(check isa chunk)
(response isa chunk)
(response-mapping isa chunk)
;; Task rules
(sr1 isa response-mapping
kind response-mapping
;cue correct
response left)
(sr2 isa response-mapping
kind response-mapping
;cue incorrect
response right)
(2afc isa task
state start)
(criterion isa criterion
criterion left))
;;; ------------------------------------------------------------------
;;; ENCODING
;;; ------------------------------------------------------------------
;;; This production needs to fire only once; the model will
;;; automatically re-encode the same location when the screen is
;;; updated.
;;; ------------------------------------------------------------------
(p encode
=goal>
isa task
state start
?visual>
buffer empty
state free
==>
+visual-location>
kind 2afc-location
)
;;; ------------------------------------------------------------------
;;; RESPONSE PHASE
;;; ------------------------------------------------------------------
(p retrieve-response
=goal>
isa task
state start
=visual>
isa 2afc-object
kind 2afc-stimulus
?retrieval>
buffer empty
state free
?manual>
preparation free
processor free
execution free
==>
=visual>
=goal>
state check
+retrieval>
kind response-mapping
)
;;; ------------------------------------------------------------------
;;; CHECK PHASE
;;; ------------------------------------------------------------------
;;; General algorithm
;;;
;;; (Correct?)
;;; / \
;;; Yes No
;;; / \
;;; Respond +Conflict+
;;; / \
;;; p 1-p
;;; / \
;;; Restart Respond
;;;
;;; ------------------------------------------------------------------
(p proceed-correct
=goal>
isa task
state check
=imaginal>
criterion =C
=visual>
isa 2afc-object
kind 2afc-stimulus
?retrieval>
buffer full
state free
=retrieval>
kind response-mapping
response =C
==>
=goal>
state response
=retrieval>
=visual>
=imaginal>
)
(p proceed-incorrect
=goal>
isa task
state check
=imaginal>
criterion =C
=visual>
isa 2afc-object
kind 2afc-stimulus
?retrieval>
buffer full
state free
=retrieval>
kind response-mapping
- response =C
==>
=goal>
state response
=retrieval>
=visual>
=imaginal>
)
(p restart
=goal>
isa task
state check
=imaginal>
criterion =C
=visual>
isa 2afc-object
kind 2afc-stimulus
?retrieval>
buffer full
state free
=retrieval>
kind response-mapping
- response =C
==>
=goal>
state start
-retrieval>
=visual>
=imaginal>
)
;;; ------------------------------------------------------------------
;;; RESPONSE
;;; ------------------------------------------------------------------
(p respond
=goal>
isa task
state response
?retrieval>
buffer full
state free
=retrieval>
kind response-mapping
response =HAND
?manual>
preparation free
processor free
execution free
==>
+manual>
isa punch
finger index
hand =HAND
=goal>
state start
)
(goal-focus 2afc)
(set-buffer-chunk 'imaginal 'criterion)
) ; End of model