creating fixed picture locations for different trial types


Author
Message
charlottebooth
charlottebooth
Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)
Group: Forum Members
Posts: 45, Visits: 249
I am creating a visual search task with two different trial types - "old" and "new" ones:
"old" trials need to create 12 fixed search displays - with 11 distractors and 1 target picture, which will be repeated in every one of 16 blocks.
"new" trials need to create semi-random search displays - the distractors need to be in random locations, but the target needs to be in 12 fixed locations that are different to the 12 fixed locations of the "old" trials.
This task has 48 possible positions for the pictures (8x6 invisible grid).
How can I do this so that it creates random "old"/"new" configurations for each new participant?

I have attached my script so far.

Attachments
Contextual Cueing Task.zip (320 views, 12.00 KB)
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
Conceptually, what you need to do is this:

(1) At the beginning of the experiment (/onexptbegin), select 12 positions of your 48 positions at random for your "target" in "old" trials. Store those 12 positions in a dedicated list or counter. Do the same for 12 positions of the "target" in "new" configurations.

(2) For the "old" trials, you'll also want to assemble lists for the distractor positions /onexptbegin. Pick one of the "old" target positions you selected under one, pick positions for the 11 distractors, store the overall result (i.e., the entire configuration) in dedicated lists. Repeat for all 12 "old" target positions selected under (1).

(3) At runtime, your <old> trials ought to sample one of the 12 "old" configurations generated under (2). For "new" trials, it should suffice to simply sample one of the "new" target positions gathered under (1) and place the 11 distractors randomly into the remaining 47 positions at runtime (you already know how to do this).

charlottebooth
charlottebooth
Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)
Group: Forum Members
Posts: 45, Visits: 249
Cool! So would I need to create completely new lists or counters? Or would I be editing my pre-existing ones?

And what would the syntax roughly look like for :
<expt CC>
/onexptbegin = [               ???           ]
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
You would have one or several initial lists that hold e.g. your coordinates (x/y pairs) for the target / distractors. You'd have several initially empty lists in your script. You would then populate those lists at the beginning of the experiment. See e.g. https://www.millisecond.com/forums/FindPost15181.aspx for an introductory example re. how to construct such lists. Then see https://www.millisecond.com/forums/FindPost15870.aspx later in the thread for an extension.

charlottebooth
charlottebooth
Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)
Group: Forum Members
Posts: 45, Visits: 249
So for (1) it would maybe be something like:

<list oldtargets>
</list>

<list oldtargetcoord>
/poolsize = 12
/selectionrate = always
/items = (values.targetx, values.targety)
</list>

<expt example>
/onexptbegin = [list.oldtargets.appenditem(list.oldtargetcoord.nextindex); list.oldtargets.appenditem(list.oldtargetcoord.nextindex); list.oldtargets.appenditem(list.oldtargetcoord.nextindex); list.oldtargets.appenditem(list.oldtargetcoord.nextindex); list.oldtargets.appenditem(list.oldtargetcoord.nextindex); list.oldtargets.appenditem(list.oldtargetcoord.nextindex); list.oldtargets.appenditem(list.oldtargetcoord.nextindex); list.oldtargets.appenditem(list.oldtargetcoord.nextindex); list.oldtargets.appenditem(list.oldtargetcoord.nextindex); list.oldtargets.appenditem(list.oldtargetcoord.nextindex); list.oldtargets.appenditem(list.oldtargetcoord.nextindex); list.oldtargets.appenditem(list.oldtargetcoord.nextindex) ]
</expt>



