-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMCT_FISH_practice.pcl
/
MCT_FISH_practice.pcl
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
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
#### setting up constants and arrays
int max_rt=2500;
int rt=0;
int xoffleft=-80;
int xoffright=80;
int numpos=30; # number of fish positions in one lake
int numpicparts_startingdisplay=3; # grey box frame and two lakes
# fish colours (for one lake); 0=black, 1=white
array<int>fishcolours_black80percent_white20percent[numpos]={ # 24 vs 6 = 80% vs 20%
0,0,0,0,0,0, 0,0,0,0,0,0, 0,0,0,0,0,0, 0,0,0,0,0,0, 1,1,1,1,1,1};
array<int>fishcolours_white80percent_black20percent[numpos]={ # 24 vs 6 = 80% vs 20%
1,1,1,1,1,1, 1,1,1,1,1,1, 1,1,1,1,1,1, 1,1,1,1,1,1, 0,0,0,0,0,0};
array<int>fishcolours_black90percent_white10percent[numpos]={ # 27 vs 3 = 90% vs 10%
0,0,0,0,0,0, 0,0,0,0,0,0, 0,0,0,0,0,0, 0,0,0,0,0,0, 0,0,0, 1,1,1};
array<int>fishcolours_white90percent_black10percent[numpos]={ # 27 vs 3 = 90% vs 10%
1,1,1,1,1,1, 1,1,1,1,1,1, 1,1,1,1,1,1, 1,1,1,1,1,1, 1,1,1, 0,0,0};
array<int>left_lake_positions[numpos][2]={ #{x,y} for each fish
{-110,47}, {-97,56}, {-80,62}, {-63,56}, {-50,47},
{-118,30}, {-97,33}, {-80,40}, {-63,33}, {-42,30},
{-122,10}, {-100,10}, {-80,14}, {-60,10}, {-38,10},
{-122,-10},{-100,-10},{-80,-14}, {-60,-10},{-38,-10},
{-118,-30},{-97,-33},{-80,-40}, {-63,-33},{-42,-30},
{-110,-47},{-97,-56},{-80,-62}, {-63,-56},{-50,-47}
};
array<int>right_lake_positions[numpos][2]={
{50,47}, {63,56}, {80,62}, {97,56}, {110,47},
{42,30}, {63,33}, {80,40}, {97,33}, {118,30},
{38,10}, {60,10}, {80,14}, {100,10}, {122,10},
{38,-10},{60,-10},{80,-14}, {100,-10},{122,-10},
{42,-30},{63,-33},{80,-40}, {97,-33},{118,-30},
{50,-47},{63,-56},{80,-62}, {97,-56},{110,-47}
};
int numtrialspercondandside=15;
int numtrialsinrun=numtrialspercondandside*8; # 4 levels for evidence strength x 2 for focal lake being in left vs right visual field
#############################################################################################################
# array of all the ITIs for one condition & focal lake side (left vs right visual field)
array<int>iti_array[15];
loop int i=1 until i > 7 begin iti_array[i]=2000; i=i+1; end; # ITI 2 seconds
loop int i=8 until i > 11 begin iti_array[i]=4000; i=i+1; end; # ITI 4 seconds
loop int i=12 until i > 13 begin iti_array[i]=6000; i=i+1; end; # ITI 6 seconds
loop int i=14 until i > 15 begin iti_array[i]=8000; i=i+1; end; # ITI 8 seconds
################################################################################
# column 1: focal lake in left (0) vs right (1) visual field
# column 2: percent fish of relevant colour in focal lake
# column 3: percent fish of relevant colour in alternate lake
# column 4: ITI
array<int>trial_array[numtrialsinrun][4]; # easy to adjust if numtrialspercondandside changes
iti_array.shuffle();
loop int i=1 until i > numtrialspercondandside begin
trial_array[i][1]=0; trial_array[i][2]=80; trial_array[i][3]=10;
trial_array[i][4]=iti_array[i]; i=i+1;
end;
iti_array.shuffle();
loop int i=numtrialspercondandside+1 until i > numtrialspercondandside*2 begin
trial_array[i][1]=0; trial_array[i][2]=20; trial_array[i][3]=10;
trial_array[i][4]=iti_array[i-numtrialspercondandside]; i=i+1;
end;
iti_array.shuffle();
loop int i=numtrialspercondandside*2+1 until i > numtrialspercondandside*3 begin
trial_array[i][1]=0; trial_array[i][2]=80; trial_array[i][3]=90;
trial_array[i][4]=iti_array[i-numtrialspercondandside*2]; i=i+1;
end;
iti_array.shuffle();
loop int i=numtrialspercondandside*3+1 until i > numtrialspercondandside*4 begin
trial_array[i][1]=0; trial_array[i][2]=20; trial_array[i][3]=90;
trial_array[i][4]=iti_array[i-numtrialspercondandside*3]; i=i+1;
end;
iti_array.shuffle();
loop int i=numtrialspercondandside*4+1 until i > numtrialspercondandside*5 begin
trial_array[i][1]=1; trial_array[i][2]=80; trial_array[i][3]=10;
trial_array[i][4]=iti_array[i-numtrialspercondandside*4]; i=i+1;
end;
iti_array.shuffle();
loop int i=numtrialspercondandside*5+1 until i > numtrialspercondandside*6 begin
trial_array[i][1]=1; trial_array[i][2]=20; trial_array[i][3]=10;
trial_array[i][4]=iti_array[i-numtrialspercondandside*5]; i=i+1;
end;
iti_array.shuffle();
loop int i=numtrialspercondandside*6+1 until i > numtrialspercondandside*7 begin
trial_array[i][1]=1; trial_array[i][2]=80; trial_array[i][3]=90;
trial_array[i][4]=iti_array[i-numtrialspercondandside*6]; i=i+1;
end;
iti_array.shuffle();
loop int i=numtrialspercondandside*7+1 until i > numtrialspercondandside*8 begin
trial_array[i][1]=1; trial_array[i][2]=20; trial_array[i][3]=90;
trial_array[i][4]=iti_array[i-numtrialspercondandside*7]; i=i+1;
end;
trial_array.shuffle();
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
##########################################################################################################
##########################################################################################################
##########################################################################################################
sub get_button_response_sub begin
################### initialize mouse and cursor position
############################################################
int ratingdone=0; # has a value of 0 if mouse hasn't been clicked, 1 if it has been clicked
int lastresp;
int new_response_count;
int old_response_count=0;
int respondedyet=0; # 0 for no, 1 for yes
int rt_start=clock.time();
rt=0;
ratingdone=0;
lastresp=0;
loop rt = 0 until respondedyet > 0 begin #>= max_rt begin
old_response_count=response_manager.response_data_count( );
display_trial.present();
lastresp=response_manager.last_response();
new_response_count=response_manager.response_data_count( );
if (lastresp==1 && new_response_count > old_response_count)then
display_pic.set_part(66,blacksquare_box);
display_pic.set_part(68,greysquare_box);
respondedyet=1;
elseif (lastresp==2 && new_response_count > old_response_count)then
display_pic.set_part(68,blacksquare_box);
display_pic.set_part(66,greysquare_box);
respondedyet=1;
end;
int rt_end=clock.time();
rt=rt_end-rt_start;
end; # end loop
end; # end button response subroutine
#############################################################################################
#############################################################################################
#############################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
#### experiment starts running here
instructions_trial.present();
start_trial.present(); # waits for the code from the scanner
loop int trl=1 until trl > numtrialsinrun begin
# 1000 ms jitter width with 'rectangular' (even) distribution, so that timing is optimized for ERP analyses
#int ITI=trial_array[trl][4];
int ITI=random(1000,1500); # just for piloting & programming
ITI_event.set_duration(ITI);
#display_event.set_deltat(ITI);
int currentportcode=100*trial_array[trl][1]+trial_array[trl][2]+trial_array[trl][3]; # should always be between 0 and 255
# for example, left lake is focal, focal has 90% alt has 80% would be 0*100+90+(80/10)=98.
# right lake is focal, focal has 90% alt has 80% would be 1*100+90+(80/10)=198.
# right lake is focal, focal has 20% alt has 10% would be 1*100+20+(10/10)=121.
#display_event.set_port_code(currentportcode); # uncomment once we get access to the facilities and can set up hardware
#########################################################################################
#### jittering fish positions a bit so it's not a perfect grid that's the same each trial
# the index of the first picture part to have its position set in the loop below is this plus 1
int left_picpart_start=numpicparts_startingdisplay;
int right_picpart_start=numpos+numpicparts_startingdisplay;
loop int leftfish=1 until leftfish > numpos begin
int xjitter=random(-2,2);
int yjitter=random(-2,2);
display_pic.set_part_x(left_picpart_start+leftfish,left_lake_positions[leftfish][1]+xjitter);
display_pic.set_part_y(left_picpart_start+leftfish,left_lake_positions[leftfish][2]+yjitter);
leftfish=leftfish+1;
end;
loop int rightfish=1 until rightfish > numpos begin
int xjitter=random(-3,3);
int yjitter=random(-3,3);
display_pic.set_part_x(right_picpart_start+rightfish,right_lake_positions[rightfish][1]+xjitter);
display_pic.set_part_y(right_picpart_start+rightfish,right_lake_positions[rightfish][2]+yjitter);
rightfish=rightfish+1;
end;
################################################################################################################
#### so that, within a given lake, the locations of fish of the relevant colour and filler colour will be random
fishcolours_white80percent_black20percent.shuffle();
fishcolours_black80percent_white20percent.shuffle();
fishcolours_white90percent_black10percent.shuffle();
fishcolours_black90percent_white10percent.shuffle();
################################################################################################################
#int relevant_colour=random(0,1); # 0=black fish, 1=white fish
int relevant_colour=0;
if relevant_colour==0 then
display_pic.set_part(numpicparts_startingdisplay+numpos*2+1,bmp_blackfish_fixn); # fixn is last part of display_pic
elseif relevant_colour==1 then
display_pic.set_part(numpicparts_startingdisplay+numpos*2+1,bmp_whitefish_fixn);
end;
#############################################################################################################
#############################################################################################################
#############################################################################################################
#############################################################################################################
#############################################################################################################
#############################################################################################################
#### big huge if statement for setting up most of the display features for the current trial
#### 80% in focal, 10% in alt
int focal_colour=random(0,1);
if focal_colour==0 then
if trial_array[trl][1]==0 then
display_pic.set_part(numpicparts_startingdisplay+numpos*2+1,bmp_blackfishpointingleft_fixn);
elseif trial_array[trl][1]==1 then
display_pic.set_part(numpicparts_startingdisplay+numpos*2+1,bmp_blackfishpointingright_fixn);
end;
elseif focal_colour==1 then
if trial_array[trl][1]==0 then
display_pic.set_part(numpicparts_startingdisplay+numpos*2+1,bmp_whitefishpointingleft_fixn);
elseif trial_array[trl][1]==1 then
display_pic.set_part(numpicparts_startingdisplay+numpos*2+1,bmp_whitefishpointingright_fixn);
end;
end;
# 0=left lake is focal, 0=black fish relevant, 80% in focal lake, 10% in alt lake
if trial_array[trl][1]==0 && relevant_colour==0 && trial_array[trl][2]==80 && trial_array[trl][3]==10 then
display_pic.set_part_x(2,xoffleft); # second picture part is green ellipse
display_pic.set_part_x(3,xoffright); # third picture part is blue ellipse
loop int leftfish=1 until leftfish > numpos begin # left lake is focal, green
if fishcolours_black80percent_white20percent[leftfish]==0 then
display_pic.set_part(left_picpart_start+leftfish,bmp_blackfish_greenlake);
elseif fishcolours_black80percent_white20percent[leftfish]==1 then
display_pic.set_part(left_picpart_start+leftfish,bmp_whitefish_greenlake);
end;
leftfish=leftfish+1;
end;
loop int rightfish=1 until rightfish > numpos begin # right lake is alt, blue
if fishcolours_white90percent_black10percent[rightfish]==0 then
display_pic.set_part(right_picpart_start+rightfish,bmp_blackfish_bluelake);
elseif fishcolours_white90percent_black10percent[rightfish]==1 then
display_pic.set_part(right_picpart_start+rightfish,bmp_whitefish_bluelake);
end;
rightfish=rightfish+1;
end;
# 1=right lake is focal, 0=black fish relevant, 80% in focal lake, 10% in alt lake
elseif trial_array[trl][1]==1 && relevant_colour==0 && trial_array[trl][2]==80 && trial_array[trl][3]==10 then
display_pic.set_part_x(2,xoffright); # second picture part is green ellipse
display_pic.set_part_x(3,xoffleft); # third picture part is blue ellipse
loop int leftfish=1 until leftfish > numpos begin # left lake is alt, blue
if fishcolours_white90percent_black10percent[leftfish]==0 then
display_pic.set_part(left_picpart_start+leftfish,bmp_blackfish_bluelake);
elseif fishcolours_white90percent_black10percent[leftfish]==1 then
display_pic.set_part(left_picpart_start+leftfish,bmp_whitefish_bluelake);
end;
leftfish=leftfish+1;
end;
loop int rightfish=1 until rightfish > numpos begin # right lake is focal, green
if fishcolours_black80percent_white20percent[rightfish]==0 then
display_pic.set_part(right_picpart_start+rightfish,bmp_blackfish_greenlake);
elseif fishcolours_black80percent_white20percent[rightfish]==1 then
display_pic.set_part(right_picpart_start+rightfish,bmp_whitefish_greenlake);
end;
rightfish=rightfish+1;
end;
# 0=left lake is focal, 1=white fish relevant, 80% in focal lake, 10% in alt lake
elseif trial_array[trl][1]==0 && relevant_colour==1 && trial_array[trl][2]==80 && trial_array[trl][3]==10 then
display_pic.set_part_x(2,xoffleft); # second picture part is green ellipse
display_pic.set_part_x(3,xoffright); # third picture part is blue ellipse
loop int leftfish=1 until leftfish > numpos begin # left lake is focal, green
if fishcolours_white80percent_black20percent[leftfish]==0 then
display_pic.set_part(left_picpart_start+leftfish,bmp_blackfish_greenlake);
elseif fishcolours_white80percent_black20percent[leftfish]==1 then
display_pic.set_part(left_picpart_start+leftfish,bmp_whitefish_greenlake);
end;
leftfish=leftfish+1;
end;
loop int rightfish=1 until rightfish > numpos begin # right lake is alt, blue
if fishcolours_black90percent_white10percent[rightfish]==0 then
display_pic.set_part(right_picpart_start+rightfish,bmp_blackfish_bluelake);
elseif fishcolours_black90percent_white10percent[rightfish]==1 then
display_pic.set_part(right_picpart_start+rightfish,bmp_whitefish_bluelake);
end;
rightfish=rightfish+1;
end;
# 1=right lake is focal, 1=white fish relevant, 80% in focal lake, 10% in alt lake
elseif trial_array[trl][1]==1 && relevant_colour==1 && trial_array[trl][2]==80 && trial_array[trl][3]==10 then
display_pic.set_part_x(2,xoffright); # second picture part is green ellipse
display_pic.set_part_x(3,xoffleft); # third picture part is blue ellipse
loop int leftfish=1 until leftfish > numpos begin # left lake is alt, blue
if fishcolours_black90percent_white10percent[leftfish]==0 then
display_pic.set_part(left_picpart_start+leftfish,bmp_blackfish_bluelake);
elseif fishcolours_black90percent_white10percent[leftfish]==1 then
display_pic.set_part(left_picpart_start+leftfish,bmp_whitefish_bluelake);
end;
leftfish=leftfish+1;
end;
loop int rightfish=1 until rightfish > numpos begin # right lake is focal, green
if fishcolours_white80percent_black20percent[rightfish]==0 then
display_pic.set_part(right_picpart_start+rightfish,bmp_blackfish_greenlake);
elseif fishcolours_white80percent_black20percent[rightfish]==1 then
display_pic.set_part(right_picpart_start+rightfish,bmp_whitefish_greenlake);
end;
rightfish=rightfish+1;
end;
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
#### 20% in focal, 10% in alt
# 0=left lake is focal, 0=black fish relevant, 20% in focal lake, 10% in alt lake
elseif trial_array[trl][1]==0 && relevant_colour==0 && trial_array[trl][2]==20 && trial_array[trl][3]==10 then
display_pic.set_part_x(2,xoffleft); # second picture part is green ellipse
display_pic.set_part_x(3,xoffright); # third picture part is blue ellipse
loop int leftfish=1 until leftfish > numpos begin # left lake is focal, green
if fishcolours_white80percent_black20percent[leftfish]==0 then
display_pic.set_part(left_picpart_start+leftfish,bmp_blackfish_greenlake);
elseif fishcolours_white80percent_black20percent[leftfish]==1 then
display_pic.set_part(left_picpart_start+leftfish,bmp_whitefish_greenlake);
end;
leftfish=leftfish+1;
end;
loop int rightfish=1 until rightfish > numpos begin # right lake is alt, blue
if fishcolours_white90percent_black10percent[rightfish]==0 then
display_pic.set_part(right_picpart_start+rightfish,bmp_blackfish_bluelake);
elseif fishcolours_white90percent_black10percent[rightfish]==1 then
display_pic.set_part(right_picpart_start+rightfish,bmp_whitefish_bluelake);
end;
rightfish=rightfish+1;
end;
# 1=right lake is focal, 0=black fish relevant, 20% in focal lake, 10% in alt lake
elseif trial_array[trl][1]==1 && relevant_colour==0 && trial_array[trl][2]==20 && trial_array[trl][3]==10 then
display_pic.set_part_x(2,xoffright); # second picture part is green ellipse
display_pic.set_part_x(3,xoffleft); # third picture part is blue ellipse
loop int leftfish=1 until leftfish > numpos begin # left lake is alt, blue
if fishcolours_white90percent_black10percent[leftfish]==0 then
display_pic.set_part(left_picpart_start+leftfish,bmp_blackfish_bluelake);
elseif fishcolours_white90percent_black10percent[leftfish]==1 then
display_pic.set_part(left_picpart_start+leftfish,bmp_whitefish_bluelake);
end;
leftfish=leftfish+1;
end;
loop int rightfish=1 until rightfish > numpos begin # right lake is focal, green
if fishcolours_white80percent_black20percent[rightfish]==0 then
display_pic.set_part(right_picpart_start+rightfish,bmp_blackfish_greenlake);
elseif fishcolours_white80percent_black20percent[rightfish]==1 then
display_pic.set_part(right_picpart_start+rightfish,bmp_whitefish_greenlake);
end;
rightfish=rightfish+1;
end;
# 0=left lake is focal, 1=white fish relevant, 20% in focal lake, 10% in alt lake
elseif trial_array[trl][1]==0 && relevant_colour==1 && trial_array[trl][2]==20 && trial_array[trl][3]==10 then
display_pic.set_part_x(2,xoffleft); # second picture part is green ellipse
display_pic.set_part_x(3,xoffright); # third picture part is blue ellipse
loop int leftfish=1 until leftfish > numpos begin # left lake is focal, green
if fishcolours_black80percent_white20percent[leftfish]==0 then
display_pic.set_part(left_picpart_start+leftfish,bmp_blackfish_greenlake);
elseif fishcolours_black80percent_white20percent[leftfish]==1 then
display_pic.set_part(left_picpart_start+leftfish,bmp_whitefish_greenlake);
end;
leftfish=leftfish+1;
end;
loop int rightfish=1 until rightfish > numpos begin # right lake is alt, blue
if fishcolours_black90percent_white10percent[rightfish]==0 then
display_pic.set_part(right_picpart_start+rightfish,bmp_blackfish_bluelake);
elseif fishcolours_black90percent_white10percent[rightfish]==1 then
display_pic.set_part(right_picpart_start+rightfish,bmp_whitefish_bluelake);
end;
rightfish=rightfish+1;
end;
# 1=right lake is focal, 1=white fish relevant, 20% in focal lake, 10% in alt lake
elseif trial_array[trl][1]==1 && relevant_colour==1 && trial_array[trl][2]==20 && trial_array[trl][3]==10 then
display_pic.set_part_x(2,xoffright); # second picture part is green ellipse
display_pic.set_part_x(3,xoffleft); # third picture part is blue ellipse
loop int leftfish=1 until leftfish > numpos begin # left lake is alt, blue
if fishcolours_black90percent_white10percent[leftfish]==0 then
display_pic.set_part(left_picpart_start+leftfish,bmp_blackfish_bluelake);
elseif fishcolours_black90percent_white10percent[leftfish]==1 then
display_pic.set_part(left_picpart_start+leftfish,bmp_whitefish_bluelake);
end;
leftfish=leftfish+1;
end;
loop int rightfish=1 until rightfish > numpos begin # right lake is focal, green
if fishcolours_black80percent_white20percent[rightfish]==0 then
display_pic.set_part(right_picpart_start+rightfish,bmp_blackfish_greenlake);
elseif fishcolours_black80percent_white20percent[rightfish]==1 then
display_pic.set_part(right_picpart_start+rightfish,bmp_whitefish_greenlake);
end;
rightfish=rightfish+1;
end;
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
#### 80% in focal, 90% in alt
# 0=left lake is focal, 0=black fish relevant, 80% in focal lake, 90% in alt lake
elseif trial_array[trl][1]==0 && relevant_colour==0 && trial_array[trl][2]==80 && trial_array[trl][3]==90 then
display_pic.set_part_x(2,xoffleft); # second picture part is green ellipse
display_pic.set_part_x(3,xoffright); # third picture part is blue ellipse
loop int leftfish=1 until leftfish > numpos begin # left lake is focal, green
if fishcolours_black80percent_white20percent[leftfish]==0 then
display_pic.set_part(left_picpart_start+leftfish,bmp_blackfish_greenlake);
elseif fishcolours_black80percent_white20percent[leftfish]==1 then
display_pic.set_part(left_picpart_start+leftfish,bmp_whitefish_greenlake);
end;
leftfish=leftfish+1;
end;
loop int rightfish=1 until rightfish > numpos begin # right lake is alt, blue
if fishcolours_black90percent_white10percent[rightfish]==0 then
display_pic.set_part(right_picpart_start+rightfish,bmp_blackfish_bluelake);
elseif fishcolours_black90percent_white10percent[rightfish]==1 then
display_pic.set_part(right_picpart_start+rightfish,bmp_whitefish_bluelake);
end;
rightfish=rightfish+1;
end;
# 1=right lake is focal, 0=black fish relevant, 80% in focal lake, 90% in alt lake
elseif trial_array[trl][1]==1 && relevant_colour==0 && trial_array[trl][2]==80 && trial_array[trl][3]==90 then
display_pic.set_part_x(2,xoffright); # second picture part is green ellipse
display_pic.set_part_x(3,xoffleft); # third picture part is blue ellipse
loop int leftfish=1 until leftfish > numpos begin # left lake is alt, blue
if fishcolours_black90percent_white10percent[leftfish]==0 then
display_pic.set_part(left_picpart_start+leftfish,bmp_blackfish_bluelake);
elseif fishcolours_black90percent_white10percent[leftfish]==1 then
display_pic.set_part(left_picpart_start+leftfish,bmp_whitefish_bluelake);
end;
leftfish=leftfish+1;
end;
loop int rightfish=1 until rightfish > numpos begin # right lake is focal, green
if fishcolours_black80percent_white20percent[rightfish]==0 then
display_pic.set_part(right_picpart_start+rightfish,bmp_blackfish_greenlake);
elseif fishcolours_black80percent_white20percent[rightfish]==1 then
display_pic.set_part(right_picpart_start+rightfish,bmp_whitefish_greenlake);
end;
rightfish=rightfish+1;
end;
# 0=left lake is focal, 1=white fish relevant, 80% in focal lake, 90% in alt lake
elseif trial_array[trl][1]==0 && relevant_colour==1 && trial_array[trl][2]==80 && trial_array[trl][3]==90 then
display_pic.set_part_x(2,xoffleft); # second picture part is green ellipse
display_pic.set_part_x(3,xoffright); # third picture part is blue ellipse
loop int leftfish=1 until leftfish > numpos begin # left lake is focal, green
if fishcolours_white80percent_black20percent[leftfish]==0 then
display_pic.set_part(left_picpart_start+leftfish,bmp_blackfish_greenlake);
elseif fishcolours_white80percent_black20percent[leftfish]==1 then
display_pic.set_part(left_picpart_start+leftfish,bmp_whitefish_greenlake);
end;
leftfish=leftfish+1;
end;
loop int rightfish=1 until rightfish > numpos begin # right lake is alt, blue
if fishcolours_white90percent_black10percent[rightfish]==0 then
display_pic.set_part(right_picpart_start+rightfish,bmp_blackfish_bluelake);
elseif fishcolours_white90percent_black10percent[rightfish]==1 then
display_pic.set_part(right_picpart_start+rightfish,bmp_whitefish_bluelake);
end;
rightfish=rightfish+1;
end;
# 1=right lake is focal, 1=white fish relevant, 80% in focal lake, 90% in alt lake
elseif trial_array[trl][1]==1 && relevant_colour==1 && trial_array[trl][2]==80 && trial_array[trl][3]==90 then
display_pic.set_part_x(2,xoffright); # second picture part is green ellipse
display_pic.set_part_x(3,xoffleft); # third picture part is blue ellipse
loop int leftfish=1 until leftfish > numpos begin # left lake is alt, blue
if fishcolours_white90percent_black10percent[leftfish]==0 then
display_pic.set_part(left_picpart_start+leftfish,bmp_blackfish_bluelake);
elseif fishcolours_white90percent_black10percent[leftfish]==1 then
display_pic.set_part(left_picpart_start+leftfish,bmp_whitefish_bluelake);
end;
leftfish=leftfish+1;
end;
loop int rightfish=1 until rightfish > numpos begin # right lake is focal, green
if fishcolours_white80percent_black20percent[rightfish]==0 then
display_pic.set_part(right_picpart_start+rightfish,bmp_blackfish_greenlake);
elseif fishcolours_white80percent_black20percent[rightfish]==1 then
display_pic.set_part(right_picpart_start+rightfish,bmp_whitefish_greenlake);
end;
rightfish=rightfish+1;
end;
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
#### 20% in focal, 90% in alt
# 0=left lake is focal, 0=black fish relevant, 20% in focal lake, 90% in alt lake
elseif trial_array[trl][1]==0 && relevant_colour==0 && trial_array[trl][2]==20 && trial_array[trl][3]==90 then
display_pic.set_part_x(2,xoffleft); # second picture part is green ellipse
display_pic.set_part_x(3,xoffright); # third picture part is blue ellipse
loop int leftfish=1 until leftfish > numpos begin # left lake is focal, green
if fishcolours_white80percent_black20percent[leftfish]==0 then
display_pic.set_part(left_picpart_start+leftfish,bmp_blackfish_greenlake);
elseif fishcolours_white80percent_black20percent[leftfish]==1 then
display_pic.set_part(left_picpart_start+leftfish,bmp_whitefish_greenlake);
end;
leftfish=leftfish+1;
end;
loop int rightfish=1 until rightfish > numpos begin # right lake is alt, blue
if fishcolours_black90percent_white10percent[rightfish]==0 then
display_pic.set_part(right_picpart_start+rightfish,bmp_blackfish_bluelake);
elseif fishcolours_black90percent_white10percent[rightfish]==1 then
display_pic.set_part(right_picpart_start+rightfish,bmp_whitefish_bluelake);
end;
rightfish=rightfish+1;
end;
# 1=right lake is focal, 0=black fish relevant, 20% in focal lake, 90% in alt lake
elseif trial_array[trl][1]==1 && relevant_colour==0 && trial_array[trl][2]==20 && trial_array[trl][3]==90 then
display_pic.set_part_x(2,xoffright); # second picture part is green ellipse
display_pic.set_part_x(3,xoffleft); # third picture part is blue ellipse
loop int leftfish=1 until leftfish > numpos begin # left lake is alt, blue
if fishcolours_black90percent_white10percent[leftfish]==0 then
display_pic.set_part(left_picpart_start+leftfish,bmp_blackfish_bluelake);
elseif fishcolours_black90percent_white10percent[leftfish]==1 then
display_pic.set_part(left_picpart_start+leftfish,bmp_whitefish_bluelake);
end;
leftfish=leftfish+1;
end;
loop int rightfish=1 until rightfish > numpos begin # right lake is focal, green
if fishcolours_white80percent_black20percent[rightfish]==0 then
display_pic.set_part(right_picpart_start+rightfish,bmp_blackfish_greenlake);
elseif fishcolours_white80percent_black20percent[rightfish]==1 then
display_pic.set_part(right_picpart_start+rightfish,bmp_whitefish_greenlake);
end;
rightfish=rightfish+1;
end;
# 0=left lake is focal, 1=white fish relevant, 20% in focal lake, 90% in alt lake
elseif trial_array[trl][1]==0 && relevant_colour==1 && trial_array[trl][2]==20 && trial_array[trl][3]==90 then
display_pic.set_part_x(2,xoffleft); # second picture part is green ellipse
display_pic.set_part_x(3,xoffright); # third picture part is blue ellipse
loop int leftfish=1 until leftfish > numpos begin # left lake is focal, green
if fishcolours_black80percent_white20percent[leftfish]==0 then
display_pic.set_part(left_picpart_start+leftfish,bmp_blackfish_greenlake);
elseif fishcolours_black80percent_white20percent[leftfish]==1 then
display_pic.set_part(left_picpart_start+leftfish,bmp_whitefish_greenlake);
end;
leftfish=leftfish+1;
end;
loop int rightfish=1 until rightfish > numpos begin # right lake is alt, blue
if fishcolours_white90percent_black10percent[rightfish]==0 then
display_pic.set_part(right_picpart_start+rightfish,bmp_blackfish_bluelake);
elseif fishcolours_white90percent_black10percent[rightfish]==1 then
display_pic.set_part(right_picpart_start+rightfish,bmp_whitefish_bluelake);
end;
rightfish=rightfish+1;
end;
# 1=right lake is focal, 1=white fish relevant, 20% in focal lake, 90% in alt lake
elseif trial_array[trl][1]==1 && relevant_colour==1 && trial_array[trl][2]==20 && trial_array[trl][3]==90 then
display_pic.set_part_x(2,xoffright); # second picture part is green ellipse
display_pic.set_part_x(3,xoffleft); # third picture part is blue ellipse
loop int leftfish=1 until leftfish > numpos begin # left lake is alt, blue
if fishcolours_white90percent_black10percent[leftfish]==0 then
display_pic.set_part(left_picpart_start+leftfish,bmp_blackfish_bluelake);
elseif fishcolours_white90percent_black10percent[leftfish]==1 then
display_pic.set_part(left_picpart_start+leftfish,bmp_whitefish_bluelake);
end;
leftfish=leftfish+1;
end;
loop int rightfish=1 until rightfish > numpos begin # right lake is focal, green
if fishcolours_black80percent_white20percent[rightfish]==0 then
display_pic.set_part(right_picpart_start+rightfish,bmp_blackfish_greenlake);
elseif fishcolours_black80percent_white20percent[rightfish]==1 then
display_pic.set_part(right_picpart_start+rightfish,bmp_whitefish_greenlake);
end;
rightfish=rightfish+1;
end;
end; # end of if statement for setting up most of display features for the current trial
#############################################################################################################
#############################################################################################################
#############################################################################################################
#############################################################################################################
#############################################################################################################
#############################################################################################################
display_event.set_event_code(string(trial_array[trl][1])+"focalleftvsright_"+string(trial_array[trl][2])+"focallakeperc_"
+string(trial_array[trl][3])+"altlakeperc_"+string(trial_array[trl][4])+"iti_"+string(relevant_colour)+"relevantcolour");
display_trial.present();
#display_device.screenshot( "C:\\Users\\CNOSlab\\Desktop\\MCT\\UBC versions\\3 FISH\\practice\\FISHscreenshot.bmp" );
get_button_response_sub();
responseshown_trial.present();
display_pic.set_part(66,greysquare_box);
display_pic.set_part(68,greysquare_box);
ITI_trial.present();
trl=trl+1;
end; # end of loop that goes through all the trials in the run
end_trial.present();