'Sample simulation program from: 'Stout, S.C., & Miller, R.R. (in press). Sometimes competing retrieval (SOCR): 'A formalization of the comparator hypothesis. *Psychological Review*. 'Programmed in Microsoft QuickBasic 7.1 'program simulates response potential to X (target) stimulus alone DECLARE SUB axes () SCREEN 12, 1 '*****************PARAMETERS k1 = -.125 / (SQR(2) / 2) 'EXTINCTION RATE k2 = .9 'COMPARATOR WEIGHT full = SQR(2) / 2 'FULL INTENSITY STIMULUS notimeslices = 2 'Timeslices 1 or 2 are used to set up events on a trial '****************SET UP THE NUMBER OF PHASES ph1end = 10 'end of phase 1 ph2end = ph1end + 50'end of phase 2 CALL axes '********BEGIN TRIAL COUNTS**************************** FOR trial = 1 TO ph2end xplot = trial * 630 / ph2end 'scales graph left-right for number of trials FOR timeslice = 1 TO notimeslices '*******************TRIAL SCHEDULE 'Phase 1 events IF trial <= ph1end THEN IF timeslice = 1 THEN 'timeslice 1 us = 0: x = full: a = full END IF IF timeslice = 2 THEN us = full: x = 0: a = full 'timeslice 2 END IF END IF 'phase 2 events IF trial > ph1end AND trial <= ph2end THEN IF timeslice = 1 THEN 'timeslice 1 us = 0: x = 0: a = full END IF IF timeslice = 2 THEN 'timeslice 2 us = 0: x = 0: a = 0 END IF END IF '*************LEARNING EQUATIONS 'Vxus IF x > 0 AND us > 0 THEN xus = x * us * (1 - xus) + xus IF x > 0 AND us = 0 THEN xus = k1 * x * xus + xus 'Vxa IF x > 0 AND a > 0 THEN xa = x * a * (1 - xa) + xa IF x > 0 AND a = 0 THEN xa = k1 * x * xa + xa 'Vaus IF a > 0 AND us > 0 THEN aus = a * us * (1 - aus) + aus IF a > 0 AND us = 0 THEN aus = k1 * a * aus + aus NEXT timeslice '****************PERFORMANCE EQUATION********************* 'The response potential of target at end of a trial total = xa * aus 'Total comparator adjustment IF total > 1 THEN total = 1 'Capping total comparator adjustment r = xus - k2 * total 'Effective Vxus IF r > highest THEN highest = r 'highest r value encountered 'PLOT RESPONSE POTENTIALS in 640*480 LINE (xplot, 240)-(xplot + 10, 240 - 120 * r), 4, BF 'WRITE DATA FILE IF DESIRED GOTO 10 'A quotation mark in front of GOTO will write data to current directory IF opened = 0 THEN OPEN "name.dat" FOR APPEND AS #1 'The file name is the label in quotes opened = 1 END IF IF opened = 1 THEN WRITE #1, r END IF 10 NEXT trial PRINT "Final response = "; r PRINT "Peak r = "; highest END SUB axes ' Set up X and Y-axes LINE (0, 240)-(640, 240) LINE (0, 0)-(0, 480) FOR I = 0 TO 640 STEP 32 LINE (I, 244)-(I, 236) ' X-AXIS TICKS NEXT I FOR I = 0 TO 480 STEP 24 LINE (0, I)-(4, I) ' Y-AXIS TICKS NEXT I LINE (0, 120)-(12, 120) LINE (0, 360)-(12, 360) LINE (320, 250)-(320, 230) END SUB