charlottebooth
charlottebooth
Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)
Group: Forum Members
Posts: 45, Visits: 249
But I cant imagine whether the previous work in trial is obsolete?:
/ ontrialbegin = [values.targetpos=counter.targetspositions.selectedvalue; values.targetx=counter.targetsxpos.selectedvalue; values.targety=counter.targetsypos.selectedvalue;
values.targetx+=values.jitterstep*counter.randomjitter.selectedvalue; values.targety+=values.jitterstep*counter.randomjitter.selectedvalue;
                  values.distractor1pos=counter.distractorpositions.selectedvalue; values.distractor1x=counter.distractorxpos.selectedvalue; values.distractor1y=counter.distractorypos.selectedvalue;
values.distractor1x+=values.jitterstep*counter.randomjitter.selectedvalue; values.distractor1y+=values.jitterstep*counter.randomjitter.selectedvalue;
                  values.distractor2pos=counter.distractorpositions.selectedvalue; values.distractor2x=counter.distractorxpos.selectedvalue; values.distractor2y=counter.distractorypos.selectedvalue;
values.distractor2x+=values.jitterstep*counter.randomjitter.selectedvalue; values.distractor2y+=values.jitterstep*counter.randomjitter.selectedvalue;            
                  values.distractor3pos=counter.distractorpositions.selectedvalue; values.distractor3x=counter.distractorxpos.selectedvalue; values.distractor3y=counter.distractorypos.selectedvalue;
values.distractor3x+=values.jitterstep*counter.randomjitter.selectedvalue; values.distractor3y+=values.jitterstep*counter.randomjitter.selectedvalue;
                  values.distractor4pos=counter.distractorpositions.selectedvalue; values.distractor4x=counter.distractorxpos.selectedvalue; values.distractor4y=counter.distractorypos.selectedvalue;
values.distractor4x+=values.jitterstep*counter.randomjitter.selectedvalue; values.distractor4y+=values.jitterstep*counter.randomjitter.selectedvalue;
                  values.distractor5pos=counter.distractorpositions.selectedvalue; values.distractor5x=counter.distractorxpos.selectedvalue; values.distractor5y=counter.distractorypos.selectedvalue;
values.distractor5x+=values.jitterstep*counter.randomjitter.selectedvalue; values.distractor5y+=values.jitterstep*counter.randomjitter.selectedvalue;
                  values.distractor6pos=counter.distractorpositions.selectedvalue; values.distractor6x=counter.distractorxpos.selectedvalue; values.distractor6y=counter.distractorypos.selectedvalue;
values.distractor6x+=values.jitterstep*counter.randomjitter.selectedvalue; values.distractor6y+=values.jitterstep*counter.randomjitter.selectedvalue;
                  values.distractor7pos=counter.distractorpositions.selectedvalue; values.distractor7x=counter.distractorxpos.selectedvalue; values.distractor7y=counter.distractorypos.selectedvalue;
values.distractor7x+=values.jitterstep*counter.randomjitter.selectedvalue; values.distractor7y+=values.jitterstep*counter.randomjitter.selectedvalue;
                  values.distractor8pos=counter.distractorpositions.selectedvalue; values.distractor8x=counter.distractorxpos.selectedvalue; values.distractor8y=counter.distractorypos.selectedvalue;
values.distractor8x+=values.jitterstep*counter.randomjitter.selectedvalue; values.distractor8y+=values.jitterstep*counter.randomjitter.selectedvalue;
                  values.distractor9pos=counter.distractorpositions.selectedvalue; values.distractor9x=counter.distractorxpos.selectedvalue; values.distractor9y=counter.distractorypos.selectedvalue;
values.distractor9x+=values.jitterstep*counter.randomjitter.selectedvalue; values.distractor9y+=values.jitterstep*counter.randomjitter.selectedvalue;
                  values.distractor10pos=counter.distractorpositions.selectedvalue; values.distractor10x=counter.distractorxpos.selectedvalue; values.distractor10y=counter.distractorypos.selectedvalue;
values.distractor10x+=values.jitterstep*counter.randomjitter.selectedvalue; values.distractor10y+=values.jitterstep*counter.randomjitter.selectedvalue;
                  values.distractor11pos=counter.distractorpositions.selectedvalue; values.distractor11x=counter.distractorxpos.selectedvalue; values.distractor11y=counter.distractorypos.selectedvalue;
values.distractor11x+=values.jitterstep*counter.randomjitter.selectedvalue; values.distractor11y+=values.jitterstep*counter.randomjitter.selectedvalue]

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
The previous work in the <trial> is *not* obsolete.

At the beginning of the experiment you'll want to to construct, "fill" or assemble the lists that the respective <trial> elements then *later during* the experiment sample from.

The 12 target posititions you'll be using for the "new" trials, for example, are *not known* beforehand. Hence you cannot just hardcode 12 specific positions in a list somewhere.

