Hi Yasmine,
Thanks for sending your code.
I don’t see any issues with your selection-variable logic. The only problem I see is that the value of images_per_trial (3) doesn’t divide evenly in to image_set_size (100). This means that you will run out of selections at the end of the image set repetition, regardless of whether you enter the “Trial failure” state or not.
Can you try setting image_set_size to 99? I think that will eliminate the error messages.
Cheers,
Chris
Ah! Interesting clue.
I tried setting it to 99 - and sure enough no errors. That said, Im
not sure this is a good solution as different animals will be able to
fixate a different number of stimuli per trial (typically 3-5 stimuli) so
we’ll always get this error eventually.
Two thoughts:
(1) How does MWorks currently handle this error? The console displays the
error - but the experiment continues to run. Is the next trial (which
doesn’t have enough images) shorter? Or does MWorks add new stimuli?
(2) What’s a good way to solve this problem, we thought of two options:
Option 1: when there are an insufficient number of stimuli to draw for the
next trial, MWorks can just display whatever stimuli are available. This is
simple enough - but might throw animals off by introducing unexpected
rewards.
Option 2: when there are an insufficient number of stimuli to draw for the
next trial, MWorks can just randomly draw stimuli from the image set to
achieve the required number of stimuli per trial.
Thoughts on this?
Yasmine
Hi Yasmine,
Im not sure this is a good solution as different animals will be able to fixate a different number of stimuli per trial (typically 3-5 stimuli) so we’ll always get this error eventually.
It doesn’t have to work that way. That’s just how I designed the example experiment.
How does MWorks currently handle this error? The console displays the error - but the experiment continues to run. Is the next trial (which doesn’t have enough images) shorter? Or does MWorks add new stimuli?
If a selection variable runs out of selections, its value won’t change until you reset it. This means your experiment will keep showing the last selection (i.e. image) on every subsequent trial.
What’s a good way to solve this problem, we thought of two options:
Option 1: when there are an insufficient number of stimuli to draw for the next trial, MWorks can just display whatever stimuli are available. This is simple enough - but might throw animals off by introducing unexpected rewards.
Option 2: when there are an insufficient number of stimuli to draw for the next trial, MWorks can just randomly draw stimuli from the image set to achieve the required number of stimuli per trial.
Either approach will work. The choice depends on your priorities. Do you want the animal to fixate on each image in the image set a specific, fixed number of times? Or do you want them to perform a certain number of fixed-length trials and don’t care how many times they see a particular image, so long as no image repeats until they’ve seen the complete set? Each approach requires only minor changes to your experiment. Basically, you’ll just be adding another test of
num_accepted('image_index') < image_set_size
somewhere and taking appropriate action (ending the trial or resetting the selection variable).
If you tell me how you want it to work, I’ll send you an updated example.
Cheers,
Chris