Constrained randomisation trouble


Author
Message
LMK
LMK
Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)
Group: Forum Members
Posts: 15, Visits: 5

And one last time....


I'm sure I have gone with inefficient and - given this message, flawed coding - but, I have got it to present text and pic stimuli and its nearly doing what I want....


The problems the script will typically run, however, it (seemingly randomly - i.e., sometimes between blocks, sometimes mid-block) stops and a message along the lines of " Unabled to initialize <picture addp> item number 0. Verify the item exists and is correctly defined".


There's also a quirk that sometimes the <counter xxxsequence> (compared to <counter xxxrandom>) seems to present all items, but not in order. This is true of both text and pic stimuli. I'm certain I have caused this as it was fine until I began fidling with the pictures, but can't seem to uncause it.


I will load the script and pics (all this time).


Any suggestions, corrections or efficiencies are, AS ALWAYS, greatly appreciated. I must admit that this code is generalised with very limited knowledge so I have relied with various levels of success ontrial and error to get things to "go".


Thank you,
Leah



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: 12K, Visits: 98K

Both "quirks" sound like bonafide programming errors on your part. You'll want to examine test data files of such failed runs to figure out where / when the errors occur exactly and then work backwards through your script's logic.


The problems the script will typically run, however, it (seemingly randomly - i.e., sometimes between blocks, sometimes mid-block) stops and a message along the lines of " Unabled to initialize <picture addp> item number 0. Verify the item exists and is correctly defined".


Probably means you've failed to assign the item properly. Check the conditional logic in the respective <trial>'s /ontrialbegin etc. attributes responsible for assigning items to the respective <picture> element.


There's also a quirk that sometimes the <counter xxxsequence> (compared to <counter xxxrandom>) seems to present all items, but not in order. This is true of both text and pic stimuli. I'm certain I have caused this as it was fine until I began fidling with the pictures, but can't seem to uncause it.


Probably means there's a flaw in the conditional logic responsible for determining the correct selection mode. Again, you'll want to carefully check the portions of your script responsible for handling that.


Regards,


~Dave


LMK
LMK
Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)
Group: Forum Members
Posts: 15, Visits: 5

Hi!


Thanks for you all your help.  I went back to basis and now almost everything is working....


My last issue is I'm having trouble with a counter, specifically <counter nonmatchpic>. I'm seeing pictures repeat across blocks and mutliply times with the experiment even though there are enough stimuli and I have set the resetinterval = 1000.  All the other counters seem fine.


Like always, any assistance would be gratefully received!


Thanks, Leah



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: 12K, Visits: 98K

Umm, I've misplaced my crystal ball and tarot cards, so I'm not sure how to tackle this without, you know, access to your script and such...;-) Anyway, if I were to hazard a guess, this again sounds like a bonafide programming error...


LMK
LMK
Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)
Group: Forum Members
Posts: 15, Visits: 5

Dear Dave,


Very plausible. The script is posted (to the same place as usual.... new.exp and using the same images (zipped folder + blank) as usual.


I'm sure it will be easy to spot in my (now much simplified) script.


Cheers, Leah



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: 12K, Visits: 98K

#1: For better context, you might consider attaching any materials to the respective thread instead of your profile. Alternatively mention the files you are referring to and their location.


#2: There is no element called <counter nonmatchpic> in the files you posted.


#3: The script will not parse and cannot run because you are trying to use a counter property which does not exist (.currentvalue).


LMK
LMK
Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)
Group: Forum Members
Posts: 15, Visits: 5

Dear Dave,


Very good points.... I guess I'm getting too tired to be useful (it's nearly 1am here).


I will definitely append scripts to post in future...... also I should have said <counter addnonmatchpic>.


Thanks, Leah


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: 12K, Visits: 98K

Well, you have 15 items available in your nonmatched picture condition. However, a given participant will receive 20 trials (4 blocks of 5 trials), i.e., the respective counter will inevitably have to reset after the 3rd block as it's out of unused items by then. Consequently certain items will have to be repeated.


LMK
LMK
Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)Distinguished Member (2.6K reputation)
Group: Forum Members
Posts: 15, Visits: 5

I'm pretty confident that this is not the problem. 


When I reduce the number of blocks in the experiment to 3 (which would present 15 pictures (i.e., the number in the list), at least a thrid of picture are repeated, AND thet repetition begins in the second block (after only 5 or 15pics have been presented). It seems to be replacing after every block (I assume this is the case as I have not seen repetition within blocks).


What also interesting is that, although I have used "noreplace" and "resetinterval = 1000", when I reduced the number of block in the experiment to 2 (i.e., /blocks = [1-2= addblock]) four out of five pictures were repeated in the second block the first time I ran is, but only 1 out of 5 the next time i ran it.


It seems like the counter isn't working. I have tried /select = sequence(1-15) and the first block presents all items in the sequence (1-5) in perfect order, but the second repeats items and not in order?!  If, however, I set the list to the same number of items to the number of trials (e.g., sequence(1-5) or even (6-10)) each block presents the correct pics in the correct order (i.e., behaves as predicted). I'm not even sure where to look for the problem.


If there is no solution, I guess I could creat correct length (1-5) sets of randomised order and present these, but it seems like an expensive cludge.


Any suggestions?


Thank you for your help (again, and again, and again).


Cheers, Leah






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: 12K, Visits: 98K

Correct, that's not the *only* problem. The selection problem is due to this:


/ ontrialbegin = [if(values.addpicselectionmode=="unmatched")item.addpicitem.item=getitem(item.addnonrelpic,counter.addnonmatchpic.selectedvalue)]


which instructs Inquisit to pull a random item from the counter and append it to <item addpicitem>. It does *not* determine which item <picture addp> will then *sample* from <item addpicitem> -- it will sample from whatever's in there randomly. See e.g. https://www.millisecond.com/forums/Topic8154.aspx#8154 for some more details. You'll want to fix that.


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search