Instead, you need to 1st randomly *select* those 12 positions from the total of 48 positions and store those in a list. That list then is where your "new" trials sample their target positions from.

Hope this clarifies.

One further tip: Before you start thinking about writing any code, try to imagine how you would do things in the real world with physical objects. Imagine your grid / set of 48 positions as a deck of 48 cards. Then proceed to draw 12 random cards and put them in a deck labeled "target new", etc. I find that thinking about matters of random selection in this way helps.

charlottebooth
charlottebooth
Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)
Group: Forum Members
Posts: 45, Visits: 249
Sorry I have some more questions :blink:


<block myblock>
/ onblockbegin = [list.sourceitems.appenditem(list.allitems.nextindex); list.sourceitems.appenditem(list.allitems.nextindex);
    list.sourceitems.appenditem(list.allitems.nextindex); list.sourceitems.appenditem(list.allitems.nextindex);
    list.targetitems.appenditem(list.allitems.nextindex); list.targetitems.appenditem(list.allitems.nextindex);]
/ trials = [1-4=showsources; 5-6=showtargets]
</block>

What does appenditem - and nextindex do/mean?

<trial showsources>
/ stimulusframes = [1=sourcetxt]
/ validresponse = (57)
</trial>

<trial showtargets>
/ stimulusframes = [1=targettxt]
/ validresponse = (57)
</trial>

<text sourcetxt>
/items = myitems
/ select = list.sourceitems.nextvalue
/ txcolor = blue
</text>

<text targettxt>
/items = myitems
/ select = list.targetitems.nextvalue
/ txcolor = red
</text>

<item myitems>
/ 1 = "A"
/ 2 = "B"
/ 3 = "C"
/ 4 = "D"
/ 5 = "E"
/ 6 = "F"
</item>
*Will I need to make 48 of these for all the possible coordinates? and what would that looks like? (ie "list.targetx=counter.target")?

<list allitems>
/ poolsize = 6
/ selectionrate = always
</list>
*Would the pool size here be 12 (for stimuli) or 48 for positions?

<list sourceitems>
</list>

<list targetitems>
</list>

*would I need 3 empty lists for oldtargets, newtargets, distractorpositions?

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
#1: The appenditem() function appends an item to the specified list. So, if the list is empty in the begining, the 1st time you apply that function, the respective item will be the 1st in the formerly empty list. The next time you apply it, it adds another item (then 2nd) and so forth. The items that are added come from list.allitems in the example. A random index number (nextindex; here between 1 and 6) is sampled from list.allitems and added to list.sourceitmes. That's what

list.sourceitems.appenditem(list.allitems.nextindex)

does in the example. For details on list properties and functions, see the language reference entry for the <list> element in the documentation.

#2: Yes, you need to work with more items, of course. You have 48 positions. As per previous examples, you can simply number them 1 to 48. You want to select 12 of those 48 at random and add them to one list (= target positions to be used in "new" trials), and another 12 at random to another list (=target positions to be used in "old" trials). How that works -- sampling from a "master" list at random, and adding the sampled items to (a) different list(s) -- is what the example covers.

#3: As per #2, the /poolsize would be 48.

#4: Yes, you need several lists. Exactly how many is a matter of various design decisions. Again, as per #2, you definitely need
- one list for "old" target positions (12 items will end up in that list),
- one list for "new" target positions (another 12 items will end up there),
- one or several lists that store the set of distractor positions associated with a given target position in "old" trials.

Leave aside the "old" trials for now. Start with setting up the "new" trials. I.e., from the list that holds your total set of 48 positions, select 12 at random / add them to a list. Sample target positions from that list in "new" trials, while distributing the distractors randomly as per previous examples.


charlottebooth
charlottebooth
Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)
Group: Forum Members
Posts: 45, Visits: 249
Ok so my first immediate problem is how the list can hold all the positions.

<list newtargets>
</list>

<list allpositions>
/poolsize = 46
/selectionrate = always
</list>

<item positions>
/1= how to specify a position here which is horizontally 29% and vertically 34% for example
/2= and then this one would be 29% horizontally and 40.5% vertically
/3=
/4=

</item>




GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search