+x+xThanks for the file. The code as-is does not make use of the generated sequence, so -- right now -- it doesn't really make sense to run the sequence generation block at all. The freezing / blank screen occurs because, as I suspected, the generator runs into an unrecoverable state or endless loop because it cannot create a suitable sequence. Some of that is due to misconfiguration of the various <values>. /totaltrialcount ought to specify the desired length of the sequence, that is the total amount of trials you want to create a sequence for. /count1 to /count8 ought to reflect the desired number of trials for each respective category (it's 10 per category in the original); neither /totaltrialcount nor the /count1 to /count8 values may all be set to zero as in your modification of the sequence generator.
Also note that, if you do change the values for /count1 to /count8, you need to modify the reset logic in <trial selectnumber> accordingly, otherwise they'll end up being reset to the default 10:
/ontrialend = [if (values.reset == true)
{
values.sequence = "";
values.index = 0; values.count_comparecat = 0; values.count_compareformat = 0;
values.runcount_1 = 0; values.runcount_2 = 0; values.runcount_3 = 0; values.runcount_4 = 0;
values.runcount_A = 0; values.runcount_B = 0;
values.count1 = 10; values.count2 = 10; values.count3 = 10; values.count4 = 10; values.count5 = 10; values.count6 = 10; values.count7 = 10; values.count8 = 10;list.stimcats.reset()
}]
As I've said before, I don't necessarily think relying on the sequence generator is recommendable in your case, especially since you effectively seem to want two separate / distinct sequences (one for the trained, another for the untrained part) with different parameters. I don't see a straightforward way to extend the generator to create such a thing in one go.
I've coded up a stand-alone version the sequence generator that displays the generated sequence and its various parameters on-screen as it occurs in real time. It will alert to you resets as well as successful sequence generation and display the results on the monitor for review. This should make it easier to understand its mechanics, toy around with different settings and modifications and then examine their effects on sequence generation.
Hello,
The script I posted about a few months ago in this thread is working perfectly, thanks to your help. I am now working on another modified AAT script, which I have not been able to figure out how to modify properly. In the previous script, I needed each image shown an equal number of times. In the current script, I need the images shown in different proportions, and in the data file, I can see they are not in the proportions that I am trying to specify. I think the problem is the way I have written out the blocks but I would appreciate any assistance with where I have gone wrong here.
The breakdown of the 240 trials:
- 12 Threat pictures, shown 10 times each so a total of 120 trials. 9 of these times are Portrait/Pull (108 trials), 1 time each is Landscape/Push (12 trials).
- 12 Neutral pictures, shown 10 times each for another total of 120 trials. 1 time each Portrait/Pull, 9 times Landscape/Push.
There are 4 categories of images:
Category 1: 12 Threat Pictures, landscape orientation: indices 1-12 (I only list this in the list below 1 time)
Category 2: 12 Threat Pictures, portrait orientation: indices 13-24 (I list these 9 times below so it will show 9 times)
Category 3: 12 Neutral Pictures, landscape: indices 25-36 (I list these 9 times below so it will show 9 times)
Category 4: 12 Neutral Pictures, portrait: indices 37-48 (I only list this in the list below 1 time)
<list category1>
/ items = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
/ replace = false
</list>
<list category2>
/ items = (13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24)
/ replace = false
</list>
<list category3>
/ items = (25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36)
/ replace = false
</list>
<list category4>
/ items = (37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48)
/ replace = false
</list>
Then I have each of the 4 categories in AAT_1, AAT_2, AAT_3, and AAT_4
<trial AAT_1>
/ ontrialbegin = [
values.selectstimulus = list.category1.nextvalue;
values.targetcategory = 1;
values.targetformat = "l";
picture.targetstimulus.height = values.startheight_A;
values.starttime = script.elapsedtime;
values.endtime = 0;
values.completeRT = 0;
values.changedirection = 0;
values.finalresponse="";
]
/ stimulusframes = [1 = targetstimulus]
/ validresponse = (back, forward)
/ iscorrectresponse = [(values.expcondition == 1 && trial.AAT_1.response == "forward") || (values.expcondition == 2 && trial.AAT_1.response == "back")]
/ errormessage = true(error,0)
/ response = correct
/ monkeyresponse = [if (values.expcondition == 1) "forward" else "back"]
/ ontrialend = [
values.joystick_y = joystick.y;
values.joystick_change = abs(values.joystick_y);
values.trialcode = "AAT_1";
values.RT = trial.AAT_1.latency;
values.correct = trial.AAT_1.correct;
values.stimulus = picture.targetstimulus.currentitem;
if (trial.AAT_1.response == "forward")
values.initialresponse = "PUSH"
else
values.initialresponse = "PULL";
list.accuracy_overall.insertitem(trial.AAT_1.correct,1);
if (trial.AAT_1.correct) {
list.AAT1correctlatencies.insertitem(trial.AAT_1.latency, 1);
list.latencies_overall.insertitem(trial.AAT_1.latency, 1);
}
]
/ branch = [
if (trial.AAT_1.response == "forward")
trial.decrease
else
trial.increase;
]
/ recorddata = false
</trial>
<trial AAT_2>
/ ontrialbegin = [
values.selectstimulus = list.category2.nextvalue;
values.targetcategory = 1;
values.targetformat = "p";
picture.targetstimulus.height = values.startheight_B;
values.starttime = script.elapsedtime;
values.endtime = 0;
values.completeRT = 0;
values.changedirection = 0;
values.finalresponse="";
]
/ stimulusframes = [1 = targetstimulus]
/ validresponse = (back, forward)
/ iscorrectresponse = [(values.expcondition == 1 && trial.AAT_2.response == "back") || (values.expcondition == 2 && trial.AAT_2.response == "forward")]
/ errormessage = true(error,0)
/ response = correct
/ monkeyresponse = [if (values.expcondition == 1) "back" else "forward"]
/ ontrialend = [
values.joystick_y = joystick.y;
values.joystick_change = abs(values.joystick_y);
values.trialcode = "AAT_2";
values.RT = trial.AAT_2.latency;
values.correct = trial.AAT_2.correct;
values.stimulus = picture.targetstimulus.currentitem;
if (trial.AAT_2.response == "forward")
values.initialresponse = "PUSH"
else
values.initialresponse = "PULL";
list.accuracy_overall.insertitem(trial.AAT_2.correct,1);
if (trial.AAT_2.correct) {
list.AAT2correctlatencies.insertitem(trial.AAT_2.latency, 1);
list.latencies_overall.insertitem(trial.AAT_2.latency, 1);
}
]
/ branch = [
if (trial.AAT_2.response == "forward")
trial.decrease
else
trial.increase
]
/ recorddata = false
</trial>
<trial AAT_3>
/ ontrialbegin = [
values.selectstimulus = list.category3.nextvalue;
values.targetcategory = 2;
values.targetformat = "l";
picture.targetstimulus.height = values.startheight_A;
values.starttime = script.elapsedtime;
values.endtime = 0;
values.completeRT = 0;
values.changedirection = 0;
values.finalresponse="";
]
/ stimulusframes = [1 = targetstimulus]
/ validresponse = (back, forward)
/ iscorrectresponse = [(values.expcondition == 1 && trial.AAT_3.response == "forward") || (values.expcondition == 2 && trial.AAT_3.response == "back")]
/ errormessage = true(error,0)
/ response = correct
/ monkeyresponse = [if (values.expcondition == 1) "forward" else "back"]
/ ontrialend = [
values.joystick_y = joystick.y;
values.joystick_change = abs(values.joystick_y);
values.trialcode = "AAT_3";
values.RT = trial.AAT_3.latency;
values.correct = trial.AAT_3.correct;
values.stimulus = picture.targetstimulus.currentitem;
if (trial.AAT_3.response == "forward")
values.initialresponse = "PUSH"
else
values.initialresponse = "PULL";
list.accuracy_overall.insertitem(trial.AAT_3.correct,1);
if (trial.AAT_3.correct) {
list.AAT3correctlatencies.insertitem(trial.AAT_3.latency, 1);
list.latencies_overall.insertitem(trial.AAT_3.latency, 1);
}
]
/ branch = [
if (trial.AAT_3.response == "forward")
trial.decrease
else
trial.increase;
]
/ recorddata = false
</trial>
<trial AAT_4>
/ ontrialbegin = [
values.selectstimulus = list.category4.nextvalue;
values.targetcategory = 2;
values.targetformat = "p";
picture.targetstimulus.height = values.startheight_B;
values.starttime = script.elapsedtime;
values.endtime = 0;
values.completeRT = 0;
values.changedirection = 0;
values.finalresponse="";
]
/ stimulusframes = [1 = targetstimulus]
/ validresponse = (back, forward)
/ iscorrectresponse = [(values.expcondition == 1 && trial.AAT_4.response == "back") || (values.expcondition == 2 && trial.AAT_4.response == "forward")]
/ errormessage = true(error,0)
/ response = correct
/ monkeyresponse = [if (values.expcondition == 1) "back" else "forward"]
/ ontrialend = [
values.joystick_y = joystick.y;
values.joystick_change = abs(values.joystick_y);
values.trialcode = "AAT_4";
values.RT = trial.AAT_4.latency;
values.correct = trial.AAT_4.correct;
values.stimulus = picture.targetstimulus.currentitem;
if (trial.AAT_4.response == "forward")
values.initialresponse = "PUSH"
else
values.initialresponse = "PULL";
list.accuracy_overall.insertitem(trial.AAT_4.correct,1);
if (trial.AAT_4.correct) {
list.AAT4correctlatencies.insertitem(trial.AAT_4.latency, 1);
list.latencies_overall.insertitem(trial.AAT_4.latency, 1);
}
]
/ branch = [
if (trial.AAT_4.response == "forward")
trial.decrease
else
trial.increase
]
/ recorddata = false
</trial>
And then finally, the blocks, which I believe I have done incorrectly:block practice_AAT>
/ trials = [1-2 = instructions; 3-12 = noreplace(practicetrial_A, practicetrial_B, practicetrial_C, practicetrial_D)]
</block>
<block trained_AAT>
/ trials = [1 = instructions2; 2-81, 83-162, 164-243 = noreplace(AAT_1, AAT_2, AAT_3, AAT_4); 82, 163 = instructions3]
</block>
<expt>
/ subjects = (1 of 1)
/ groupassignment = groupnumber
/ onexptbegin = [
values.expcondition = 1;
values.format1 = "PORTRAIT";
values.format2 = "LANDSCAPE";
values.startheight_A = parameters.Startheight_ratioA*values.Maxheight_px;
values.startheight_B = parameters.Startheight_ratioB* values.Maxheight_px;
]
/ blocks = [
1 = practice_AAT;
2 = trained_AAT;
]
/ postinstructions = (End)
/ onexptend = [values.completed = 1]
</expt>
Thank you very much for any help!