Hi Chris,
I was wondering if I could get your help understanding some behavior of my mwel code (attached).
For context, I’m new to mwel (trying to re-code my task, previously coded in Python (moog) to run purely with mwel). The code isn’t finished, I’ve just implemented the trial initialization so far.
I defined the tubes, occluders, and balls stimulus groups using a range_replicator (all reusing the local variable ‘i’, which I declared once on line 47).
In the protocol state ‘Initial’, I then queue the stimuli using while loops to iterate through the individual stimuli in the group.
This code works as expected, but when I replace the while loop on lines 171-175 with:
queue_stimulus(tubes[0])
queue_stimulus(tubes[1])
the behavior is different, specifically the tubes are drawn with the wrong x position.
Why does that happen? I don’t think I understand the order of events regarding the stimulus_group definition and then queuing and displaying. Does it have something to do with how I’m re-using the index i? How can I correct my code so that later if I want to index individual stimuli within the group (e.g. dequeue just one stimulus), the behavior is as expected?
Thanks for your help, and happy holidays!
Sol
(attachments)
balldrop.mwel (6.07 KB)